Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Friends | List of all members
TaylorVariable< T > Class Template Reference

C++ template class for definition of and operation on variables in a Taylor model. More...

#include <taylor_model.hpp>

Public Member Functions

T B () const
 Return range bounder. More...
 
T bound () const
 Return range bounder. More...
 
const TboundT () const
 Return reference to range bounder in T arithmetic. More...
 
TaylorVariable< T > & C ()
 Recenter remainder term. More...
 
TaylorVariable< T > & center ()
 Return reference to current remainder. More...
 
double constant () const
 Return coefficient value in constant term. More...
 
TaylorModel< T > * env () const
 Return pointer to TaylorModel environment. More...
 
BooleanType isCompact () const
 
double * linear () const
 Return pointer to array of size nvar comprising coefficients in linear term. More...
 
TaylorVariable< T > & operator*= (const TaylorVariable< T > &)
 
TaylorVariable< T > & operator*= (const double)
 
TaylorVariable< T > & operator*= (const T &)
 
template<typename U >
TaylorVariable< T > & operator+= (const TaylorVariable< U > &)
 
template<typename U >
TaylorVariable< T > & operator+= (const U &)
 
TaylorVariable< T > & operator+= (const double)
 
template<typename U >
TaylorVariable< T > & operator-= (const TaylorVariable< U > &)
 
template<typename U >
TaylorVariable< T > & operator-= (const U &)
 
TaylorVariable< T > & operator-= (const double)
 
TaylorVariable< T > & operator/= (const TaylorVariable< T > &)
 
TaylorVariable< T > & operator/= (const double)
 
TaylorVariable< T > & operator= (const double)
 More overloaded operators. More...
 
TaylorVariable< T > & operator= (const TaylorVariable< T > &)
 
TaylorVariable< T > & operator= (const T &)
 
TaylorVariable< TP () const
 Cancel remainder error term and return polynomial part. More...
 
double P (const double *x) const
 Evaluate polynomial part at point x More...
 
TaylorVariable< Tpolynomial () const
 Cancel remainder term and return polynomial part. More...
 
double polynomial (const double *x) const
 Evaluate polynomial part at point x More...
 
double * quadratic (const int opt=0) const
 Return pointer to array of size nvar comprising coefficients in quadratic term (diagonal coefs if opt=0; upper triangular part otherwise) More...
 
T R () const
 Return const reference to current remainder. More...
 
double * reference () const
 Return pointer to array of size nvar comprising reference point. More...
 
T remainder () const
 Return const reference to current remainder. More...
 
TaylorVariable< T > & set (TaylorModel< T > *TM, const unsigned int ix, const T &X)
 Set the index and range for the variable ivar, that belongs to the interval X. More...
 
 TaylorVariable (const double d=0.)
 Constructor for a real scalar. More...
 
 TaylorVariable (const T &B)
 Constructor for a T variable. More...
 
 TaylorVariable (TaylorModel< T > *TM, const unsigned int ix, const T &X)
 Constructor for the variable ix, that belongs to the interval X More...
 
 TaylorVariable (const TaylorVariable< T > &TV)
 Copy constructor for identical range bounder. More...
 
template<typename U >
 TaylorVariable (TaylorModel< T > *&TM, const TaylorVariable< U > &TV)
 Copy constructor for different range bounder with implicit type conversion. More...
 
template<typename U >
 TaylorVariable (TaylorModel< T > *&TM, const TaylorVariable< U > &TV, const T &(U::*method)() const )
 Copy constructor for different range bounder with explicit type conversion class member function. More...
 
template<typename U >
 TaylorVariable (TaylorModel< T > *&TM, const TaylorVariable< U > &TV, T(*method)(const U &))
 Copy constructor for different range bounder with explicit type conversion non-class function. More...
 
 TaylorVariable (TaylorModel< T > *TM, const double d=0.)
 Private constructor for a real scalar in a specific TaylorModel. More...
 
 ~TaylorVariable ()
 Class destructor. More...
 

