CAPD::DynSys Library  6.0.0
capd::diffAlgebra::CnContainer< Object, M, N, D > Class Template Reference

The class is used to store coefficients of a multivariate polynomial of degree D $ f:R^N->R^M $ Coefficients themselves can be polynomials as well. More...

#include <capd/diffAlgebra/CnContainer.h>

Public Types

typedef capd::vectalg::Container< Object, M *N *D!=0 ? M *Binomial< N+D, D >::value :0 > BaseContainer
 
typedef Object ObjectType
 
typedef Object * iterator
 
typedef const Object * const_iterator
 
typedef capd::vectalg::Multipointer Multipointer
 
typedef capd::vectalg::Multiindex Multiindex
 
typedef __size_type size_type
 
typedef __difference_type difference_type
 
typedef Object ScalarType
 
typedef std::reverse_iterator< iteratorreverse_iterator
 
typedef std::reverse_iterator< const_iteratorconst_reverse_iterator
 

Public Member Functions

 CnContainer (size_type m, size_type n, size_type d, const Object &p)
 creates a container for polynomial of n variables, m components and degree d. Each element will be set to p. More...
 
 CnContainer (size_type m, size_type n, size_type d)
 creates a container for polynomial of n variables, m components and degree d. Default constructor will be used to initialize each element in the container. More...
 
CnContaineroperator= (const Object &p)
 assigns object p to each element of the container More...
 
 CnContainer (const CnContainer &v)=default
 
 CnContainer (CnContainer &&v)
 
CnContaineroperator= (const CnContainer &v)=default
 
CnContaineroperator= (CnContainer &&v)
 
size_type imageDimension () const
 returns number of polynomials (dimension of counterdomain) More...
 
size_type dimension () const
 returns number of variables of the polynomial More...
 
size_type degree () const
 returns degree of the polynomial More...
 
Object & operator() (size_type i, const Multipointer &mp)
 selection of coefficient of i-th component that correspond to multipointer mp More...
 
Object & operator() (size_type i, const Multipointer &, const Multipointer &)
 
Object & operator() (size_type i, const Multiindex &mi)
 selection of coefficient of i-th component that correspond to multiindex mi More...
 
const Object & operator() (size_type i, const Multipointer &) const
 selection of coefficient of i-th component that correspond to multipointer mp More...
 
const Object & operator() (size_type i, const Multipointer &, const Multipointer &) const
 
const Object & operator() (size_type i, const Multiindex &) const
 selection of coefficient of i-th component that correspond to multiindex mi More...
 
Object & operator() (size_type i)
 returns constant term of the i-th component of polynomial More...
 
Object & operator() (size_type i, size_type j)
 returns reference to a coefficient in linear part, i.e. $ df_i/dx_j $ More...
 
Object & operator() (size_type i, size_type j, size_type c)
 returns reference to a coefficient in second order part, i.e. $ d^2f_i/dx_jdx_c $ More...
 
Object & operator() (size_type i, size_type j, size_type c, size_type k)
 returns reference to a coefficient in third order part, i.e. $ d^3f_i/dx_jdx_cdx_k $ More...
 
const Object & operator() (size_type i) const
 returns constant term of the i-th component of polynomial More...
 
const Object & operator() (size_type i, size_type j) const
 returns read only reference to a coefficient in linear part, i.e. $ df_i/dx_j $ More...
 
const Object & operator() (size_type i, size_type j, size_type c) const
 returns read only reference to a coefficient in second order part, i.e. $ d^2f_i/dx_jdx_c $ More...
 
const Object & operator() (size_type i, size_type j, size_type c, size_type k) const
 returns read only reference to a coefficient in third order part, i.e. $ d^3f_i/dx_jdx_cdx_k $ More...
 
iterator begin (size_type i)
 iterator selection. Returns iterator to the first coefficient of the i-th component More...
 
iterator end (size_type i)
 iterator selection. Returns iterator to an element after the last element the i-th component More...
 
iterator begin (size_type i, size_type d)
 iterator selection. Returns iterator to the first coefficient of the i-th component of the homogeneous part of degree 'd' More...
 
iterator end (size_type i, size_type d)
 iterator selection. Returns iterator to an element after the last coefficient of the i-th component of the homogeneous part of degree 'd' More...
 
const_iterator begin (size_type i) const
 iterator selection. Returns iterator to the first coefficient of the i-th component More...
 
const_iterator end (size_type i) const
 iterator selection. Returns iterator to an element after the last element the i-th component More...
 
