CAPD DynSys Library
5.2.0
|
This class is a basic for further protected inheritance to classes Function, Map ... More...
#include <capd/map/BasicFunction.h>
Public Types | |
typedef Scalar | ScalarType |
typedef capd::autodiff::DagIndexer< ScalarType > | DAG |
typedef DAG::size_type | size_type |
typedef capd::autodiff::Node | NodeType |
Public Member Functions | |
void | setOrder (size_type) |
allocates necessary memory for ODE solver of order 'order' More... | |
void | setParameter (size_type d, const Scalar &value) |
sets new value of a parameter of index d. More... | |
void | setParameter (const std::string &name, const ScalarType &value) |
sets new value of a parameter. If parameter not found there is no effect. More... | |
void | setParameters (const Scalar *values, size_type d) |
simultaneously sets values of many parameters. It is assumed that given vector contains values of subsequent parameters. More... | |
ScalarType | getParameter (size_type d) const |
ScalarType | getParameter (const std::string &name) const |
void | setCurrentTime (const ScalarType &a_time) const |
sets actual value of variable that represents time in an ODE. More... | |
const ScalarType & | getCurrentTime () const |
returns actual value of variable that represents time in an ODE More... | |
void | differentiateTime () const |
sets first derivative of time with respect to time equal to 1 More... | |
template<class Iterator > | |
void | setMask (Iterator b, Iterator e) |
The iterator range [b,e) should contain a range of Multiinideces the user requires to compute. More... | |
void | addMultiindexToMask (const capd::vectalg::Multiindex &mi) |
Adds new multiindex (along with dependencies) to the existing mask. More... | |
void | resetMask () |
Resets the mask of derivatives. More... | |
const bool * | getMask () const |
bool | getMask (size_type i) const |
bool | getMask (size_type i, size_type j) const |
Protected Member Functions | |
BasicFunction () | |
creates an univariate constant function f(x)=0 More... | |
BasicFunction (const std::string &s) | |
parses expression from given string. More... | |
BasicFunction (const char *s) | |
parses expression from given string. More... | |
BasicFunction (const BasicFunction &f) | |
copying constructor More... | |
template<typename Function > | |
BasicFunction (Function f, int dimIn, int dimOut, int noParam) | |
parses expression from given routine. More... | |
template<typename Function > | |
void | reset (Function f, int dimIn, int dimOut, int noParam) |
parses expression from given routine. More... | |
virtual | ~BasicFunction () |
virtual destructor - releases memory allocated for DAG representing function, map or vector field More... | |
void | operator= (const std::string &) |
substitution from string. Parses expression and compute new DAG. More... | |
void | operator= (const char *) |
substitution from string. Parses expression and compute new DAG. More... | |
void | operator= (const BasicFunction &) |
assignment from another object More... | |
void | createDefault () |
used to create a default object without expression. Creates a univariate constant function f(x)=0 More... | |
void | createFromText (std::string s) |
parses expression from given string. Allocates memory for ODE solver of order 'order' More... | |
void | copyObject (const BasicFunction &f) |
an auxiliary function used in copying constructor and assignment operator More... | |
void | clean () |
resets all allocated data More... | |
void | realloc (size_type degree) |
reallocates memory for computation of derivatives up to order 'degree' More... | |
template<class V > | |
void | setArgument (const V &v) const |
void | applyC1Mask () const |
void | evalHomogenousPolynomial () const |
void | evalHomogenousPolynomial (size_type degree, size_type coeffNo=0) const |
void | eval (size_type coeffNo) const |
void | eval (size_type degree, size_type coeffNo) const |
void | deleteNodes () |
Protected Attributes | |
std::vector< capd::autodiff::AbstractNode< ScalarType > * > | m_nodes |
std::vector< capd::autodiff::Node > | m_fullGraph |
graph representing the expression More... | |
std::vector< capd::autodiff::MyNode > | m_evalPath |
reduced graph - only nodes with nontrivial evaluations are left More... | |
std::vector< int > | m_pos |
indices of roots of expressions for each component More... | |
std::vector< std::string > | m_var |
variables, time and parameters More... | |
DAG | m_dag |
data structure that stores all the coefficients. Provides suitable indexing and evaluation of expression. More... | |
size_type | m_indexOfFirstParam |
if equal to m_var.size() then no parameters specified More... | |
This class is a basic for further protected inheritance to classes Function, Map ...
It provides constructors and methods common for all inherited classes. In particular
typedef capd::autodiff::DagIndexer<ScalarType> capd::map::BasicFunction< Scalar >::DAG |
typedef capd::autodiff::Node capd::map::BasicFunction< Scalar >::NodeType |
typedef Scalar capd::map::BasicFunction< Scalar >::ScalarType |
typedef DAG::size_type capd::map::BasicFunction< Scalar >::size_type |
|
protected |
creates an univariate constant function f(x)=0
|
protected |
parses expression from given string.
|
protected |
parses expression from given string.
|
protected |
copying constructor
|
inlineprotected |
parses expression from given routine.
Allocates memory for jet propagation of degree 'degree'
f | - routine that defines function, its signature is: void (NodeType time, NodeType in[], int dimIn, NodeType out[], int dimOut, NodeType param[], int noParam) |
dimIn | - number of input variables (dimension of domain) |
dimOut | - number of output variables (dimension of codomain) |
noParam | - number of parameters |
|
inlineprotectedvirtual |
virtual destructor - releases memory allocated for DAG representing function, map or vector field
|
inline |
Adds new multiindex (along with dependencies) to the existing mask.
mi | multiindex to be added to the mask |
|
protected |
|
protected |
resets all allocated data
|
protected |
an auxiliary function used in copying constructor and assignment operator
|
protected |
used to create a default object without expression. Creates a univariate constant function f(x)=0
|
protected |
parses expression from given string. Allocates memory for ODE solver of order 'order'
|
protected |
void capd::map::BasicFunction< Scalar >::differentiateTime |
sets first derivative of time with respect to time equal to 1
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
const Scalar & capd::map::BasicFunction< Scalar >::getCurrentTime |
returns actual value of variable that represents time in an ODE
|
inline |
|
inline |
|
inline |
BasicFunction< Scalar >::ScalarType capd::map::BasicFunction< Scalar >::getParameter | ( | const std::string & | name | ) | const |
BasicFunction< Scalar >::ScalarType capd::map::BasicFunction< Scalar >::getParameter | ( | size_type | d | ) | const |
|
protected |
assignment from another object
|
protected |
substitution from string. Parses expression and compute new DAG.
|
protected |
substitution from string. Parses expression and compute new DAG.
|
protected |
reallocates memory for computation of derivatives up to order 'degree'
|
protected |
parses expression from given routine.
Assignment of new function parsed from a routine.
Allocates memory for jet propagation of degree 'degree'
f | - routine that defines function, its signature is: void (NodeType time, NodeType in[], int dimIn, NodeType out[], int dimOut, NodeType param[], int noParam) |
dimIn | - number of input variables (dimension of domain) |
dimOut | - number of output variables (dimension of codomain) |
noParam | - number of parameters |
|
inline |
Resets the mask of derivatives.
In consequence, full jet of derivatives will be computed after call to any method that computes derivative, hessian or jet.
|
protected |
void capd::map::BasicFunction< Scalar >::setCurrentTime | ( | const ScalarType & | a_time | ) | const |
sets actual value of variable that represents time in an ODE.
|
inline |
The iterator range [b,e) should contain a range of Multiinideces the user requires to compute.
The method automatically adds all the depending partial derivatives to this collection and defines a mask for computation of partial derivtives.
[b,e) | iterator range which contains collection of multiindices |
void capd::map::BasicFunction< Scalar >::setOrder | ( | size_type | order | ) |
allocates necessary memory for ODE solver of order 'order'
void capd::map::BasicFunction< Scalar >::setParameter | ( | const std::string & | name, |
const ScalarType & | value | ||
) |
sets new value of a parameter. If parameter not found there is no effect.
void capd::map::BasicFunction< Scalar >::setParameter | ( | size_type | d, |
const Scalar & | value | ||
) |
sets new value of a parameter of index d.
void capd::map::BasicFunction< Scalar >::setParameters | ( | const Scalar * | values, |
size_type | d | ||
) |
simultaneously sets values of many parameters. It is assumed that given vector contains values of subsequent parameters.
|
mutableprotected |
data structure that stores all the coefficients. Provides suitable indexing and evaluation of expression.
|
protected |
reduced graph - only nodes with nontrivial evaluations are left
|
protected |
graph representing the expression
|
protected |
if equal to m_var.size() then no parameters specified
|
protected |
|
protected |
indices of roots of expressions for each component
|
protected |
variables, time and parameters