Sacado Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Sacado::Tay::CacheTaylorImplementation< T > Class Template Reference

Taylor polynomial class using caching expression templates. More...

#include <Sacado_Tay_CacheTaylor.hpp>

Inheritance diagram for Sacado::Tay::CacheTaylorImplementation< T >:
Inheritance graph
[legend]

Public Types

typedef T value_type
 Typename of values. More...
 
typedef ScalarType< T >::type scalar_type
 Typename of scalar's (which may be different from ValueT) More...
 

Public Member Functions

 CacheTaylorImplementation ()
 Default constructor. More...
 
 CacheTaylorImplementation (const T &x)
 Constructor with supplied value x. More...
 
 CacheTaylorImplementation (int d, const T &x)
 Constructor with degree d and value x. More...
 
 CacheTaylorImplementation (const CacheTaylorImplementation &x)
 Copy constructor. More...
 
 ~CacheTaylorImplementation ()
 Destructor. More...
 
void resize (int d, bool keep_coeffs)
 Resize polynomial to degree d. More...
 

Protected Member Functions

void resizeCoeffs (int dnew)
 Resize coefficient array to new size. More...
 
int coeff_size () const
 

Protected Attributes

std::valarray< Tcoeff_
 Taylor polynomial coefficients. More...
 

Value accessor methods

const Tval () const
 Returns value. More...
 
Tval ()
 Returns value. More...
 

Taylor coefficient accessor methods

int degree () const
 Returns degree of polynomial. More...
 
bool hasFastAccess (int d) const
 Returns true if polynomial has degree >= d. More...
 
const std::valarray< T > & coeff () const
 Returns Taylor coefficient array. More...
 
const T coeff (int i) const
 Returns degree i term with bounds checking. More...
 
T coeff (int i)
 Returns degree i term with bounds checking. More...
 
TfastAccessCoeff (int i)
 Returns degree i term without bounds checking. More...
 
const TfastAccessCoeff (int i) const
 Returns degree i term without bounds checking. More...
 
void allocateCache (int d) const
 Allocate coefficient cache. More...
 
template<typename S >
bool isEqualTo (const Expr< S > &x) const
 Returns whether two Taylor objects have the same values. More...
 

Detailed Description

template<typename T>
class Sacado::Tay::CacheTaylorImplementation< T >

Taylor polynomial class using caching expression templates.

This class provides the implementation of the Taylor object required for expression templating. Class CacheTaylor provides the complete user inteface.

Definition at line 39 of file Sacado_Tay_CacheTaylor.hpp.

Member Typedef Documentation

template<typename T >
typedef T Sacado::Tay::CacheTaylorImplementation< T >::value_type

Typename of values.

Definition at line 44 of file Sacado_Tay_CacheTaylor.hpp.

template<typename T >
typedef ScalarType<T>::type Sacado::Tay::CacheTaylorImplementation< T >::scalar_type

Typename of scalar's (which may be different from ValueT)

Definition at line 47 of file Sacado_Tay_CacheTaylor.hpp.

Constructor & Destructor Documentation

Default constructor.

Definition at line 50 of file Sacado_Tay_CacheTaylor.hpp.

template<typename T >
Sacado::Tay::CacheTaylorImplementation< T >::CacheTaylorImplementation ( const T x)
inline

Constructor with supplied value x.

Sets the first coefficient to x

Definition at line 56 of file Sacado_Tay_CacheTaylor.hpp.

template<typename T >
Sacado::Tay::CacheTaylorImplementation< T >::CacheTaylorImplementation ( int  d,
const T x 
)
inline

Constructor with degree d and value x.

Initializes first coeffienct to x and of a polynomial of degree d

Definition at line 62 of file Sacado_Tay_CacheTaylor.hpp.

Copy constructor.

Definition at line 68 of file Sacado_Tay_CacheTaylor.hpp.

Destructor.

Definition at line 72 of file Sacado_Tay_CacheTaylor.hpp.

Member Function Documentation

template<typename T >
void Sacado::Tay::CacheTaylorImplementation< T >::resize ( int  d,
bool  keep_coeffs 
)
inline

Resize polynomial to degree d.

Coefficients are preserved if keep_coeffs is true, otherwise all coefficients are reset to zero.

Definition at line 79 of file Sacado_Tay_CacheTaylor.hpp.

template<typename T >
const T& Sacado::Tay::CacheTaylorImplementation< T >::val ( ) const
inline

Returns value.

Definition at line 92 of file Sacado_Tay_CacheTaylor.hpp.

template<typename T >
T& Sacado::Tay::CacheTaylorImplementation< T >::val ( )
inline

Returns value.

Definition at line 95 of file Sacado_Tay_CacheTaylor.hpp.

template<typename T >
int Sacado::Tay::CacheTaylorImplementation< T >::degree ( ) const
inline

Returns degree of polynomial.

Definition at line 105 of file Sacado_Tay_CacheTaylor.hpp.

template<typename T >
bool Sacado::Tay::CacheTaylorImplementation< T >::hasFastAccess ( int  d) const
inline

Returns true if polynomial has degree >= d.

Definition at line 108 of file Sacado_Tay_CacheTaylor.hpp.

template<typename T >
const std::valarray<T>& Sacado::Tay::CacheTaylorImplementation< T >::coeff ( ) const
inline

Returns Taylor coefficient array.

Definition at line 111 of file Sacado_Tay_CacheTaylor.hpp.

template<typename T >
const T Sacado::Tay::CacheTaylorImplementation< T >::coeff ( int  i) const
inline

Returns degree i term with bounds checking.

Definition at line 114 of file Sacado_Tay_CacheTaylor.hpp.

template<typename T >
T Sacado::Tay::CacheTaylorImplementation< T >::coeff ( int  i)
inline

Returns degree i term with bounds checking.

Definition at line 118 of file Sacado_Tay_CacheTaylor.hpp.

template<typename T >
T& Sacado::Tay::CacheTaylorImplementation< T >::fastAccessCoeff ( int  i)
inline

Returns degree i term without bounds checking.

Definition at line 122 of file Sacado_Tay_CacheTaylor.hpp.

template<typename T >
const T& Sacado::Tay::CacheTaylorImplementation< T >::fastAccessCoeff ( int  i) const
inline

Returns degree i term without bounds checking.

Definition at line 125 of file Sacado_Tay_CacheTaylor.hpp.

template<typename T >
void Sacado::Tay::CacheTaylorImplementation< T >::allocateCache ( int  d) const
inline

Allocate coefficient cache.

Definition at line 128 of file Sacado_Tay_CacheTaylor.hpp.

template<typename T >
template<typename S >
bool Sacado::Tay::CacheTaylorImplementation< T >::isEqualTo ( const Expr< S > &  x) const
inline

Returns whether two Taylor objects have the same values.

Definition at line 132 of file Sacado_Tay_CacheTaylor.hpp.

template<typename T >
void Sacado::Tay::CacheTaylorImplementation< T >::resizeCoeffs ( int  dnew)
inlineprotected

Resize coefficient array to new size.

Definition at line 146 of file Sacado_Tay_CacheTaylor.hpp.

template<typename T >
int Sacado::Tay::CacheTaylorImplementation< T >::coeff_size ( ) const
inlineprotected

Definition at line 160 of file Sacado_Tay_CacheTaylor.hpp.

Member Data Documentation

template<typename T >
std::valarray<T> Sacado::Tay::CacheTaylorImplementation< T >::coeff_
protected

Taylor polynomial coefficients.

Definition at line 165 of file Sacado_Tay_CacheTaylor.hpp.


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