Private Member Functions

const T_bndmon (const unsigned int i) const
 Get bounds on all monomial terms in TaylorModel. More...
 
T_bound (T &bndmod) const
 Range bounder. More...
 
T_bound_eigen (T &bndmod) const
 Range bounder - eignevalue decomposition-based approach. More...
 
T_bound_LSB (T &bndmod) const
 Range bounder - Lin & Stadtherr approach. More...
 
T_bound_naive (T &bndmod) const
 Range bounder - naive approach. More...
 
void _center_TM ()
 Center remainder error term _bndrem. More...
 
void _clean ()
 Clean private members. More...
 
unsigned int _expmon (const unsigned int i) const
 Get monomial term exponents in TaylorModel. More...
 
void _init ()
 Initialize private members. More...
 
TaylorVariable< T_intpow (const TaylorVariable< T > &TM, const int n)
 Recursive calculation of nonnegative integer powers. More...
 
unsigned int _nmon () const
 Get number of monomial terms in TaylorModel. More...
 
unsigned int _nord () const
 Get model order in TaylorModel. More...
 
unsigned int _nvar () const
 Get number of variables in TaylorModel. More...
 
unsigned int _posord (const unsigned int i) const
 Get term positions in TaylorModel. More...
 
unsigned int _prodmon (const unsigned int i, const unsigned int j) const
 Get exponents of monomial term products in TaylorModel. More...
 
double _refpoint (const unsigned int i) const
 Get reference point in TaylorModel. More...
 
void _reinit ()
 Reinitialize private members. More...
 
double _scaling (const unsigned int i) const
 Get scaling in TaylorModel. More...
 
TaylorVariable< T > * _TV () const
 Get pointer to internal TaylorVariable in TaylorModel. More...
 
void _update_bndord ()
 Update _bndord w/ (naive) bounds for individual terms of degrees 0,...,_nord() More...
 
 TaylorVariable (TaylorModel< T > *TM, const T &B)
 Private constructor for a range in a specific TaylorModel. More...
 

Static Private Member Functions

static double * _eigen (const unsigned int n, double *a)
 Wrapper to LAPACK function _dsyev doing eigenvalue decomposition of a symmetric matrix. More...
 

Private Attributes

T_bndord
 Bounds for individual terms of degrees 0,...,_nord+1. More...
 
T_bndrem
 Pointer to the remainder error bound. More...
 
T _bndT
 Interval bound evaluated in T arithmetic. More...
 
double * _coefmon
 Coefficients for monomial terms 1,...,nmon. More...
 
TaylorModel< T > * _TM
 Pointer to underlying TaylorModel object. More...
 

Friends

template<typename U >
TaylorVariable< Uacos (const TaylorVariable< U > &)
 
template<typename U >
TaylorVariable< Uasin (const TaylorVariable< U > &)
 
template<typename U >
TaylorVariable< Uatan (const TaylorVariable< U > &)
 
template<typename U >
TaylorVariable< Ucos (const TaylorVariable< U > &)
 
template<typename U >
TaylorVariable< Uexp (const TaylorVariable< U > &)
 
template<typename U >
TaylorVariable< Uhull (const TaylorVariable< U > &, const TaylorVariable< U > &)
 
template<typename U >
bool inter (TaylorVariable< U > &, const TaylorVariable< U > &, const TaylorVariable< U > &)
 
template<typename U >
TaylorVariable< Uinv (const TaylorVariable< U > &)
 
template<typename U >
TaylorVariable< Ulog (const TaylorVariable< U > &)
 
template<typename U >
TaylorVariable< Uoperator* (const TaylorVariable< U > &, const TaylorVariable< U > &)
 
template<typename U >
TaylorVariable< Uoperator* (const double, const TaylorVariable< U > &)
 
template<typename U >
TaylorVariable< Uoperator* (const TaylorVariable< U > &, const double)
 
template<typename U >
TaylorVariable< Uoperator* (const U &, const TaylorVariable< U > &)
 
