|
GiNaC
1.6.2
|
This class represents the (abstract) derivative of a symbolic function. More...
#include <fderivative.h>
Public Member Functions | |
| fderivative (unsigned ser, unsigned param, const exvector &args) | |
| Construct derivative with respect to one parameter. | |
| fderivative (unsigned ser, const paramset ¶ms, const exvector &args) | |
| Construct derivative with respect to multiple parameters. | |
| fderivative (unsigned ser, const paramset ¶ms, std::auto_ptr< exvector > vp) | |
| void | print (const print_context &c, unsigned level=0) const |
| Output to stream. | |
| ex | eval (int level=0) const |
| Perform automatic non-interruptive term rewriting rules. | |
| ex | evalf (int level=0) const |
| Numeric evaluation falls back to evaluation of arguments. | |
| ex | series (const relational &r, int order, unsigned options=0) const |
| The series expansion of derivatives falls back to Taylor expansion. | |
| ex | thiscontainer (const exvector &v) const |
| ex | thiscontainer (std::auto_ptr< exvector > vp) const |
| void | archive (archive_node &n) const |
| Archive the object. | |
| void | read_archive (const archive_node &n, lst &syms) |
| Construct object from archive_node. | |
Protected Member Functions | |
| ex | derivative (const symbol &s) const |
| Implementation of ex::diff() for derivatives. | |
| bool | is_equal_same_type (const basic &other) const |
| Returns true if two objects of same type are equal. | |
| bool | match_same_type (const basic &other) const |
| Returns true if the attributes of two objects are similar enough for a match. | |
| void | do_print (const print_context &c, unsigned level) const |
| Default output to stream. | |
| void | do_print_csrc (const print_csrc &c, unsigned level) const |
| void | do_print_tree (const print_tree &c, unsigned level) const |
| Tree output to stream. | |
Protected Attributes | |
| paramset | parameter_set |
| Set of parameter numbers with respect to which to take the derivative. | |
This class represents the (abstract) derivative of a symbolic function.
It is used to represent the derivatives of functions that do not have a derivative or series expansion procedure defined.
Definition at line 37 of file fderivative.h.
| GiNaC::fderivative::fderivative | ( | unsigned | ser, |
| unsigned | param, | ||
| const exvector & | args | ||
| ) |
Construct derivative with respect to one parameter.
| ser | Serial number of function |
| param | Number of parameter with respect to which to take the derivative |
| args | Arguments of derivative function |
Definition at line 49 of file fderivative.cpp.
References parameter_set.
Referenced by derivative(), eval(), and thiscontainer().
Construct derivative with respect to multiple parameters.
| ser | Serial number of function |
| params | Set of numbers of parameters with respect to which to take the derivative |
| args | Arguments of derivative function |
Definition at line 54 of file fderivative.cpp.
| GiNaC::fderivative::fderivative | ( | unsigned | ser, |
| const paramset & | params, | ||
| std::auto_ptr< exvector > | vp | ||
| ) |
Definition at line 58 of file fderivative.cpp.
| void GiNaC::fderivative::print | ( | const print_context & | c, |
| unsigned | level = 0 |
||
| ) | const [virtual] |
Output to stream.
This performs double dispatch on the dynamic type of *this and the dynamic type of the supplied print context.
| c | print context object that describes the output formatting |
| level | value that is used to identify the precedence or indentation level for placing parentheses and formatting |
Reimplemented from GiNaC::function.
Definition at line 96 of file fderivative.cpp.
Referenced by do_print_tree().
| ex GiNaC::fderivative::eval | ( | int | level = 0 | ) | const [virtual] |
Perform automatic non-interruptive term rewriting rules.
Reimplemented from GiNaC::function.
Definition at line 142 of file fderivative.cpp.
References GiNaC::container< C >::evalchildren(), fderivative(), GiNaC::basic::hold(), parameter_set, GiNaC::function::pderivative(), GiNaC::function::registered_functions(), GiNaC::container_storage< C >::seq, and GiNaC::function::serial.
| ex GiNaC::fderivative::evalf | ( | int | level = 0 | ) | const [virtual] |
Numeric evaluation falls back to evaluation of arguments.
Reimplemented from GiNaC::function.
Definition at line 162 of file fderivative.cpp.
| ex GiNaC::fderivative::series | ( | const relational & | r, |
| int | order, | ||
| unsigned | options = 0 |
||
| ) | const [virtual] |
The series expansion of derivatives falls back to Taylor expansion.
Reimplemented from GiNaC::function.
Definition at line 169 of file fderivative.cpp.
Reimplemented from GiNaC::function.
Definition at line 174 of file fderivative.cpp.
References fderivative(), parameter_set, and GiNaC::function::serial.
Reimplemented from GiNaC::function.
Definition at line 179 of file fderivative.cpp.
References fderivative(), parameter_set, and GiNaC::function::serial.
| void GiNaC::fderivative::archive | ( | archive_node & | n | ) | const [virtual] |
Archive the object.
Reimplemented from GiNaC::function.
Definition at line 81 of file fderivative.cpp.
References GiNaC::archive_node::add_unsigned(), GiNaC::container< C >::end(), and parameter_set.
| void GiNaC::fderivative::read_archive | ( | const archive_node & | n, |
| lst & | sym_lst | ||
| ) | [virtual] |
Construct object from archive_node.
Reimplemented from GiNaC::function.
Definition at line 66 of file fderivative.cpp.
References GiNaC::archive_node::find_unsigned(), and parameter_set.
Implementation of ex::diff() for derivatives.
It applies the chain rule.
Reimplemented from GiNaC::function.
Definition at line 186 of file fderivative.cpp.
References fderivative(), GiNaC::ex::is_zero(), parameter_set, GiNaC::container_storage< C >::seq, and GiNaC::function::serial.
| bool GiNaC::fderivative::is_equal_same_type | ( | const basic & | other | ) | const [protected, virtual] |
Returns true if two objects of same type are equal.
Normally needs not be reimplemented as long as it wasn't overwritten by some parent class, since it just calls compare_same_type(). The reason why this function exists is that sometimes it is easier to determine equality than an order relation and then it can be overridden.
Reimplemented from GiNaC::function.
Definition at line 211 of file fderivative.cpp.
References GINAC_ASSERT, and parameter_set.
| bool GiNaC::fderivative::match_same_type | ( | const basic & | other | ) | const [protected, virtual] |
Returns true if the attributes of two objects are similar enough for a match.
This function must not match subexpressions (this is already done by basic::match()). Only attributes not accessible by op() should be compared. This is also the reason why this function doesn't take the wildcard replacement list from match() as an argument: only subexpressions are subject to wildcard matches. Also, this function only needs to be implemented for container classes because is_equal_same_type() is automatically used instead of match_same_type() if nops() == 0.
Reimplemented from GiNaC::function.
Definition at line 222 of file fderivative.cpp.
References GINAC_ASSERT, and parameter_set.
| void GiNaC::fderivative::do_print | ( | const print_context & | c, |
| unsigned | level | ||
| ) | const [protected] |
Default output to stream.
Reimplemented from GiNaC::container< C >.
Definition at line 102 of file fderivative.cpp.
References GiNaC::container< C >::end(), parameter_set, GiNaC::container< C >::precedence(), GiNaC::function::precedence(), GiNaC::container< C >::printseq(), GiNaC::function::registered_functions(), GiNaC::print_context::s, and GiNaC::function::serial.
| void GiNaC::fderivative::do_print_csrc | ( | const print_csrc & | c, |
| unsigned | level | ||
| ) | const [protected] |
Definition at line 114 of file fderivative.cpp.
References GiNaC::container< C >::end(), parameter_set, GiNaC::container< C >::precedence(), GiNaC::function::precedence(), GiNaC::container< C >::printseq(), GiNaC::function::registered_functions(), GiNaC::print_context::s, and GiNaC::function::serial.
| void GiNaC::fderivative::do_print_tree | ( | const print_tree & | c, |
| unsigned | level | ||
| ) | const [protected] |
Tree output to stream.
Reimplemented from GiNaC::container< C >.
Definition at line 125 of file fderivative.cpp.
References GiNaC::print_tree::delta_indent, GiNaC::container< C >::end(), GiNaC::basic::flags, GiNaC::basic::hashvalue, GiNaC::container< C >::nops(), parameter_set, print(), GiNaC::function::registered_functions(), GiNaC::print_context::s, GiNaC::container_storage< C >::seq, and GiNaC::function::serial.
paramset GiNaC::fderivative::parameter_set [protected] |
Set of parameter numbers with respect to which to take the derivative.
Definition at line 83 of file fderivative.h.
Referenced by archive(), derivative(), do_print(), do_print_csrc(), do_print_tree(), eval(), fderivative(), is_equal_same_type(), match_same_type(), read_archive(), and thiscontainer().