GiNaC  1.8.0
fderivative.h
Go to the documentation of this file.
1 
5 /*
6  * GiNaC Copyright (C) 1999-2020 Johannes Gutenberg University Mainz, Germany
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21  */
22 
23 #ifndef GINAC_FDERIVATIVE_H
24 #define GINAC_FDERIVATIVE_H
25 
26 #include "function.h"
27 
28 #include <set>
29 
30 namespace GiNaC {
31 
32 typedef std::multiset<unsigned> paramset;
33 
37 class fderivative : public function
38 {
40 
41  // other constructors
42 public:
48  fderivative(unsigned ser, unsigned param, const exvector & args);
49 
55  fderivative(unsigned ser, const paramset & params, const exvector & args);
56 
57  // internal constructors
58  fderivative(unsigned ser, const paramset & params, exvector && v);
59 
60  // functions overriding virtual functions from base classes
61 public:
62  void print(const print_context & c, unsigned level = 0) const override;
63  ex eval() const override;
64  ex series(const relational & r, int order, unsigned options = 0) const override;
65  ex thiscontainer(const exvector & v) const override;
66  ex thiscontainer(exvector && v) const override;
67  void archive(archive_node& n) const override;
68  void read_archive(const archive_node& n, lst& syms) override;
69 protected:
70  ex derivative(const symbol & s) const override;
71  bool is_equal_same_type(const basic & other) const override;
72  bool match_same_type(const basic & other) const override;
73 
74  // non-virtual functions in this class
75 public:
76  const paramset& derivatives() const;
77 protected:
78  void do_print(const print_context & c, unsigned level) const;
79  void do_print_latex(const print_context & c, unsigned level) const;
80  void do_print_csrc(const print_csrc & c, unsigned level) const;
81  void do_print_tree(const print_tree & c, unsigned level) const;
82 
83  // member variables
84 protected:
86 };
88 
89 } // namespace GiNaC
90 
91 #endif // ndef GINAC_DERIVATIVE_H
Interface to class of symbolic functions.
This class represents the (abstract) derivative of a symbolic function.
Definition: fderivative.h:37
exset syms
Definition: factor.cpp:2434
void do_print(const print_context &c, unsigned level) const
void archive(archive_node &n) const override
Archive the object.
Definition: fderivative.cpp:82
Definition: add.cpp:38
This class holds a relation consisting of two expressions and a logical relation between them...
Definition: relational.h:34
ex thiscontainer(const exvector &v) const override
ex eval() const override
Perform automatic non-interruptive term rewriting rules.
void read_archive(const archive_node &n, lst &syms) override
Load (deserialize) the object from an archive node.
Definition: fderivative.cpp:67
This class is the ABC (abstract base class) of GiNaC&#39;s class hierarchy.
Definition: basic.h:104
void do_print_csrc(const print_csrc &c, unsigned level) const
const paramset & derivatives() const
Expose this object&#39;s derivative structure.
size_t r
Definition: factor.cpp:770
std::multiset< unsigned > paramset
Definition: fderivative.h:32
void do_print_latex(const print_context &c, unsigned level) const
unsigned options
Definition: factor.cpp:2480
ex derivative(const symbol &s) const override
Implementation of ex::diff() for derivatives.
std::vector< ex > exvector
Definition: basic.h:46
fderivative(unsigned ser, unsigned param, const exvector &args)
Construct derivative with respect to one parameter.
Definition: fderivative.cpp:50
bool is_equal_same_type(const basic &other) const override
Returns true if two objects of same type are equal.
size_t n
Definition: factor.cpp:1463
Base class for print_contexts.
Definition: print.h:102
This class stores all properties needed to record/retrieve the state of one object of class basic (or...
Definition: archive.h:48
Lightweight wrapper for GiNaC&#39;s symbolic objects.
Definition: ex.h:72
void print(const print_context &c, unsigned level=0) const override
Output to stream.
Definition: fderivative.cpp:97
int order
Basic CAS symbol.
Definition: symbol.h:38
ex series(const relational &r, int order, unsigned options=0) const override
The series expansion of derivatives falls back to Taylor expansion.
Wrapper template for making GiNaC classes out of STL containers.
Definition: container.h:73
#define GINAC_DECLARE_REGISTERED_CLASS(classname, supername)
Macro for inclusion in the declaration of each registered class.
Definition: registrar.h:153
Base context for C source output.
Definition: print.h:157
paramset parameter_set
Set of parameter numbers with respect to which to take the derivative.
Definition: fderivative.h:85
GINAC_DECLARE_UNARCHIVER(add)
bool match_same_type(const basic &other) const override
Returns true if the attributes of two objects are similar enough for a match.
size_t c
Definition: factor.cpp:770
The class function is used to implement builtin functions like sin, cos...
Definition: function.h:673
void do_print_tree(const print_tree &c, unsigned level) const
Context for tree-like output for debugging.
Definition: print.h:146

This page is part of the GiNaC developer's reference. It was generated automatically by doxygen. For an introduction, see the tutorial.