template<typename U >
TaylorVariable< Uoperator* (const TaylorVariable< U > &, const U &)
 
template<typename U >
TaylorVariable< Uoperator+ (const TaylorVariable< U > &)
 
template<typename U , typename V >
TaylorVariable< Uoperator+ (const TaylorVariable< U > &, const TaylorVariable< V > &)
 
template<typename U , typename V >
TaylorVariable< Uoperator+ (const TaylorVariable< U > &, const V &)
 
template<typename U , typename V >
TaylorVariable< Uoperator+ (const V &, const TaylorVariable< U > &)
 
template<typename U >
TaylorVariable< Uoperator+ (const double, const TaylorVariable< U > &)
 
template<typename U >
TaylorVariable< Uoperator+ (const TaylorVariable< U > &, const double)
 
template<typename U >
TaylorVariable< Uoperator- (const TaylorVariable< U > &)
 
template<typename U , typename V >
TaylorVariable< Uoperator- (const TaylorVariable< U > &, const TaylorVariable< V > &)
 
template<typename U , typename V >
TaylorVariable< Uoperator- (const TaylorVariable< U > &, const V &)
 
template<typename U , typename V >
TaylorVariable< Uoperator- (const V &, const TaylorVariable< U > &)
 
template<typename U >
TaylorVariable< Uoperator- (const double, const TaylorVariable< U > &)
 
template<typename U >
TaylorVariable< Uoperator- (const TaylorVariable< U > &, const double)
 
template<typename U >
TaylorVariable< Uoperator/ (const TaylorVariable< U > &, const TaylorVariable< U > &)
 
template<typename U >
TaylorVariable< Uoperator/ (const double, const TaylorVariable< U > &)
 
template<typename U >
TaylorVariable< Uoperator/ (const TaylorVariable< U > &, const double)
 
template<typename U >
std::ostream & operator<< (std::ostream &, const TaylorVariable< U > &)
 
template<typename U >
TaylorVariable< Upow (const TaylorVariable< U > &, const int)
 
template<typename U >
TaylorVariable< Upow (const TaylorVariable< U > &, const double)
 
template<typename U >
TaylorVariable< Upow (const double, const TaylorVariable< U > &)
 
template<typename U >
TaylorVariable< Upow (const TaylorVariable< U > &, const TaylorVariable< U > &)
 
template<typename U >
TaylorVariable< Usin (const TaylorVariable< U > &)
 
template<typename U >
TaylorVariable< Usqr (const TaylorVariable< U > &)
 
template<typename U >
TaylorVariable< Usqrt (const TaylorVariable< U > &)
 
template<typename U >
TaylorVariable< Utan (const TaylorVariable< U > &)
 
template<typename U >
void TaylorModel (const unsigned int nvar, const unsigned int nord)
 
template<typename U >
class TaylorVariable
 
template<typename U >
TaylorVariable< Uxlog (const TaylorVariable< U > &)
 

Detailed Description

template<typename T>
class TaylorVariable< T >

C++ template class for definition of and operation on variables in a Taylor model.

mc::TaylorVariable<T> is a C++ template class for definition of and operation on the variables participating in a Taylor model of a factorable function. The template parameter T corresponds to the type used in computing the remainder error bound in the Taylor model.

Definition at line 42 of file taylor_model.hpp.

Constructor & Destructor Documentation

template<typename T>
TaylorVariable< T >::TaylorVariable ( TaylorModel< T > *  TM,
const double  d = 0. 
)

Private constructor for a real scalar in a specific TaylorModel.

template<typename T>
TaylorVariable< T >::TaylorVariable ( TaylorModel< T > *  TM,
const T B 
)
private

Private constructor for a range in a specific TaylorModel.

Member Function Documentation

template<typename T>
const T& TaylorVariable< T >::_bndmon ( const unsigned int  i) const
inlineprivate

Get bounds on all monomial terms in TaylorModel.

Definition at line 168 of file taylor_variable.hpp.

