|
Sacado Package Browser (Single Doxygen Collection) Version of the Day
|
Forward-mode AD class templated on the storage for the derivative array. More...
#include <Sacado_CacheFad_GeneralFad.hpp>

Public Types | |
| typedef T | value_type |
| Typename of values. | |
| typedef ScalarType< T >::type | scalar_type |
| Typename of scalar's (which may be different from T) | |
Protected Attributes | |
| bool | update_val_ |
| Update value. | |
Initialization methods | |
| GeneralFad () | |
| Default constructor. | |
| GeneralFad (const T &x) | |
Constructor with supplied value x. | |
| GeneralFad (const int sz, const T &x) | |
Constructor with size sz and value x. | |
| GeneralFad (const int sz, const int i, const T &x) | |
Constructor with size sz, index i, and value x. | |
| GeneralFad (const GeneralFad &x) | |
| Copy constructor. | |
| template<typename S > | |
| GeneralFad (const Expr< S > &x) | |
| Copy constructor from any Expression object. | |
| ~GeneralFad () | |
| Destructor. | |
| void | diff (const int ith, const int n) |
Set GeneralFad object as the ith independent variable. | |
| 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. | |
| void | cache () const |
| Cache values. | |
| template<typename S > | |
| bool | isEqualTo (const Expr< S > &x) const |
| Returns whether two Fad objects have the same values. | |
Derivative accessor methods | |
| 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. | |
Assignment operators | |
| GeneralFad & | operator= (const T &val) |
| Assignment operator with constant right-hand-side. | |
| GeneralFad & | operator= (const GeneralFad &x) |
| Assignment with Expr right-hand-side. | |
| template<typename S > | |
| GeneralFad & | operator= (const Expr< S > &x) |
| Assignment operator with any expression right-hand-side. | |
Unary operators | |
| GeneralFad & | operator+= (const T &x) |
| Addition-assignment operator with constant right-hand-side. | |
| GeneralFad & | operator-= (const T &x) |
| Subtraction-assignment operator with constant right-hand-side. | |
| GeneralFad & | operator*= (const T &x) |
| Multiplication-assignment operator with constant right-hand-side. | |
| GeneralFad & | operator/= (const T &x) |
| Division-assignment operator with constant right-hand-side. | |
| GeneralFad & | operator+= (const typename dummy< value_type, scalar_type >::type &x) |
| Addition-assignment operator with constant right-hand-side. | |
| GeneralFad & | operator-= (const typename dummy< value_type, scalar_type >::type &x) |
| Subtraction-assignment operator with constant right-hand-side. | |
| GeneralFad & | operator*= (const typename dummy< value_type, scalar_type >::type &x) |
| Multiplication-assignment operator with constant right-hand-side. | |
| GeneralFad & | operator/= (const typename dummy< value_type, scalar_type >::type &x) |
| Division-assignment operator with constant right-hand-side. | |
| template<typename S > | |
| GeneralFad & | operator+= (const Expr< S > &x) |
| Addition-assignment operator with Expr right-hand-side. | |
| template<typename S > | |
| GeneralFad & | operator-= (const Expr< S > &x) |
| Subtraction-assignment operator with Expr right-hand-side. | |
| template<typename S > | |
| GeneralFad & | operator*= (const Expr< S > &x) |
| Multiplication-assignment operator with Expr right-hand-side. | |
| template<typename S > | |
| GeneralFad & | operator/= (const Expr< S > &x) |
| Division-assignment operator with Expr right-hand-side. | |
Forward-mode AD class templated on the storage for the derivative array.
This class provides a general forward mode AD implementation for any type of derivative array storage. It does not incorporate expression templates.
This version of GeneralFad is virtually identical to Sacado::Fad::GeneralFad, with small differences in the implementations of some of the methods to support caching of "values" of intermediate operations in an expression, recognizing that the "this" object might also be on the right-hand-side of an expression.
Definition at line 78 of file Sacado_CacheFad_GeneralFad.hpp.
| typedef T Sacado::CacheFad::GeneralFad< T, Storage >::value_type |
Typename of values.
Reimplemented in Sacado::CacheFad::Expr< GeneralFad< T, Storage > >.
Definition at line 83 of file Sacado_CacheFad_GeneralFad.hpp.
| typedef ScalarType<T>::type Sacado::CacheFad::GeneralFad< T, Storage >::scalar_type |
Typename of scalar's (which may be different from T)
Reimplemented in Sacado::CacheFad::Expr< GeneralFad< T, Storage > >.
Definition at line 86 of file Sacado_CacheFad_GeneralFad.hpp.
| Sacado::CacheFad::GeneralFad< T, Storage >::GeneralFad | ( | ) | [inline] |
Default constructor.
Definition at line 94 of file Sacado_CacheFad_GeneralFad.hpp.
| Sacado::CacheFad::GeneralFad< T, Storage >::GeneralFad | ( | const T & | x | ) | [inline] |
Constructor with supplied value x.
Initializes value to x and derivative array is empty
Definition at line 100 of file Sacado_CacheFad_GeneralFad.hpp.
| Sacado::CacheFad::GeneralFad< T, Storage >::GeneralFad | ( | 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
Definition at line 106 of file Sacado_CacheFad_GeneralFad.hpp.
| Sacado::CacheFad::GeneralFad< T, Storage >::GeneralFad | ( | 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.
Definition at line 115 of file Sacado_CacheFad_GeneralFad.hpp.
| Sacado::CacheFad::GeneralFad< T, Storage >::GeneralFad | ( | const GeneralFad< T, Storage > & | x | ) | [inline] |
Copy constructor.
Definition at line 121 of file Sacado_CacheFad_GeneralFad.hpp.
| Sacado::CacheFad::GeneralFad< T, Storage >::GeneralFad | ( | const Expr< S > & | x | ) | [inline] |
Copy constructor from any Expression object.
Definition at line 58 of file Sacado_CacheFad_GeneralFadImp.hpp.
| Sacado::CacheFad::GeneralFad< T, Storage >::~GeneralFad | ( | ) | [inline] |
Destructor.
Definition at line 128 of file Sacado_CacheFad_GeneralFad.hpp.
| void Sacado::CacheFad::GeneralFad< T, Storage >::diff | ( | const int | ith, |
| const int | n | ||
| ) | [inline] |
Set GeneralFad 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.
Definition at line 85 of file Sacado_CacheFad_GeneralFadImp.hpp.
| void Sacado::CacheFad::GeneralFad< T, Storage >::setUpdateValue | ( | bool | update_val | ) | [inline] |
Set whether this Fad object should update values.
Definition at line 140 of file Sacado_CacheFad_GeneralFad.hpp.
| bool Sacado::CacheFad::GeneralFad< T, Storage >::updateValue | ( | ) | const [inline] |
Return whether this Fad object has an updated value.
Definition at line 143 of file Sacado_CacheFad_GeneralFad.hpp.
| void Sacado::CacheFad::GeneralFad< T, Storage >::cache | ( | ) | const [inline] |
Cache values.
Definition at line 146 of file Sacado_CacheFad_GeneralFad.hpp.
| bool Sacado::CacheFad::GeneralFad< T, Storage >::isEqualTo | ( | const Expr< S > & | x | ) | const [inline] |
Returns whether two Fad objects have the same values.
Definition at line 150 of file Sacado_CacheFad_GeneralFad.hpp.
| int Sacado::CacheFad::GeneralFad< T, Storage >::availableSize | ( | ) | const [inline] |
Returns number of derivative components that can be stored without reallocation.
Definition at line 170 of file Sacado_CacheFad_GeneralFad.hpp.
| bool Sacado::CacheFad::GeneralFad< T, Storage >::hasFastAccess | ( | ) | const [inline] |
Returns true if derivative array is not empty.
Definition at line 173 of file Sacado_CacheFad_GeneralFad.hpp.
| bool Sacado::CacheFad::GeneralFad< T, Storage >::isPassive | ( | ) | const [inline] |
Returns true if derivative array is empty.
Definition at line 176 of file Sacado_CacheFad_GeneralFad.hpp.
| void Sacado::CacheFad::GeneralFad< T, Storage >::setIsConstant | ( | bool | is_const | ) | [inline] |
Set whether variable is constant.
Definition at line 179 of file Sacado_CacheFad_GeneralFad.hpp.
| Sacado::CacheFad::GeneralFad< T, Storage > & Sacado::CacheFad::GeneralFad< T, Storage >::operator= | ( | const T & | val | ) | [inline] |
Assignment operator with constant right-hand-side.
Definition at line 97 of file Sacado_CacheFad_GeneralFadImp.hpp.
| Sacado::CacheFad::GeneralFad< T, Storage > & Sacado::CacheFad::GeneralFad< T, Storage >::operator= | ( | const GeneralFad< T, Storage > & | x | ) | [inline] |
Assignment with Expr right-hand-side.
Definition at line 111 of file Sacado_CacheFad_GeneralFadImp.hpp.
| Sacado::CacheFad::GeneralFad< T, Storage > & Sacado::CacheFad::GeneralFad< T, Storage >::operator= | ( | const Expr< S > & | x | ) | [inline] |
Assignment operator with any expression right-hand-side.
Definition at line 124 of file Sacado_CacheFad_GeneralFadImp.hpp.
| Sacado::CacheFad::GeneralFad< T, Storage > & Sacado::CacheFad::GeneralFad< T, Storage >::operator+= | ( | const T & | x | ) | [inline] |
Addition-assignment operator with constant right-hand-side.
Definition at line 151 of file Sacado_CacheFad_GeneralFadImp.hpp.
| Sacado::CacheFad::GeneralFad< T, Storage > & Sacado::CacheFad::GeneralFad< T, Storage >::operator-= | ( | const T & | x | ) | [inline] |
Subtraction-assignment operator with constant right-hand-side.
Definition at line 161 of file Sacado_CacheFad_GeneralFadImp.hpp.
| Sacado::CacheFad::GeneralFad< T, Storage > & Sacado::CacheFad::GeneralFad< T, Storage >::operator*= | ( | const T & | x | ) | [inline] |
Multiplication-assignment operator with constant right-hand-side.
Definition at line 171 of file Sacado_CacheFad_GeneralFadImp.hpp.
| Sacado::CacheFad::GeneralFad< T, Storage > & Sacado::CacheFad::GeneralFad< T, Storage >::operator/= | ( | const T & | x | ) | [inline] |
Division-assignment operator with constant right-hand-side.
Definition at line 185 of file Sacado_CacheFad_GeneralFadImp.hpp.
| Sacado::CacheFad::GeneralFad< T, Storage > & Sacado::CacheFad::GeneralFad< T, Storage >::operator+= | ( | const typename dummy< value_type, scalar_type >::type & | x | ) | [inline] |
Addition-assignment operator with constant right-hand-side.
Creates a dummy overload when value_type and scalar_type are the same type.
Definition at line 200 of file Sacado_CacheFad_GeneralFadImp.hpp.
| Sacado::CacheFad::GeneralFad< T, Storage > & Sacado::CacheFad::GeneralFad< T, Storage >::operator-= | ( | const typename dummy< value_type, scalar_type >::type & | x | ) | [inline] |
Subtraction-assignment operator with constant right-hand-side.
Creates a dummy overload when value_type and scalar_type are the same type.
Definition at line 211 of file Sacado_CacheFad_GeneralFadImp.hpp.
| Sacado::CacheFad::GeneralFad< T, Storage > & Sacado::CacheFad::GeneralFad< T, Storage >::operator*= | ( | const typename dummy< value_type, scalar_type >::type & | x | ) | [inline] |
Multiplication-assignment operator with constant right-hand-side.
Creates a dummy overload when value_type and scalar_type are the same type.
Definition at line 222 of file Sacado_CacheFad_GeneralFadImp.hpp.
| Sacado::CacheFad::GeneralFad< T, Storage > & Sacado::CacheFad::GeneralFad< T, Storage >::operator/= | ( | const typename dummy< value_type, scalar_type >::type & | x | ) | [inline] |
Division-assignment operator with constant right-hand-side.
Creates a dummy overload when value_type and scalar_type are the same type.
Definition at line 237 of file Sacado_CacheFad_GeneralFadImp.hpp.
| Sacado::CacheFad::GeneralFad< T, Storage > & Sacado::CacheFad::GeneralFad< T, Storage >::operator+= | ( | const Expr< S > & | x | ) | [inline] |
Addition-assignment operator with Expr right-hand-side.
Definition at line 252 of file Sacado_CacheFad_GeneralFadImp.hpp.
| Sacado::CacheFad::GeneralFad< T, Storage > & Sacado::CacheFad::GeneralFad< T, Storage >::operator-= | ( | const Expr< S > & | x | ) | [inline] |
Subtraction-assignment operator with Expr right-hand-side.
Definition at line 293 of file Sacado_CacheFad_GeneralFadImp.hpp.
| Sacado::CacheFad::GeneralFad< T, Storage > & Sacado::CacheFad::GeneralFad< T, Storage >::operator*= | ( | const Expr< S > & | x | ) | [inline] |
Multiplication-assignment operator with Expr right-hand-side.
Definition at line 335 of file Sacado_CacheFad_GeneralFadImp.hpp.
| Sacado::CacheFad::GeneralFad< T, Storage > & Sacado::CacheFad::GeneralFad< T, Storage >::operator/= | ( | const Expr< S > & | x | ) | [inline] |
Division-assignment operator with Expr right-hand-side.
Definition at line 383 of file Sacado_CacheFad_GeneralFadImp.hpp.
bool Sacado::CacheFad::GeneralFad< T, Storage >::update_val_ [protected] |
Update value.
Definition at line 270 of file Sacado_CacheFad_GeneralFad.hpp.
1.7.4