const_iterator begin (size_type i, size_type d) const
 iterator selection. Returns iterator to the first coefficient of the i-th component of the homogeneous part of degree 'd' More...
 
const_iterator end (size_type i, size_type d) const
 iterator selection. Returns iterator to an element after the last coefficient of the i-th component of the homogeneous part of degree 'd' More...
 
Multipointer first (size_type d) const
 Selection of elements by multipointers. More...
 
bool hasNext (Multipointer &) const
 see description of the method first. More...
 
bool hasNext (Multiindex &) const
 see description of the method first. More...
 
iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 
reverse_iterator rbegin ()
 
const_reverse_iterator rbegin () const
 
reverse_iterator rend ()
 
const_reverse_iterator rend () const
 
void resize (size_type newCapacity)
 
ScalarTypeoperator[] (size_type)
 
const ScalarTypeoperator[] (size_type) const
 
ScalarTypeoperator() (size_type)
 
const ScalarTypeoperator() (size_type) const
 
void clear ()
 

Static Public Member Functions

static size_type size ()
 

Protected Attributes

size_type m_N
 number of variables More...
 
size_type m_M
 number of components More...
 
size_type m_D
 total degree of polynomial More...
 
ScalarType data [capacity]
 

Friends

void swap (CnContainer &A, CnContainer &B)
 

Detailed Description

template<typename Object, __size_type M, __size_type N, __size_type D>
class capd::diffAlgebra::CnContainer< Object, M, N, D >

The class is used to store coefficients of a multivariate polynomial of degree D $ f:R^N->R^M $ Coefficients themselves can be polynomials as well.

Usually Object = Scalar or an univariate polynomial

The total number of coefficients is equal to $ M {N+D\choose D} $

Member Typedef Documentation

◆ BaseContainer

template<typename Object , __size_type M, __size_type N, __size_type D>
typedef capd::vectalg::Container<Object,M*N*D!=0 ? M*Binomial<N+D,D>::value : 0> capd::diffAlgebra::CnContainer< Object, M, N, D >::BaseContainer

◆ const_iterator

template<typename Object , __size_type M, __size_type N, __size_type D>
typedef const Object* capd::diffAlgebra::CnContainer< Object, M, N, D >::const_iterator

◆ const_reverse_iterator

typedef std::reverse_iterator<const_iterator> capd::vectalg::Container< Object , capacity >::const_reverse_iterator
inherited

◆ difference_type

template<typename Object , __size_type M, __size_type N, __size_type D>
typedef __difference_type capd::diffAlgebra::CnContainer< Object, M, N, D >::difference_type

◆ iterator

template<typename Object , __size_type M, __size_type N, __size_type D>
typedef Object* capd::diffAlgebra::CnContainer< Object, M, N, D >::iterator

◆ Multiindex

template<typename Object , __size_type M, __size_type N, __size_type D>
typedef capd::vectalg::Multiindex capd::diffAlgebra::CnContainer< Object, M, N, D >::Multiindex

◆ Multipointer

template<typename Object , __size_type M, __size_type N, __size_type D>
typedef capd::vectalg::Multipointer capd::diffAlgebra::CnContainer< Object, M, N, D >::Multipointer

◆ ObjectType

template<typename Object , __size_type M, __size_type N, __size_type D>
typedef Object capd::diffAlgebra::CnContainer< Object, M, N, D >::ObjectType

◆ reverse_iterator

typedef std::reverse_iterator<iterator> capd::vectalg::Container< Object , capacity >::reverse_iterator
inherited

◆ ScalarType

typedef Object capd::vectalg::Container< Object , capacity >::ScalarType
inherited

◆ size_type

template<typename Object , __size_type M, __size_type N, __size_type D>
typedef __size_type capd::diffAlgebra::CnContainer< Object, M, N, D >::size_type

Constructor & Destructor Documentation

◆ CnContainer() [1/4]

template<typename Object , __size_type M, __size_type N, __size_type D>
capd::diffAlgebra::CnContainer< Object, M, N, D >::CnContainer ( size_type  m,
size_type  n,
size_type  d,
const Object &  p 
)
inline

creates a container for polynomial of n variables, m components and degree d. Each element will be set to p.

◆ CnContainer() [2/4]

template<typename Object , __size_type M, __size_type N, __size_type D>
capd::diffAlgebra::CnContainer< Object, M, N, D >::CnContainer ( size_type  m,
size_type  n,
size_type  d 
)
inline

creates a container for polynomial of n variables, m components and degree d. Default constructor will be used to initialize each element in the container.