template<typename T>
T& TaylorVariable< T >::_bound ( T bndmod) const
private

Range bounder.

template<typename T>
T& TaylorVariable< T >::_bound_eigen ( T bndmod) const
private

Range bounder - eignevalue decomposition-based approach.

template<typename T>
T& TaylorVariable< T >::_bound_LSB ( T bndmod) const
private

Range bounder - Lin & Stadtherr approach.

template<typename T>
T& TaylorVariable< T >::_bound_naive ( T bndmod) const
private

Range bounder - naive approach.

template<typename T>
void TaylorVariable< T >::_center_TM ( )
private

Center remainder error term _bndrem.

template<typename T>
void TaylorVariable< T >::_clean ( )
private

Clean private members.

template<typename T>
static double* TaylorVariable< T >::_eigen ( const unsigned int  n,
double *  a 
)
staticprivate

Wrapper to LAPACK function _dsyev doing eigenvalue decomposition of a symmetric matrix.

template<typename T>
unsigned int TaylorVariable< T >::_expmon ( const unsigned int  i) const
inlineprivate

Get monomial term exponents in TaylorModel.

Definition at line 160 of file taylor_variable.hpp.

template<typename T>
void TaylorVariable< T >::_init ( )
private

Initialize private members.

template<typename T>
TaylorVariable<T> TaylorVariable< T >::_intpow ( const TaylorVariable< T > &  TM,
const int  n 
)
private

Recursive calculation of nonnegative integer powers.

template<typename T>
unsigned int TaylorVariable< T >::_nmon ( ) const
inlineprivate

Get number of monomial terms in TaylorModel.

Definition at line 152 of file taylor_variable.hpp.

template<typename T>
unsigned int TaylorVariable< T >::_nord ( ) const
inlineprivate

Get model order in TaylorModel.

Definition at line 146 of file taylor_variable.hpp.

template<typename T>
unsigned int TaylorVariable< T >::_nvar ( ) const
inlineprivate

Get number of variables in TaylorModel.

Definition at line 149 of file taylor_variable.hpp.

template<typename T>
unsigned int TaylorVariable< T >::_posord ( const unsigned int  i) const
inlineprivate

Get term positions in TaylorModel.

Definition at line 156 of file taylor_variable.hpp.

template<typename T>
unsigned int TaylorVariable< T >::_prodmon ( const unsigned int  i,
const unsigned int  j 
) const
inlineprivate

Get exponents of monomial term products in TaylorModel.

Definition at line 164 of file taylor_variable.hpp.

template<typename T>
double TaylorVariable< T >::_refpoint ( const unsigned int  i) const
inlineprivate

Get reference point in TaylorModel.

Definition at line 172 of file taylor_variable.hpp.

template<typename T>
void TaylorVariable< T >::_reinit ( )
private

Reinitialize private members.

template<typename T>
double TaylorVariable< T >::_scaling ( const unsigned int  i) const
inlineprivate

Get scaling in TaylorModel.

Definition at line 176 of file taylor_variable.hpp.

template<typename T>
TaylorVariable<T>* TaylorVariable< T >::_TV ( ) const
inlineprivate

Get pointer to internal TaylorVariable in TaylorModel.

Definition at line 143 of file taylor_variable.hpp.

template<typename T>
void TaylorVariable< T >::_update_bndord ( )
private

Update _bndord w/ (naive) bounds for individual terms of degrees 0,...,_nord()

template<typename T>
BooleanType TaylorVariable< T >::isCompact ( ) const

Routine which returns BT_FALSE if there are components equal to "nan" or "INFTY".
Otherwise, BT_TRUE is returned.

