CAPD DynSys Library 5.2.0
capd::poincare::NonlinearSection< MatrixT > Class Template Referenceabstract

TimeMap class provides class that serves as Poincare section of the form x_i = c. More...

#include <capd/poincare/NonlinearSection.h>

Public Types

typedef MatrixT MatrixType
 
typedef MatrixType::RowVectorType VectorType
 
typedef MatrixType::ScalarType ScalarType
 
typedef VectorType::size_type size_type
 integral type used to index containers (vectors, matrices, etc) More...
 
typedef capd::dynset::AbstractSet< VectorTypeSet
 type of abstract base class for all sets More...
 
typedef AbstractSection< MatrixT >::JetType JetType
 
typedef capd::map::Function< VectorTypeBaseFunction
 parses expression from given string. Allocates memory for ODE solver of order 'order' More...
 
typedef capd::diffAlgebra::Hessian< ScalarType, VectorType::csDim, VectorType::csDim > HessianType
 
typedef SectionDerivativesEnclosure< MatrixTypeSectionDerivativesEnclosureType
 
typedef capd::autodiff::DagIndexer< ScalarTypeDAG
 
typedef capd::autodiff::Node NodeType
 

Public Member Functions

 NonlinearSection (const std::string &s)
 parses expression from given string. Allocates memory for ODE solver of order 'order' More...
 
 NonlinearSection (const char *s)
 
template<typename Functional >
 NonlinearSection (Functional f, int dimIn, int noParam, size_type degree=1)
 parses expression from given routine. More...
 
NonlinearSectionoperator= (const std::string &s)
 substitution from string. Parse expression and compute new DAG. More...
 
NonlinearSectionoperator= (const char *s)
 
ScalarType operator() (const VectorType &v) const
 evaluates function at a given vector More...
 
VectorType gradient (const VectorType &v) const
 returns gradient of the function computed at vector u More...
 
ScalarType evalAt (const capd::dynset::AbstractSet< VectorType > &s) const
 
void computeDT (const JetType &, const JetType &, JetType &, size_type) const
 
virtual ScalarType gradientByVector (const VectorType &x, const VectorType &u) const
 
virtual bool isSpecialSection () const
 This is very important function. More...
 
virtual ScalarType evalAt (const Set &set) const =0
 This function computes value of section function on a given set. More...
 
virtual void computeDT (const MatrixType &derivativeOfFlow, const VectorType &gradientOnPx, const ScalarType &denominator, VectorType &result) const
 computes gradient of return time More...
 
virtual MatrixType computeDP (const VectorType &Px, const MatrixType &derivativeOfFlow, const VectorType &fieldOnPx, VectorType &dT) const
 Simultaneous computation of gradient of return time and derivative of Poincare Map dP. More...
 
virtual void computeDP (const VectorType &Px, const MatrixType &derivativeOfFlow, const HessianType &hessianOfFlow, const VectorType &fieldOnPx, const VectorType &d2Phidt2, const MatrixType &derOfVectorFieldOnPx, MatrixType &DP, HessianType &D2P, VectorType &dT, MatrixType &d2T) const
 Simultaneous computation of first and second Taylor coefficients of return time and Poincare map. More...
 
ScalarType operator() (const ScalarType &v) const
 evaluates function (for univariate case) More...
 
MatrixT::RowVectorType gradient (MatrixT::RowVectorType u) const
 returns gradient of the function computed at vector u More...
 
void setParameters (const MatrixT::RowVectorType &values)
 simultaneously sets values of many parameters. It is assumed that given vector contains values of subsequent parameters. More...
 
void setParameters (const VectorType::ScalarType *values, size_type d)
 simultaneously sets values of many parameters. It is assumed that given vector contains values of subsequent parameters. More...
 
size_type dimension () const
 returns number of main variables (does not count time and parameters) More...
 
size_type imageDimension () const
 returns number of functions (dimension of counterdomain) More...
 
void setOrder (size_type)
 allocates necessary memory for ODE solver of order 'order' More...
 
size_type getOrder () const
 returns current order of expansion with respect to the time variable More...
 
