GiNaC  1.6.2
Public Member Functions | Protected Member Functions | Protected Attributes
GiNaC::fderivative Class Reference

This class represents the (abstract) derivative of a symbolic function. More...

#include <fderivative.h>

Inheritance diagram for GiNaC::fderivative:
GiNaC::function GiNaC::container< C > GiNaC::basic GiNaC::container_storage< C > GiNaC::refcounted

List of all members.

Public Member Functions

 fderivative (unsigned ser, unsigned param, const exvector &args)
 Construct derivative with respect to one parameter.
 fderivative (unsigned ser, const paramset &params, const exvector &args)
 Construct derivative with respect to multiple parameters.
 fderivative (unsigned ser, const paramset &params, 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.

Detailed Description

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.


Constructor & Destructor Documentation

GiNaC::fderivative::fderivative ( unsigned  ser,
unsigned  param,
const exvector args 
)

Construct derivative with respect to one parameter.

Parameters:
serSerial number of function
paramNumber of parameter with respect to which to take the derivative
argsArguments of derivative function

Definition at line 49 of file fderivative.cpp.

References parameter_set.

Referenced by derivative(), eval(), and thiscontainer().

GiNaC::fderivative::fderivative ( unsigned  ser,
const paramset params,
const exvector args 
)

Construct derivative with respect to multiple parameters.

Parameters:
serSerial number of function
paramsSet of numbers of parameters with respect to which to take the derivative
argsArguments 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.


Member Function Documentation

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.

Parameters:
cprint context object that describes the output formatting
levelvalue 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]
ex GiNaC::fderivative::evalf ( int  level = 0) const [virtual]

Numeric evaluation falls back to evaluation of arguments.

See also:
basic::evalf

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.

See also:
basic::series

Reimplemented from GiNaC::function.

Definition at line 169 of file fderivative.cpp.

ex GiNaC::fderivative::thiscontainer ( const exvector v) const

Reimplemented from GiNaC::function.

Definition at line 174 of file fderivative.cpp.

References fderivative(), parameter_set, and GiNaC::function::serial.

ex GiNaC::fderivative::thiscontainer ( std::auto_ptr< exvector vp) const

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.

ex GiNaC::fderivative::derivative ( const symbol s) const [protected, virtual]

Implementation of ex::diff() for derivatives.

It applies the chain rule.

See also:
ex::diff

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.

See also:
basic::match

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]
void GiNaC::fderivative::do_print_csrc ( const print_csrc c,
unsigned  level 
) const [protected]
void GiNaC::fderivative::do_print_tree ( const print_tree c,
unsigned  level 
) const [protected]

Member Data Documentation

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().


The documentation for this class was generated from the following files:

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