MC++
mc::CVar< T > Class Template Reference

C++ class for Chebyshev model computation of factorable function - Chebyshev model propagation. More...

#include <cmodel.hpp>

Inheritance diagram for mc::CVar< T >:
Collaboration diagram for mc::CVar< T >:

Public Member Functions

CModel< T > * env () const
 Get pointer to linked Chebyshev model environment.
 
 CVar (const double d=0.)
 Constructor of Chebyshev variable for a real scalar.
 
 CVar (const T &B)
 Constructor of Chebyshev variable for a remainder bound.
 
 CVar (CModel< T > *CM, const unsigned int ix, const T &X)
 Constructor of Chebyshev variable with index ix (starting from 0) and bounded by X
 
template<typename U >
 CVar (CModel< T > *&CM, const CVar< U > &CV)
 Copy constructor of Chebyshev variable in different Chebyshev model environment (with implicit type conversion)
 
template<typename U >
 CVar (CModel< T > *&CM, const CVar< U > &CV, const T &(U::*method)() const )
 Copy constructor of Chebyshev variable in different Chebyshev model environment (with explicit type conversion as given by class member function method)
 
template<typename U >
 CVar (CModel< T > *&CM, const CVar< U > &CV, T(*method)(const U &))
 Copy constructor of Chebyshev variable in different Chebyshev model environment (with explicit type conversion as given by non-class member function method)
 
 CVar (const CVar< T > &CV)
 Copy constructor of Chebyshev variable.
 
 ~CVar ()
 Destructor of Chebyshev variable.
 
CVar< T > & set (CModel< T > *CM, const unsigned int ix, const T &X)
 Set Chebyshev variable with index ix (starting from 0) and bounded by X
 
CVar< T > & set (CModel< T > *CM)
 Set Chebyshev model environment in Chebyshev variable to env
 
double polynomial (const double *x) const
 Evaluate polynomial part at x
 
double P (const double *x) const
 Shortcut to mc::CVar::polynomial.
 
CVar< T > polynomial () const
 Return new Chebyshev variable with same multivariate polynomial part but zero remainder.
 
CVar< T > P () const
 Shortcut to mc::CVar::polynomial.
 
CVar< T > & center ()
 Center remainder term of Chebyshev variable.
 
CVar< T > & C ()
 Shortcut to mc::CVar::center.
 
double constant (const bool reset=false)
 Get coefficient of constant term in Chebyshev variable. The value of this coefficient is reset to 0 if reset=true, otherwise it is left unmodified (default).
 
double * linear () const
 Get pointer to array of size nvar with coefficients of linear term in Chebyshev variable.
 
double linear (const unsigned int ivar, const bool reset=false)
 Get coefficients of linear term for variable ivar in Chebyshev variable. The value of this coefficient is reset to 0 if reset=true, otherwise it is left unmodified (default).
 
unsigned int nord () const
 Order of polynomial model.
 
unsigned int nvar () const
 Number of variables in polynomial model.
 
unsigned int nmon () const
 Total number of monomial terms in polynomial model.
 
virtual PolyVar< T > & set (PolyModel *env)
 Set polynomial model environment in variable as env
 
virtual PolyVar< T > & set (const double *coefmon)
 Set multivariate polynomial coefficients in variable as coefmon
 
virtual PolyVar< T > & set (std::pair< unsigned int, const double * > &coefmon)
 Set multivariate polynomial coefficients in variable as coefmon - only first coefmon.first coefficients are set.
 
virtual PolyVar< T > & set (const T &bndrem)
 Set remainder term in variable as bndrem
 
virtual PolyVar< T > & set (const PolyVar< T > &var, const bool reset=true)
 Set multivariate polynomial coefficients and remainder term equal to those in variable var, possibly defined in another Taylor model environment with less variables or with a different expansion order. Coefficients involving other variables or higher order are initialized to 0 if reset=true (default), otherwise they are left unmodified. Higher-order terms in TV are bounded and added to the remainder bound.
 
virtual PolyVar< T > & get (PolyVar< T > &var, const bool reset=false)
 Copy multivariate polynomial coefficients from current variable into variable var, possibly defined in another polynomial model environment with less variables or with a lower expansion order. Copied coefficients are reset to 0 in current Taylor variable if reset=true, otherwise they are left unmodified (default).
 
virtual T bound (const int type) const
 Compute bound on variable using bounder type
 
bound () const
 Retreive bound on variable using default bounder.
 
bndpol () const
 Retreive bound on multivariate polynomial using default bounder.
 
bndord (const unsigned int iord) const
 Retreive bound on all terms with (total) order iord in polynomial model.
 
remainder () const
 Return remainder term of variable.
 
virtual T B (const int type) const
 Shortcut to mc::PolyVar::bound.
 
virtual T B () const
 Shortcut to mc::PolyVar::bound.
 
R () const
 Shortcut to mc::PolyVar::remainder.
 
double coefmon (const unsigned int *iexp) const
 Get (possibly scaled) coefficient in monomial term with variable exponents as given in iexp
 
std::pair< unsigned int, const
double * > 
coefmon () const
 Get pair of size of, and const pointer to, array of (possibly scaled) monomial coefficients in multivariate polynomial of Taylor variable.
 
std::pair< unsigned int, const
unsigned int * > 
expmon () const
 Get pair of size of, and const pointer to, array of monomial exponents in multivariate polynomial of Taylor variable.
 

Protected Member Functions

unsigned int _posord (const unsigned int iord) const
 Index of first monomial term of order iord in polynomial model.
 
const unsigned int * _expmon (const unsigned int imon) const
 Const pointer to array of size nvar of variable exponents in monomial term imon of polynomial model.
 
const unsigned int _loc_expmon (const unsigned int *iexp) const
 Index of monomial term whose variable exponents are the same as those in array iexp (of size nvar())
 
poly_size _get_binom (const unsigned int n, const unsigned int k) const
 Get binomial coefficient \(\left(\stackrel{n}{k}\right)\).
 
void _size (PolyModel *env)
 Initialize private/protected members of variable.
 
void _resize (PolyModel *env)
 Reinitialize private/protected members of variable.
 
void _cleanup ()
 Clean up private/protected members of variable.
 
PolyVar< T > & _set (const PolyVar< T > &var)
 Set variable equal to var
 
virtual void _center ()
 Center remainder error term _bndrem
 
virtual void _set_bndpol (const T &bndpol)
 Set polynomial bound in variable as bndpol
 
virtual void _set_bndpol (const T *bndpol)
 Set polynomial bound in variable as bndpol
 
virtual void _unset_bndpol ()
 Unset polynomial bound in variable.
 

Protected Attributes

PolyModel_PM
 Pointer to corresponding polynomial model environment.
 
double * _coefmon
 Array of size _nmon with monomial coefficients of variable.
 
T * _bndord
 Array of size _nord+2 with bounds for all terms of degrees iord=0,...,_nord as well as the remainder bound at position _nord+1 of variable (possibly inaccurate - see _bndord_uptd)
 
bool _bndord_uptd
 Whether the bounds in bndord are up-to-date.
 
T * _bndrem
 Pointer to remainder bound of variable (possibly NULL if not computed)
 
T * _bndpol
 Pointer to polynomial bound of variable.
 

Detailed Description

template<typename T>
class mc::CVar< T >

mc::CVar is a C++ class for propagation of Chebyshev models through factorable functions. The template parameter corresponds to the type used in computing the remainder bound.


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