Sacado Package Browser (Single Doxygen Collection) Version of the Day
|
Taylor polynomial class. More...
#include <Sacado_Tay_Taylor.hpp>
Classes | |
struct | apply |
Turn Taylor into a meta-function class usable with mpl::apply. More... | |
struct | TaylorData |
Public Types | |
typedef T | value_type |
Typename of values. | |
typedef ScalarType< value_type >::type | scalar_type |
Typename of scalar's (which may be different from value_type) | |
![]() | |
typedef T | derived_type |
Public Member Functions | |
Taylor () | |
Default constructor. | |
Taylor (const T &x) | |
Constructor with supplied value x . | |
Taylor (const typename dummy< value_type, scalar_type >::type &x) | |
Constructor with supplied value x . | |
Taylor (int d, const T &x) | |
Constructor with degree d and value x . | |
Taylor (int d) | |
Constructor with degree d. | |
Taylor (const Taylor &x) | |
Copy constructor. | |
~Taylor () | |
Destructor. | |
void | resize (int d, bool keep_coeffs) |
Resize polynomial to degree d. | |
void | reserve (int d) |
Reserve space for a degree d polynomial. | |
void | copyForWrite () |
Prepare polynomial for writing. | |
bool | isEqualTo (const Taylor &x) const |
Returns whether two Taylor objects have the same values. | |
![]() | |
const derived_type & | derived () const |
Unary operators | |
Sacado::Handle< TaylorData > | th |
Taylor< T > | operator+ () const |
Unary-plus operator. | |
Taylor< T > | operator- () const |
Unary-minus operator. | |
Taylor< T > & | operator+= (const T &x) |
Addition-assignment operator with constant right-hand-side. | |
Taylor< T > & | operator-= (const T &x) |
Subtraction-assignment operator with constant right-hand-side. | |
Taylor< T > & | operator*= (const T &x) |
Multiplication-assignment operator with constant right-hand-side. | |
Taylor< T > & | operator/= (const T &x) |
Division-assignment operator with constant right-hand-side. | |
Taylor< T > & | operator+= (const Taylor< T > &x) |
Addition-assignment operator with Taylor right-hand-side. | |
Taylor< T > & | operator-= (const Taylor< T > &x) |
Subtraction-assignment operator with Taylor right-hand-side. | |
Taylor< T > & | operator*= (const Taylor< T > &x) |
Multiplication-assignment operator with Taylor right-hand-side. | |
Taylor< T > & | operator/= (const Taylor< T > &x) |
Division-assignment operator with Taylor right-hand-side. | |
int | length () const |
Return length of array. | |
void | resizeCoeffs (int len) |
Resize coefficient array to new size. | |
Assignment operators | |
Taylor< T > & | operator= (const T &val) |
Assignment operator with constant right-hand-side. | |
Taylor< T > & | operator= (const typename dummy< value_type, scalar_type >::type &val) |
Assignment operator with constant right-hand-side. | |
Taylor< T > & | operator= (const Taylor< T > &x) |
Assignment with Taylor right-hand-side. | |
Value accessor methods | |
const T & | val () const |
Returns value. | |
T & | val () |
Returns value. | |
Taylor coefficient accessor methods | |
int | degree () const |
Returns degree of polynomial. | |
bool | hasFastAccess (int d) const |
Returns true if polynomial has degree >= d. | |
const T * | coeff () const |
Returns Taylor coefficient array. | |
T * | coeff () |
Returns Taylor coefficient array. | |
T | coeff (int i) const |
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. | |
Taylor polynomial class.
Uses a handle and a "copy-on-write" strategy for efficient copying, but no expression templating.
Definition at line 52 of file Sacado_Tay_Taylor.hpp.
typedef T Sacado::Tay::Taylor< T >::value_type |
Typename of values.
Definition at line 62 of file Sacado_Tay_Taylor.hpp.
typedef ScalarType<value_type>::type Sacado::Tay::Taylor< T >::scalar_type |
Typename of scalar's (which may be different from value_type)
Definition at line 65 of file Sacado_Tay_Taylor.hpp.
Sacado::Tay::Taylor< T >::Taylor | ( | ) |
Default constructor.
Definition at line 119 of file Sacado_Tay_TaylorImp.hpp.
Sacado::Tay::Taylor< T >::Taylor | ( | const T & | x | ) |
Constructor with supplied value x
.
Sets the first coefficient to x
Definition at line 126 of file Sacado_Tay_TaylorImp.hpp.
Sacado::Tay::Taylor< T >::Taylor | ( | const typename dummy< value_type, scalar_type >::type & | x | ) |
Constructor with supplied value x
.
Sets the first coefficient to x. Creates a dummy overload when ValueT and ScalarT are the same type.
Definition at line 133 of file Sacado_Tay_TaylorImp.hpp.
Sacado::Tay::Taylor< T >::Taylor | ( | int | d, |
const T & | x ) |
Constructor with degree d and value x
.
Initializes first coeffienct to x
and of a polynomial of degree d
Definition at line 140 of file Sacado_Tay_TaylorImp.hpp.
|
explicit |
Constructor with degree d.
Initializes all components to zero
Definition at line 147 of file Sacado_Tay_TaylorImp.hpp.
Sacado::Tay::Taylor< T >::Taylor | ( | const Taylor< T > & | x | ) |
Copy constructor.
Definition at line 154 of file Sacado_Tay_TaylorImp.hpp.
Sacado::Tay::Taylor< T >::~Taylor | ( | ) |
Destructor.
Definition at line 161 of file Sacado_Tay_TaylorImp.hpp.
void Sacado::Tay::Taylor< T >::resize | ( | int | d, |
bool | keep_coeffs ) |
Resize polynomial to degree d.
Coefficients are preserved if keep_coeffs
is true
, otherwise all coefficients are reset to zero.
Definition at line 168 of file Sacado_Tay_TaylorImp.hpp.
void Sacado::Tay::Taylor< T >::reserve | ( | int | d | ) |
Reserve space for a degree d polynomial.
Coefficients are preserved.
Definition at line 187 of file Sacado_Tay_TaylorImp.hpp.
|
inline |
Prepare polynomial for writing.
This method prepares the polynomial for writing through coeff() and fastAccessCoeff() member functions. It ensures the handle for the Taylor coefficients is not shared among any other Taylor polynomial objects. If the handle is not shared it does nothing, so there is no cost in calling this method in this case. If the handle is shared and this method is not called, any changes to the coefficients by coeff() or fastAccessCoeff() may change other polynomial objects.
Definition at line 124 of file Sacado_Tay_Taylor.hpp.
|
inline |
Returns whether two Taylor objects have the same values.
Definition at line 127 of file Sacado_Tay_Taylor.hpp.
Assignment operator with constant right-hand-side.
Definition at line 199 of file Sacado_Tay_TaylorImp.hpp.
Taylor< T > & Sacado::Tay::Taylor< T >::operator= | ( | const typename dummy< value_type, scalar_type >::type & | val | ) |
Assignment operator with constant right-hand-side.
Creates a dummy overload when value_type and scalar_type are the same type.
Definition at line 218 of file Sacado_Tay_TaylorImp.hpp.
Assignment with Taylor right-hand-side.
Definition at line 226 of file Sacado_Tay_TaylorImp.hpp.
|
inline |
Returns value.
Definition at line 162 of file Sacado_Tay_Taylor.hpp.
|
inline |
Returns value.
Definition at line 165 of file Sacado_Tay_Taylor.hpp.
|
inline |
Returns degree of polynomial.
Definition at line 175 of file Sacado_Tay_Taylor.hpp.
|
inline |
Returns true if polynomial has degree >= d.
Definition at line 178 of file Sacado_Tay_Taylor.hpp.
|
inline |
Returns Taylor coefficient array.
Definition at line 181 of file Sacado_Tay_Taylor.hpp.
|
inline |
Returns Taylor coefficient array.
Definition at line 184 of file Sacado_Tay_Taylor.hpp.
|
inline |
Returns degree i
term with bounds checking.
Definition at line 187 of file Sacado_Tay_Taylor.hpp.
|
inline |
Returns degree i
term without bounds checking.
Definition at line 191 of file Sacado_Tay_Taylor.hpp.
|
inline |
Returns degree i
term without bounds checking.
Definition at line 194 of file Sacado_Tay_Taylor.hpp.
Taylor< T > Sacado::Tay::Taylor< T >::operator+ | ( | ) | const |
Unary-plus operator.
Definition at line 235 of file Sacado_Tay_TaylorImp.hpp.
Taylor< T > Sacado::Tay::Taylor< T >::operator- | ( | ) | const |
Unary-minus operator.
Definition at line 243 of file Sacado_Tay_TaylorImp.hpp.
Addition-assignment operator with constant right-hand-side.
Definition at line 258 of file Sacado_Tay_TaylorImp.hpp.
Subtraction-assignment operator with constant right-hand-side.
Definition at line 270 of file Sacado_Tay_TaylorImp.hpp.
Multiplication-assignment operator with constant right-hand-side.
Definition at line 282 of file Sacado_Tay_TaylorImp.hpp.
Division-assignment operator with constant right-hand-side.
Definition at line 295 of file Sacado_Tay_TaylorImp.hpp.
Addition-assignment operator with Taylor right-hand-side.
Definition at line 308 of file Sacado_Tay_TaylorImp.hpp.
Subtraction-assignment operator with Taylor right-hand-side.
Definition at line 348 of file Sacado_Tay_TaylorImp.hpp.
Multiplication-assignment operator with Taylor right-hand-side.
Definition at line 388 of file Sacado_Tay_TaylorImp.hpp.
Division-assignment operator with Taylor right-hand-side.
Definition at line 439 of file Sacado_Tay_TaylorImp.hpp.
|
inlineprotected |
Return length of array.
Definition at line 238 of file Sacado_Tay_Taylor.hpp.
|
protected |
Resize coefficient array to new size.
Definition at line 489 of file Sacado_Tay_TaylorImp.hpp.
|
protected |
Definition at line 282 of file Sacado_Tay_Taylor.hpp.