Sacado Development
Loading...
Searching...
No Matches
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 >:

Public Types

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

Public Member Functions

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

Taylor coefficient accessor methods

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

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.

Constructor & Destructor Documentation

◆ CacheTaylorImplementation() [1/4]

◆ CacheTaylorImplementation() [2/4]

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

Constructor with supplied value x.

Sets the first coefficient to x

References coeff_.

◆ CacheTaylorImplementation() [3/4]

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

References coeff_.

◆ CacheTaylorImplementation() [4/4]

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

Copy constructor.

References CacheTaylorImplementation(), and coeff_.

Member Function Documentation

◆ coeff() [1/3]

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

Returns Taylor coefficient array.

References coeff_.

◆ coeff() [2/3]

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

Returns degree i term with bounds checking.

References coeff_.

◆ coeff() [3/3]

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

Returns degree i term with bounds checking.

References coeff_.

◆ degree()

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

Returns degree of polynomial.

Referenced by isEqualTo().

◆ fastAccessCoeff() [1/2]

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

Returns degree i term without bounds checking.

References coeff_.

◆ fastAccessCoeff() [2/2]

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

Returns degree i term without bounds checking.

References coeff_.

◆ isEqualTo()

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.

References Sacado::Tay::Expr< ExprT >::coeff(), degree(), and Sacado::Tay::Expr< ExprT >::degree().

◆ resize()

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.

References coeff_, and resizeCoeffs().

Referenced by Sacado::Tay::CacheTaylor< T >::operator=().

◆ resizeCoeffs()

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

Resize coefficient array to new size.

References coeff_.

Referenced by resize().

◆ val() [1/2]

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

Returns value.

References coeff_.

◆ val() [2/2]

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

Returns value.

References coeff_.

Referenced by Sacado::Tay::CacheTaylor< U >::operator=().

Member Data Documentation

◆ coeff_


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