◆ CnContainer() [3/4]

template<typename Object , __size_type M, __size_type N, __size_type D>
capd::diffAlgebra::CnContainer< Object, M, N, D >::CnContainer ( const CnContainer< Object, M, N, D > &  v)
default

◆ CnContainer() [4/4]

template<typename Object , __size_type M, __size_type N, __size_type D>
capd::diffAlgebra::CnContainer< Object, M, N, D >::CnContainer ( CnContainer< Object, M, N, D > &&  v)
inline

Member Function Documentation

◆ begin() [1/6]

Container< Object , capacity >::iterator capd::vectalg::Container< Object , capacity >::begin
inlineinherited

◆ begin() [2/6]

Container< Object , capacity >::const_iterator capd::vectalg::Container< Object , capacity >::begin
inlineinherited

◆ begin() [3/6]

template<typename Object , __size_type M, __size_type N, __size_type D>
CnContainer< Object, M, N, D >::iterator capd::diffAlgebra::CnContainer< Object, M, N, D >::begin ( size_type  i)
inline

iterator selection. Returns iterator to the first coefficient of the i-th component

◆ begin() [4/6]

template<typename Object , __size_type M, __size_type N, __size_type D>
CnContainer< Object, M, N, D >::const_iterator capd::diffAlgebra::CnContainer< Object, M, N, D >::begin ( size_type  i) const
inline

iterator selection. Returns iterator to the first coefficient of the i-th component

◆ begin() [5/6]

template<typename Object , __size_type M, __size_type N, __size_type D>
CnContainer< Object, M, N, D >::iterator capd::diffAlgebra::CnContainer< Object, M, N, D >::begin ( size_type  i,
size_type  d 
)
inline

iterator selection. Returns iterator to the first coefficient of the i-th component of the homogeneous part of degree 'd'

◆ begin() [6/6]

template<typename Object , __size_type M, __size_type N, __size_type D>
CnContainer< Object, M, N, D >::const_iterator capd::diffAlgebra::CnContainer< Object, M, N, D >::begin ( size_type  i,
size_type  d 
) const
inline

iterator selection. Returns iterator to the first coefficient of the i-th component of the homogeneous part of degree 'd'

◆ clear()

void capd::vectalg::Container< Object , capacity >::clear
inherited

◆ degree()

template<typename Object , __size_type M, __size_type N, __size_type D>
CnContainer< Object, M, N, D >::size_type capd::diffAlgebra::CnContainer< Object, M, N, D >::degree
inline

returns degree of the polynomial

◆ dimension()

template<typename Object , __size_type M, __size_type N, __size_type D>
CnContainer< Object, M, N, D >::size_type capd::diffAlgebra::CnContainer< Object, M, N, D >::dimension
inline

returns number of variables of the polynomial

◆ end() [1/6]

Container< Object , capacity >::iterator capd::vectalg::Container< Object , capacity >::end
inlineinherited

◆ end() [2/6]

Container< Object , capacity >::const_iterator capd::vectalg::Container< Object , capacity >::end
inlineinherited

◆ end() [3/6]

template<typename Object , __size_type M, __size_type N, __size_type D>
CnContainer< Object, M, N, D >::iterator capd::diffAlgebra::CnContainer< Object, M, N, D >::end ( size_type  i)
inline

iterator selection. Returns iterator to an element after the last element the i-th component

◆ end() [4/6]

template<typename Object , __size_type M, __size_type N, __size_type D>
CnContainer< Object, M, N, D >::const_iterator capd::diffAlgebra::CnContainer< Object, M, N, D >::end ( size_type  i) const
inline

iterator selection. Returns iterator to an element after the last element the i-th component

◆ end() [5/6]

template<typename Object , __size_type M, __size_type N, __size_type D>
CnContainer< Object, M, N, D >::iterator capd::diffAlgebra::CnContainer< Object, M, N, D >::end ( size_type  i,
size_type  d 
)
inline

iterator selection. Returns iterator to an element after the last coefficient of the i-th component of the homogeneous part of degree 'd'

◆ end() [6/6]

template<typename Object , __size_type M, __size_type N, __size_type D>
CnContainer< Object, M, N, D >::const_iterator capd::diffAlgebra::CnContainer< Object, M, N, D >::end ( size_type  i,
size_type  d 
) const
inline

iterator selection. Returns iterator to an element after the last coefficient of the i-th component of the homogeneous part of degree 'd'

◆ first()