void setParameter (size_type d, const VectorType::ScalarType &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...
 
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 ScalarTypegetCurrentTime () 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...
 
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 boolgetMask () const
 
bool getMask (size_type i) const
 
bool getMask (size_type i, size_type j) const
 

Protected Member Functions

void check (const std::string &s)
 
void reset (Function f, int dimIn, int dimOut, int noParam)
 parses expression from given routine. 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...
 
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::Nodem_fullGraph
 graph representing the expression More...
 
std::vector< capd::autodiff::MyNodem_evalPath
 reduced graph - only nodes with nontrivial evaluations are left More...
 
std::vector< intm_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...
 

Detailed Description

template<typename MatrixT>
class capd::poincare::NonlinearSection< MatrixT >

TimeMap class provides class that serves as Poincare section of the form x_i = c.

The section is defined by:

  • integer - index of variable
  • constant c that defines affine hyperplane x_i=c

Member Typedef Documentation

◆ BaseFunction

template<typename MatrixT >
typedef capd::map::Function<VectorType> capd::poincare::NonlinearSection< MatrixT >::BaseFunction

parses expression from given string. Allocates memory for ODE solver of order 'order'

◆ DAG

typedef capd::autodiff::DagIndexer<ScalarType> capd::map::BasicFunction< VectorType::ScalarType >::DAG
inherited

◆ HessianType

template<class MatrixT >
typedef capd::diffAlgebra::Hessian<ScalarType,VectorType::csDim,VectorType::csDim> capd::poincare::AbstractSection< MatrixT >::HessianType
inherited

◆ JetType

template<typename MatrixT >
typedef AbstractSection<MatrixT>::JetType capd::poincare::NonlinearSection< MatrixT >::JetType

◆ MatrixType

template<typename MatrixT >
typedef MatrixT capd::poincare::NonlinearSection< MatrixT >::MatrixType

◆ NodeType

typedef capd::autodiff::Node capd::map::BasicFunction< VectorType::ScalarType >::NodeType
inherited

◆ ScalarType

template<typename MatrixT >
typedef MatrixType::ScalarType capd::poincare::NonlinearSection< MatrixT >::ScalarType

◆ SectionDerivativesEnclosureType

template<class MatrixT >
typedef SectionDerivativesEnclosure<MatrixType> capd::poincare::AbstractSection< MatrixT >::SectionDerivativesEnclosureType
inherited

◆ Set

template<typename MatrixT >
typedef capd::dynset::AbstractSet<VectorType> capd::poincare::NonlinearSection< MatrixT >::Set

type of abstract base class for all sets

◆ size_type

template<typename MatrixT >
typedef VectorType::size_type capd::poincare::NonlinearSection< MatrixT >::size_type

integral type used to index containers (vectors, matrices, etc)

◆ VectorType

template<typename MatrixT >
typedef MatrixType::RowVectorType capd::poincare::NonlinearSection< MatrixT >::VectorType

Constructor & Destructor Documentation

◆ NonlinearSection() [1/3]

template<typename MatrixT >
capd::poincare::NonlinearSection< MatrixT >::NonlinearSection ( const std::string &  s)
inline

parses expression from given string. Allocates memory for ODE solver of order 'order'

◆ NonlinearSection() [2/3]

template<typename MatrixT >
capd::poincare::NonlinearSection< MatrixT >::NonlinearSection ( const char *  s)
inline

◆ NonlinearSection() [3/3]

template<typename MatrixT >
template<typename Functional >
capd::poincare::NonlinearSection< MatrixT >::NonlinearSection ( Functional  f,
int  dimIn,
int  noParam,
size_type  degree = 1 
)
inline

parses expression from given routine.

Allocates memory for jet propagation of degree 'degree'

Parameters
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 substitution from string. Parse expression and compute new DAG.

Member Function Documentation

◆ addMultiindexToMask()

void capd::map::BasicFunction< VectorType::ScalarType >::addMultiindexToMask ( const capd::vectalg::Multiindex mi)
inlineinherited

Adds new multiindex (along with dependencies) to the existing mask.

Parameters
mimultiindex to be added to the mask
Warning
causes undefined behavior if the mask has not been set before call to this method.

◆ applyC1Mask()

void capd::map::BasicFunction< VectorType::ScalarType >::applyC1Mask
protectedinherited

◆ check()

void capd::map::Function< MatrixT::RowVectorType >::check ( const std::string &  s)
protectedinherited

◆ clean()

void capd::map::BasicFunction< VectorType::ScalarType >::clean
protectedinherited

resets all allocated data

◆ computeDT()

template<typename MatrixT >
void capd::poincare::NonlinearSection< MatrixT >::computeDT ( const JetType ,
const JetType ,
JetType ,
size_type   
) const
inline

◆ copyObject()

void capd::map::BasicFunction< VectorType::ScalarType >::copyObject ( const BasicFunction< VectorType::ScalarType > &  f)
protectedinherited

an auxiliary function used in copying constructor and assignment operator

◆ createDefault()

void capd::map::BasicFunction< VectorType::ScalarType >::createDefault
protectedinherited

used to create a default object without expression. Creates a univariate constant function f(x)=0

◆ createFromText()

void capd::map::BasicFunction< VectorType::ScalarType >::createFromText ( std::string  s)
protectedinherited

parses expression from given string. Allocates memory for ODE solver of order 'order'

◆ deleteNodes()

void capd::map::BasicFunction< VectorType::ScalarType >::deleteNodes
protectedinherited

◆ differentiateTime()

void capd::map::BasicFunction< VectorType::ScalarType >::differentiateTime
inherited

sets first derivative of time with respect to time equal to 1

◆ dimension()

size_type capd::map::BasicFunction< VectorType::ScalarType >::dimension ( ) const
inlineinherited

returns number of main variables (does not count time and parameters)

◆ eval() [1/2]

void capd::map::BasicFunction< VectorType::ScalarType >::eval ( size_type  coeffNo) const
inlineprotectedinherited

◆ eval() [2/2]

void capd::map::BasicFunction< VectorType::ScalarType >::eval ( size_type  degree,
size_type  coeffNo 
) const
inlineprotectedinherited

◆ evalAt() [1/2]

template<typename MatrixT >
ScalarType capd::poincare::NonlinearSection< MatrixT >::evalAt ( const capd::dynset::AbstractSet< VectorType > &  s) const
inline

◆ evalAt() [2/2]

template<class MatrixT >
virtual ScalarType capd::poincare::AbstractSection< MatrixT >::evalAt ( const Set set) const
pure virtualinherited

This function computes value of section function on a given set.

◆ evalHomogenousPolynomial() [1/2]

void capd::map::BasicFunction< VectorType::ScalarType >::evalHomogenousPolynomial ( ) const
inlineprotectedinherited

◆ evalHomogenousPolynomial() [2/2]

void capd::map::BasicFunction< VectorType::ScalarType >::evalHomogenousPolynomial ( size_type  degree,
size_type  coeffNo = 0 
) const
inlineprotectedinherited

◆ getCurrentTime()

const VectorType::ScalarType & capd::map::BasicFunction< VectorType::ScalarType >::getCurrentTime
inherited

returns actual value of variable that represents time in an ODE

◆ getMask() [1/3]

const bool * capd::map::BasicFunction< VectorType::ScalarType >::getMask ( ) const
inlineinherited

◆ getMask() [2/3]

bool capd::map::BasicFunction< VectorType::ScalarType >::getMask ( size_type  i) const
inlineinherited

◆ getMask() [3/3]

bool capd::map::BasicFunction< VectorType::ScalarType >::getMask ( size_type  i,
size_type  j 
) const
inlineinherited

◆ getOrder()

size_type capd::map::BasicFunction< VectorType::ScalarType >::getOrder ( ) const
inlineinherited

returns current order of expansion with respect to the time variable

◆ getParameter() [1/2]

BasicFunction< VectorType::ScalarType >::ScalarType capd::map::BasicFunction< VectorType::ScalarType >::getParameter ( const std::string &  name) const
inherited

◆ getParameter() [2/2]

BasicFunction< VectorType::ScalarType >::ScalarType capd::map::BasicFunction< VectorType::ScalarType >::getParameter ( size_type  d) const
inherited

◆ gradient() [1/2]

template<typename MatrixT >
VectorType capd::poincare::NonlinearSection< MatrixT >::gradient ( const VectorType u) const
inlinevirtual

returns gradient of the function computed at vector u

Implements capd::poincare::AbstractSection< MatrixT >.

◆ gradient() [2/2]

MatrixT::RowVectorType capd::map::Function< MatrixT::RowVectorType >::gradient ( MatrixT::RowVectorType  u) const
inherited

returns gradient of the function computed at vector u

◆ gradientByVector()

template<class MatrixT >
virtual ScalarType capd::poincare::AbstractSection< MatrixT >::gradientByVector ( const VectorType x,
const VectorType u 
) const
inlinevirtualinherited

◆ imageDimension()

size_type capd::map::BasicFunction< VectorType::ScalarType >::imageDimension ( ) const
inlineinherited

returns number of functions (dimension of counterdomain)

◆ isSpecialSection()

template<class MatrixT >
virtual bool capd::poincare::AbstractSection< MatrixT >::isSpecialSection ( ) const
inlinevirtualinherited

This is very important function.

If it returns true, class PoincareMap delegates computation of value of section(set) to the section. Otherwise it is assumed that the set has more information to compute value of section(set) in most optimal way. This is quite natural as the set knows its own representation. This function returns true for instance if the PoincareSection is given by x_i=c, where x_i is i-th coordinate and c is constant.

Reimplemented in capd::poincare::CoordinateSection< MatrixT >, and capd::poincare::CoordinateSection< MatrixType >.

◆ operator()() [1/2]

Function< MatrixT::RowVectorType >::ScalarType capd::map::Function< MatrixT::RowVectorType >::operator() ( const ScalarType v) const
inherited

evaluates function (for univariate case)

◆ operator()() [2/2]

template<typename MatrixT >
ScalarType capd::poincare::NonlinearSection< MatrixT >::operator() ( const VectorType v) const
inlinevirtual

evaluates function at a given vector

Implements capd::poincare::AbstractSection< MatrixT >.

◆ operator=() [1/2]

template<typename MatrixT >
NonlinearSection & capd::poincare::NonlinearSection< MatrixT >::operator= ( const char *  s)
inline

◆ operator=() [2/2]

template<typename MatrixT >
NonlinearSection & capd::poincare::NonlinearSection< MatrixT >::operator= ( const std::string &  s)
inline

substitution from string. Parse expression and compute new DAG.

◆ realloc()

void capd::map::BasicFunction< VectorType::ScalarType >::realloc ( size_type  degree)
protectedinherited

reallocates memory for computation of derivatives up to order 'degree'

◆ reset()

void capd::map::BasicFunction< VectorType::ScalarType >::reset ( Function  f,
int  dimIn,
int  dimOut,
int  noParam 
)
protectedinherited

parses expression from given routine.

Assignment of new function parsed from a routine.

Allocates memory for jet propagation of degree 'degree'

Parameters
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

◆ resetMask()

void capd::map::BasicFunction< VectorType::ScalarType >::resetMask ( )
inlineinherited

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.

◆ setArgument()

void capd::map::BasicFunction< VectorType::ScalarType >::setArgument ( const V &  v) const
protectedinherited

◆ setCurrentTime()

void capd::map::BasicFunction< VectorType::ScalarType >::setCurrentTime ( const ScalarType a_time) const
inherited

sets actual value of variable that represents time in an ODE.

◆ setMask()

void capd::map::BasicFunction< VectorType::ScalarType >::setMask ( Iterator  b,
Iterator  e 
)
inlineinherited

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.

Parameters
[b,e)iterator range which contains collection of multiindices
Warning
The method causes undefined behavior if a multiindex in the collection exceeds limits of the map (like dimension, maximal allowed degree).

◆ setOrder()

void capd::map::BasicFunction< VectorType::ScalarType >::setOrder ( size_type  order)
inherited

allocates necessary memory for ODE solver of order 'order'

◆ setParameter() [1/2]

void capd::map::BasicFunction< VectorType::ScalarType >::setParameter ( const std::string &  name,
const ScalarType value 
)
inherited

sets new value of a parameter. If parameter not found there is no effect.

◆ setParameter() [2/2]

void capd::map::BasicFunction< VectorType::ScalarType >::setParameter ( size_type  d,
const VectorType::ScalarType &  value 
)
inherited

sets new value of a parameter of index d.

◆ setParameters() [1/2]

void capd::map::Function< MatrixT::RowVectorType >::setParameters ( const MatrixT::RowVectorType &  values)
inherited

simultaneously sets values of many parameters. It is assumed that given vector contains values of subsequent parameters.

◆ setParameters() [2/2]

void capd::map::BasicFunction< VectorType::ScalarType >::setParameters ( const VectorType::ScalarType *  values,
size_type  d 
)
inherited

simultaneously sets values of many parameters. It is assumed that given vector contains values of subsequent parameters.

Member Data Documentation

◆ m_dag

DAG capd::map::BasicFunction< VectorType::ScalarType >::m_dag
mutableprotectedinherited

data structure that stores all the coefficients. Provides suitable indexing and evaluation of expression.

◆ m_evalPath

std::vector<capd::autodiff::MyNode> capd::map::BasicFunction< VectorType::ScalarType >::m_evalPath
protectedinherited

reduced graph - only nodes with nontrivial evaluations are left

◆ m_fullGraph

std::vector<capd::autodiff::Node> capd::map::BasicFunction< VectorType::ScalarType >::m_fullGraph
protectedinherited

graph representing the expression

◆ m_indexOfFirstParam

size_type capd::map::BasicFunction< VectorType::ScalarType >::m_indexOfFirstParam
protectedinherited

if equal to m_var.size() then no parameters specified

◆ m_nodes

std::vector<capd::autodiff::AbstractNode<ScalarType>*> capd::map::BasicFunction< VectorType::ScalarType >::m_nodes
protectedinherited

◆ m_pos

std::vector<int> capd::map::BasicFunction< VectorType::ScalarType >::m_pos
protectedinherited

indices of roots of expressions for each component

◆ m_var

std::vector<std::string> capd::map::BasicFunction< VectorType::ScalarType >::m_var
protectedinherited

variables, time and parameters