|
Sacado
Development
|
Expression template forward-mode AD class with static memory allocation. More...
#include <Sacado_Fad_SFad.hpp>

Public Types | |
| typedef RemoveConst< T >::type | value_type |
| Typename of values. | |
Public Member Functions | |
Initialization methods | |
| Expr () | |
| Default constructor. | |
| Expr (const T &x) | |
Constructor with supplied value x. | |
| Expr (const int sz, const T &x) | |
Constructor with size sz and value x. | |
| Expr (const int sz, const int i, const T &x) | |
Constructor with size sz, index i, and value x. | |
| Expr (const Expr &x) | |
| Copy constructor. | |
| template<typename S > | |
| Expr (const Expr< S > &x) | |
| Copy constructor from any Expression object. | |
| ~Expr () | |
| Destructor. | |
| void | diff (const int ith, const int n) |
Set Fad object as the ith independent variable. | |
| void | resize (int sz) |
Resize derivative array to length sz. | |
| void | expand (int sz) |
| Expand derivative array to size sz. | |
| void | zero () |
| Zero out the derivative array. | |
| void | setUpdateValue (bool update_val) |
| Set whether this Fad object should update values. | |
| bool | updateValue () const |
| Return whether this Fad object has an updated value. | |
| template<typename S > | |
| bool | isEqualTo (const Expr< S > &x) const |
| Returns whether two Fad objects have the same values. | |
Value accessor methods | |
| const T & | val () const |
| Returns value. | |
| T & | val () |
| Returns value. | |
Derivative accessor methods | |
| int | size () const |
| Returns number of derivative components. | |
| int | availableSize () const |
| Returns number of derivative components that can be stored without reallocation. | |
| bool | hasFastAccess () const |
| Returns true if derivative array is not empty. | |
| bool | isPassive () const |
| Returns true if derivative array is empty. | |
| void | setIsConstant (bool is_const) |
| Set whether variable is constant. | |
| const T * | dx () const |
| Returns derivative array. | |
| const T & | dx (int i) const |
Returns derivative component i with bounds checking. | |
| T & | fastAccessDx (int i) |
Returns derivative component i without bounds checking. | |
| const T & | fastAccessDx (int i) const |
Returns derivative component i without bounds checking. | |
Assignment operators | |
| Expr< SFadExprTag< T, Num > > & | operator= (const T &val) |
| Assignment operator with constant right-hand-side. | |
| Expr< SFadExprTag< T, Num > > & | operator= (const Expr< SFadExprTag< T, Num > > &x) |
| Assignment with Expr right-hand-side. | |
| template<typename S > | |
| Expr< SFadExprTag< T, Num > > & | operator= (const Expr< S > &x) |
| Assignment operator with any expression right-hand-side. | |
Unary operators | |
| Expr< SFadExprTag< T, Num > > & | operator+= (const T &x) |
| Addition-assignment operator with constant right-hand-side. | |
| Expr< SFadExprTag< T, Num > > & | operator-= (const T &x) |
| Subtraction-assignment operator with constant right-hand-side. | |
| Expr< SFadExprTag< T, Num > > & | operator*= (const T &x) |
| Multiplication-assignment operator with constant right-hand-side. | |
| Expr< SFadExprTag< T, Num > > & | operator/= (const T &x) |
| Division-assignment operator with constant right-hand-side. | |
| template<typename S > | |
| Expr< SFadExprTag< T, Num > > & | operator+= (const Expr< S > &x) |
| Addition-assignment operator with Expr right-hand-side. | |
| template<typename S > | |
| Expr< SFadExprTag< T, Num > > & | operator-= (const Expr< S > &x) |
| Subtraction-assignment operator with Expr right-hand-side. | |
| template<typename S > | |
| Expr< SFadExprTag< T, Num > > & | operator*= (const Expr< S > &x) |
| Multiplication-assignment operator with Expr right-hand-side. | |
| template<typename S > | |
| Expr< SFadExprTag< T, Num > > & | operator/= (const Expr< S > &x) |
| Division-assignment operator with Expr right-hand-side. | |
Protected Attributes | |
| T | val_ |
| Value. | |
| T | dx_ [Num] |
| Derivatives. | |
| bool | update_val_ |
| Update value. | |
Expression template forward-mode AD class with static memory allocation.
| Sacado::Fad::Expr< SFadExprTag< T, Num > >::Expr | ( | const T & | x | ) | [inline] |
Constructor with supplied value x.
Initializes value to x and derivative array is empty
| Sacado::Fad::Expr< SFadExprTag< T, Num > >::Expr | ( | const int | sz, |
| const T & | x | ||
| ) | [inline] |
Constructor with size sz and value x.
Initializes value to x and derivative array 0 of length sz
| Sacado::Fad::Expr< SFadExprTag< T, Num > >::Expr | ( | const int | sz, |
| const int | i, | ||
| const T & | x | ||
| ) | [inline] |
Constructor with size sz, index i, and value x.
Initializes value to x and derivative array of length sz as row i of the identity matrix, i.e., sets derivative component i to 1 and all other's to zero.
| void Sacado::Fad::Expr< SFadExprTag< T, Num > >::diff | ( | const int | ith, |
| const int | n | ||
| ) | [inline] |
Set Fad object as the ith independent variable.
Sets the derivative array of length n to the ith row of the identity matrix and has the same affect as the Implementation(const int sz, const int i, const T & x) constructor.
| void Sacado::Fad::Expr< SFadExprTag< T, Num > >::expand | ( | int | sz | ) | [inline] |
Expand derivative array to size sz.
Since the derivative array length is not dynamic, this method throws an error if compiled with SACADO_DEBUG defined.
| void Sacado::Fad::Expr< SFadExprTag< T, Num > >::resize | ( | int | sz | ) | [inline] |
Resize derivative array to length sz.
Since the derivative array length is not dynamic, this method throws an error if compiled with SACADO_DEBUG defined.
1.7.6.1