template<typename Object , __size_type M, __size_type N, __size_type D>
CnContainer< Object, M, N, D >::Multipointer capd::diffAlgebra::CnContainer< Object, M, N, D >::first ( size_type  degree) const
inline

Selection of elements by multipointers.

Resizes CnContainer.

Iterators do not give information about the index of partial derivative. Access by multipointer is significantly slower than by iterator because the multipointer must be recomputed to the index in array.

Typical usage of multipointers is as follows: Multipointer mp = cnContainer.first(d); int i = ...; // fix i-th component do{ // do something cout << mp << "\t" << cnContainer(i,mp) << endl; }while(cnContainer.hasNext(mp)); Iterators and multipointers read coefficients of a homogeneous polynomial in the same order.

Parameters
newRanknew maximal order
newDimensionnew dimension
copyDataflag that controls if data is copied

◆ hasNext() [1/2]

template<typename Object , __size_type M, __size_type N, __size_type D>
bool capd::diffAlgebra::CnContainer< Object, M, N, D >::hasNext ( Multiindex mp) const

see description of the method first.

◆ hasNext() [2/2]

template<typename Object , __size_type M, __size_type N, __size_type D>
bool capd::diffAlgebra::CnContainer< Object, M, N, D >::hasNext ( Multipointer mp) const

see description of the method first.

◆ imageDimension()

template<typename Object , __size_type M, __size_type N, __size_type D>
CnContainer< Object, M, N, D >::size_type capd::diffAlgebra::CnContainer< Object, M, N, D >::imageDimension
inline

returns number of polynomials (dimension of counterdomain)

◆ operator()() [1/16]

template<typename Object , __size_type M, __size_type N, __size_type D>
Object & capd::diffAlgebra::CnContainer< Object, M, N, D >::operator() ( size_type  i)
inline

returns constant term of the i-th component of polynomial

◆ operator()() [2/16]

template<typename Object , __size_type M, __size_type N, __size_type D>
const Object & capd::diffAlgebra::CnContainer< Object, M, N, D >::operator() ( size_type  i) const
inline

returns constant term of the i-th component of polynomial

◆ operator()() [3/16]

template<typename Object , __size_type M, __size_type N, __size_type D>
const Object & capd::diffAlgebra::CnContainer< Object, M, N, D >::operator() ( size_type  i,
const Multiindex mi 
) const
inline

selection of coefficient of i-th component that correspond to multiindex mi

◆ operator()() [4/16]

template<typename Object , __size_type M, __size_type N, __size_type D>
Object & capd::diffAlgebra::CnContainer< Object, M, N, D >::operator() ( size_type  i,
const Multiindex mi 
)
inline

selection of coefficient of i-th component that correspond to multiindex mi

◆ operator()() [5/16]

template<typename Object , __size_type M, __size_type N, __size_type D>
const Object & capd::diffAlgebra::CnContainer< Object, M, N, D >::operator() ( size_type  i,
const Multipointer mp 
) const
inline

selection of coefficient of i-th component that correspond to multipointer mp

◆ operator()() [6/16]

template<typename Object , __size_type M, __size_type N, __size_type D>
Object & capd::diffAlgebra::CnContainer< Object, M, N, D >::operator() ( size_type  i,
const Multipointer mp,
const Multipointer sub 
)
inline

◆ operator()() [7/16]

template<typename Object , __size_type M, __size_type N, __size_type D>
const Object & capd::diffAlgebra::CnContainer< Object, M, N, D >::operator() ( size_type  i,
const Multipointer mp,
const Multipointer sub 
) const
inline

◆ operator()() [8/16]

template<typename Object , __size_type M, __size_type N, __size_type D>
Object & capd::diffAlgebra::CnContainer< Object, M, N, D >::operator() ( size_type  i,
const Multipointer mp 
)
inline

selection of coefficient of i-th component that correspond to multipointer mp

◆ operator()() [9/16]

template<typename Object , __size_type M, __size_type N, __size_type D>
Object & capd::diffAlgebra::CnContainer< Object, M, N, D >::operator() ( size_type  i,
size_type  j 
)
inline

returns reference to a coefficient in linear part, i.e. $ df_i/dx_j $

◆ operator()() [10/16]

template<typename Object , __size_type M, __size_type N, __size_type D>
const Object & capd::diffAlgebra::CnContainer< Object, M, N, D >::operator() ( size_type  i,
size_type  j 
) const
inline

returns read only reference to a coefficient in linear part, i.e. $ df_i/dx_j $

◆ operator()() [11/16]