template<typename T>
TaylorVariable<T>& TaylorVariable< T >::operator*= ( const TaylorVariable< T > &  )
template<typename T>
TaylorVariable<T>& TaylorVariable< T >::operator*= ( const double  )
template<typename T>
TaylorVariable<T>& TaylorVariable< T >::operator*= ( const T )
template<typename T>
template<typename U >
TaylorVariable<T>& TaylorVariable< T >::operator+= ( const TaylorVariable< U > &  )
template<typename T>
template<typename U >
TaylorVariable<T>& TaylorVariable< T >::operator+= ( const U )
template<typename T>
TaylorVariable<T>& TaylorVariable< T >::operator+= ( const double  )
template<typename T>
template<typename U >
TaylorVariable<T>& TaylorVariable< T >::operator-= ( const TaylorVariable< U > &  )
template<typename T>
template<typename U >
TaylorVariable<T>& TaylorVariable< T >::operator-= ( const U )
template<typename T>
TaylorVariable<T>& TaylorVariable< T >::operator-= ( const double  )
template<typename T>
TaylorVariable<T>& TaylorVariable< T >::operator/= ( const TaylorVariable< T > &  )
template<typename T>
TaylorVariable<T>& TaylorVariable< T >::operator/= ( const double  )
template<typename T>
TaylorVariable<T>& TaylorVariable< T >::operator= ( const double  )

More overloaded operators.

template<typename T>
TaylorVariable<T>& TaylorVariable< T >::operator= ( const TaylorVariable< T > &  )
template<typename T>
TaylorVariable<T>& TaylorVariable< T >::operator= ( const T )

Friends And Related Function Documentation

