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 char *s)
 
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...
 
ScalarType operator() (const MatrixT::RowVectorType &v) const
 evaluates function at a given vector 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 MatrixT::RowVectorType ::ScalarType *values, size_type d)
 simultaneously sets values of many parameters. It is assumed that given vector contains values of subsequent parameters. More...
 
void setOrder (size_type)
 allocates necessary memory for ODE solver of order 'order' More...
 
void setParameter (size_type d, const MatrixT::RowVectorType ::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< MatrixT::RowVectorType ::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< MatrixT::RowVectorType ::ScalarType >::NodeType
inherited

◆ ScalarType

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

◆ SectionDerivativesEnclosureType

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

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

Member Function Documentation

◆ addMultiindexToMask()

void capd::map::BasicFunction< MatrixT::RowVectorType ::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< MatrixT::RowVectorType ::ScalarType >::applyC1Mask
protectedinherited

◆ check()

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

◆ clean()

void capd::map::BasicFunction< MatrixT::RowVectorType ::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< MatrixT::RowVectorType ::ScalarType >::copyObject ( const BasicFunction< MatrixT::RowVectorType ::ScalarType > &  f)
protectedinherited

an auxiliary function used in copying constructor and assignment operator

◆ createDefault()

void capd::map::BasicFunction< MatrixT::RowVectorType ::ScalarType >::createDefault
protectedinherited

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

◆ createFromText()

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

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

◆ deleteNodes()

void capd::map::BasicFunction< MatrixT::RowVectorType ::ScalarType >::deleteNodes
protectedinherited

◆ differentiateTime()

void capd::map::BasicFunction< MatrixT::RowVectorType ::ScalarType >::differentiateTime
inherited

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

◆ eval() [1/2]

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

◆ eval() [2/2]

void capd::map::BasicFunction< MatrixT::RowVectorType ::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< MatrixT::RowVectorType ::ScalarType >::evalHomogenousPolynomial
inlineprotectedinherited

◆ evalHomogenousPolynomial() [2/2]

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

◆ getCurrentTime()

const MatrixT::RowVectorType ::ScalarType & capd::map::BasicFunction< MatrixT::RowVectorType ::ScalarType >::getCurrentTime
inherited

returns actual value of variable that represents time in an ODE

◆ getMask() [1/3]

const bool* capd::map::BasicFunction< MatrixT::RowVectorType ::ScalarType >::getMask
inlineinherited

◆ getMask() [2/3]

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

◆ getMask() [3/3]

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

◆ getParameter() [1/2]

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

◆ getParameter() [2/2]

BasicFunction< MatrixT::RowVectorType ::ScalarType >::ScalarType capd::map::BasicFunction< MatrixT::RowVectorType ::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

◆ 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/3]

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

evaluates function at a given vector

◆ operator()() [2/3]

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

evaluates function (for univariate case)

◆ operator()() [3/3]

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

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

◆ realloc()

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

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

◆ reset()

void capd::map::BasicFunction< MatrixT::RowVectorType ::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< MatrixT::RowVectorType ::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< MatrixT::RowVectorType ::ScalarType >::setArgument ( const V &  v) const
protectedinherited

◆ setCurrentTime()

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

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

◆ setMask()

void capd::map::BasicFunction< MatrixT::RowVectorType ::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< MatrixT::RowVectorType ::ScalarType >::setOrder ( size_type  order)
inherited

allocates necessary memory for ODE solver of order 'order'

◆ setParameter() [1/2]

void capd::map::BasicFunction< MatrixT::RowVectorType ::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< MatrixT::RowVectorType ::ScalarType >::setParameter ( size_type  d,
const MatrixT::RowVectorType ::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< MatrixT::RowVectorType ::ScalarType >::setParameters ( const MatrixT::RowVectorType ::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< MatrixT::RowVectorType ::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< MatrixT::RowVectorType ::ScalarType >::m_evalPath
protectedinherited

reduced graph - only nodes with nontrivial evaluations are left

◆ m_fullGraph

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

graph representing the expression

◆ m_indexOfFirstParam

size_type capd::map::BasicFunction< MatrixT::RowVectorType ::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< MatrixT::RowVectorType ::ScalarType >::m_nodes
protectedinherited

◆ m_pos

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

indices of roots of expressions for each component

◆ m_var

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

variables, time and parameters