template<typename Object , __size_type M, __size_type N, __size_type D>
Object & capd::diffAlgebra::CnContainer< Object, M, N, D >::operator() ( size_type  i,
size_type  j,
size_type  c 
)
inline

returns reference to a coefficient in second order part, i.e. $ d^2f_i/dx_jdx_c $

◆ operator()() [12/16]

template<typename Object , __size_type M, __size_type N, __size_type D>
const Object & capd::diffAlgebra::CnContainer< Object, M, N, D >::operator() ( size_type  i,
size_type  j,
size_type  c 
) const
inline

returns read only reference to a coefficient in second order part, i.e. $ d^2f_i/dx_jdx_c $

◆ operator()() [13/16]

template<typename Object , __size_type M, __size_type N, __size_type D>
Object & capd::diffAlgebra::CnContainer< Object, M, N, D >::operator() ( size_type  i,
size_type  j,
size_type  c,
size_type  k 
)
inline

returns reference to a coefficient in third order part, i.e. $ d^3f_i/dx_jdx_cdx_k $

◆ operator()() [14/16]

template<typename Object , __size_type M, __size_type N, __size_type D>
const Object & capd::diffAlgebra::CnContainer< Object, M, N, D >::operator() ( size_type  i,
size_type  j,
size_type  c,
size_type  k 
) const
inline

returns read only reference to a coefficient in third order part, i.e. $ d^3f_i/dx_jdx_cdx_k $

◆ operator()() [15/16]

Object & capd::vectalg::Container< Object , capacity >::operator() ( size_type  i)
inlineinherited

◆ operator()() [16/16]

const Object & capd::vectalg::Container< Object , capacity >::operator() ( size_type  i) const
inlineinherited

◆ operator=() [1/3]

template<typename Object , __size_type M, __size_type N, __size_type D>
CnContainer& capd::diffAlgebra::CnContainer< Object, M, N, D >::operator= ( CnContainer< Object, M, N, D > &&  v)
inline

◆ operator=() [2/3]

template<typename Object , __size_type M, __size_type N, __size_type D>
CnContainer& capd::diffAlgebra::CnContainer< Object, M, N, D >::operator= ( const CnContainer< Object, M, N, D > &  v)
default

◆ operator=() [3/3]

template<typename Object , __size_type M, __size_type N, __size_type D>
CnContainer< Object, M, N, D > & capd::diffAlgebra::CnContainer< Object, M, N, D >::operator= ( const Object &  p)

assigns object p to each element of the container

◆ operator[]() [1/2]

Object & capd::vectalg::Container< Object , capacity >::operator[] ( size_type  i)
inlineinherited

◆ operator[]() [2/2]

const Object & capd::vectalg::Container< Object , capacity >::operator[] ( size_type  i) const
inlineinherited

◆ rbegin() [1/2]

Container< Object , capacity >::reverse_iterator capd::vectalg::Container< Object , capacity >::rbegin
inlineinherited

◆ rbegin() [2/2]

Container< Object , capacity >::const_reverse_iterator capd::vectalg::Container< Object , capacity >::rbegin
inlineinherited

◆ rend() [1/2]

Container< Object , capacity >::reverse_iterator capd::vectalg::Container< Object , capacity >::rend
inlineinherited

◆ rend() [2/2]

Container< Object , capacity >::const_reverse_iterator capd::vectalg::Container< Object , capacity >::rend
inlineinherited

◆ resize()

void capd::vectalg::Container< Object , capacity >::resize ( size_type  newCapacity)
inherited

◆ size()

static size_type capd::vectalg::Container< Object , capacity >::size ( )
inlinestaticinherited

Friends And Related Function Documentation

◆ swap

template<typename Object , __size_type M, __size_type N, __size_type D>
void swap ( CnContainer< Object, M, N, D > &  A,
CnContainer< Object, M, N, D > &  B 
)
friend

< swaps the content of two containers

Member Data Documentation

◆ data

ScalarType capd::vectalg::Container< Object , capacity >::data[capacity]
protectedinherited

◆ m_D

template<typename Object , __size_type M, __size_type N, __size_type D>
size_type capd::diffAlgebra::CnContainer< Object, M, N, D >::m_D
protected

total degree of polynomial

◆ m_M

template<typename Object , __size_type M, __size_type N, __size_type D>
size_type capd::diffAlgebra::CnContainer< Object, M, N, D >::m_M
protected

number of components

◆ m_N

template<typename Object , __size_type M, __size_type N, __size_type D>
size_type capd::diffAlgebra::CnContainer< Object, M, N, D >::m_N
protected

number of variables


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