MC++
|
C++ class for Taylor model computation of factorable function - Taylor model propagation. More...
#include <tmodel.hpp>
Public Member Functions | |
TModel< T > * | env () const |
Get pointer to linked Taylor model environment. | |
TVar (const double d=0.) | |
Constructor of Taylor variable for a real scalar. | |
TVar (const T &B) | |
Constructor of Taylor variable for a remainder bound. | |
TVar (TModel< T > *TM, const unsigned int ix, const T &X, const double Xref) | |
Constructor of Taylor variable with index ix (starting from 0), bounded by X, and with reference point Xref | |
TVar (TModel< T > *TM, const unsigned int ix, const T &X) | |
Constructor of Taylor variable with index ix (starting from 0), bounded by X, and with reference point at mid-point Op<T>::mid(X) | |
template<typename U > | |
TVar (TModel< T > *&TM, const TVar< U > &TV) | |
Copy constructor of Taylor variable in different Taylor model environment (with implicit type conversion) | |
template<typename U > | |
TVar (TModel< T > *&TM, const TVar< U > &TV, const T &(U::*method)() const ) | |
Copy constructor of Taylor variable in different Taylor model environment (with explicit type conversion as given by class member function method) | |
template<typename U > | |
TVar (TModel< T > *&TM, const TVar< U > &TV, T(*method)(const U &)) | |
Copy constructor of Taylor variable in different Taylor model environment (with explicit type conversion as given by non-class member function method) | |
TVar (const TVar< T > &TV) | |
Copy constructor of Taylor variable. | |
~TVar () | |
Destructor of Taylor variable. | |
TVar< T > & | set (TModel< T > *TM, const unsigned int ix, const T &X, const double Xref) |
Set Taylor variable with index ix (starting from 0), bounded by X and with reference point Xref , in Taylor model environment TM | |
TVar< T > & | set (TModel< T > *TM, const unsigned int ix, const T &X) |
Set Taylor variable with index ix (starting from 0), bounded by X and with reference point at mid(X), in Taylor model environment TM | |
TVar< T > & | set (TModel< T > *TM) |
Set polynomial model environment in variable as env | |
double | polynomial (const double *x) const |
Evaluate polynomial part at x | |
double | P (const double *x) const |
Shortcut to mc::TVar::polynomial. | |
TVar< T > | polynomial () const |
Return new Taylor variable with same multivariate polynomial part but zero remainder. | |
TVar< T > | P () const |
Shortcut to mc::TVar::polynomial. | |
TVar< T > & | center () |
Center remainder term of Taylor variable. | |
TVar< T > & | C () |
Shortcut to mc::TVar::center. | |
double | constant (const bool reset=false) |
Get coefficient of constant term in Taylor 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 Taylor variable. | |
double | linear (const unsigned int ivar, const bool reset=false) |
Get coefficients of linear term for variable ivar in Taylor 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 | |
T | bound () const |
Retreive bound on variable using default bounder. | |
T | bndpol () const |
Retreive bound on multivariate polynomial using default bounder. | |
T | bndord (const unsigned int iord) const |
Retreive bound on all terms with (total) order iord in polynomial model. | |
T | 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. | |
T | 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. | |
mc::TVar is a C++ class for propagation of Taylor models through factorable functions. The template parameter corresponds to the type used in computing the remainder bound.