template<typename T>
template<typename U >
TaylorVariable<U> acos ( const TaylorVariable< U > &  )
friend
template<typename T>
template<typename U >
TaylorVariable<U> asin ( const TaylorVariable< U > &  )
friend
template<typename T>
template<typename U >
TaylorVariable<U> atan ( const TaylorVariable< U > &  )
friend
template<typename T>
template<typename U >
TaylorVariable<U> cos ( const TaylorVariable< U > &  )
friend
template<typename T>
template<typename U >
TaylorVariable<U> exp ( const TaylorVariable< U > &  )
friend
template<typename T>
template<typename U >
TaylorVariable<U> hull ( const TaylorVariable< U > &  ,
const TaylorVariable< U > &   
)
friend
template<typename T>
template<typename U >
bool inter ( TaylorVariable< U > &  ,
const TaylorVariable< U > &  ,
const TaylorVariable< U > &   
)
friend
template<typename T>
template<typename U >
TaylorVariable<U> inv ( const TaylorVariable< U > &  )
friend
template<typename T>
template<typename U >
TaylorVariable<U> log ( const TaylorVariable< U > &  )
friend
template<typename T>
template<typename U >
TaylorVariable<U> operator* ( const TaylorVariable< U > &  ,
const TaylorVariable< U > &   
)
friend
template<typename T>
template<typename U >
TaylorVariable<U> operator* ( const double  ,
const TaylorVariable< U > &   
)
friend
template<typename T>
template<typename U >
TaylorVariable<U> operator* ( const TaylorVariable< U > &  ,
const double   
)
friend
template<typename T>
template<typename U >
TaylorVariable<U> operator* ( const U ,
const TaylorVariable< U > &   
)
friend
template<typename T>
template<typename U >
TaylorVariable<U> operator* ( const TaylorVariable< U > &  ,
const U  
)
friend
template<typename T>
template<typename U >
TaylorVariable<U> operator+ ( const TaylorVariable< U > &  )
friend
template<typename T>
template<typename U , typename V >
TaylorVariable<U> operator+ ( const TaylorVariable< U > &  ,
const TaylorVariable< V > &   
)
friend
template<typename T>
template<typename U , typename V >
TaylorVariable<U> operator+ ( const TaylorVariable< U > &  ,
const V  
)
friend
template<typename T>
template<typename U , typename V >
TaylorVariable<U> operator+ ( const V ,
const TaylorVariable< U > &   
)
friend
template<typename T>
template<typename U >
TaylorVariable<U> operator+ ( const double  ,
const TaylorVariable< U > &   
)
friend
template<typename T>
template<typename U >
TaylorVariable<U> operator+ ( const TaylorVariable< U > &  ,
const double   
)
friend
template<typename T>
template<typename U >
TaylorVariable<U> operator- ( const TaylorVariable< U > &  )
friend
template<typename T>
template<typename U , typename V >
TaylorVariable<U> operator- ( const TaylorVariable< U > &  ,
const TaylorVariable< V > &   
)
friend
template<typename T>
template<typename U , typename V >
TaylorVariable<U> operator- ( const TaylorVariable< U > &  ,
const V  
)
friend
template<typename T>
template<typename U , typename V >
TaylorVariable<U> operator- ( const V ,
const TaylorVariable< U > &   
)
friend
template<typename T>
template<typename U >
TaylorVariable<U> operator- ( const double  ,
const TaylorVariable< U > &   
)
friend
template<typename T>
template<typename U >
TaylorVariable<U> operator- ( const TaylorVariable< U > &  ,
const double   
)
friend
template<typename T>
template<typename U >
TaylorVariable<U> operator/ ( const TaylorVariable< U > &  ,
const TaylorVariable< U > &   
)
friend
template<typename T>
template<typename U >
TaylorVariable<U> operator/ ( const double  ,
const TaylorVariable< U > &   
)
friend
template<typename T>
template<typename U >
TaylorVariable<U> operator/ ( const TaylorVariable< U > &  ,
const double   
)
friend
template<typename T>
template<typename U >
std::ostream& operator<< ( std::ostream &  ,
const TaylorVariable< U > &   
)
friend
template<typename T>
template<typename U >
TaylorVariable<U> pow ( const TaylorVariable< U > &  ,
const int   
)
friend
template<typename T>
template<typename U >
TaylorVariable<U> pow ( const TaylorVariable< U > &  ,
const double   
)
friend
template<typename T>
template<typename U >
TaylorVariable<U> pow ( const double  ,
const TaylorVariable< U > &   
)
friend
template<typename T>
template<typename U >
TaylorVariable<U> pow ( const TaylorVariable< U > &  ,
const TaylorVariable< U > &   
)
friend
template<typename T>
template<typename U >
TaylorVariable<U> sin ( const TaylorVariable< U > &  )
friend
template<typename T>
template<typename U >
TaylorVariable<U> sqr ( const TaylorVariable< U > &  )
friend
template<typename T>
template<typename U >
TaylorVariable<U> sqrt ( const TaylorVariable< U > &  )
friend
template<typename T>
template<typename U >
TaylorVariable<U> tan ( const TaylorVariable< U > &  )
friend
template<typename T>
template<typename U >
void TaylorModel ( const unsigned int  nvar,
const unsigned int  nord 
)
friend
template<typename T>
template<typename U >
friend class TaylorVariable
friend

Definition at line 57 of file taylor_variable.hpp.

template<typename T>
template<typename U >
TaylorVariable<U> xlog ( const TaylorVariable< U > &  )
friend

Member Data Documentation

template<typename T>
T* TaylorVariable< T >::_bndord
private

Bounds for individual terms of degrees 0,...,_nord+1.

Definition at line 333 of file taylor_variable.hpp.

template<typename T>
T* TaylorVariable< T >::_bndrem
private

Pointer to the remainder error bound.

Definition at line 335 of file taylor_variable.hpp.

template<typename T>
T TaylorVariable< T >::_bndT
private

Interval bound evaluated in T arithmetic.

Definition at line 337 of file taylor_variable.hpp.

template<typename T>
double* TaylorVariable< T >::_coefmon
private

Coefficients for monomial terms 1,...,nmon.

Definition at line 331 of file taylor_variable.hpp.

template<typename T>
TaylorModel<T>* TaylorVariable< T >::_TM
private

Pointer to underlying TaylorModel object.

Definition at line 141 of file taylor_variable.hpp.


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


acado
Author(s): Milan Vukov, Rien Quirynen
autogenerated on Mon Jun 10 2019 12:35:27