|
Sacado Package Browser (Single Doxygen Collection) Version of the Day
|
Expression template forward-mode AD class with static memory allocation. More...
#include <Sacado_ELRCacheFad_SFad.hpp>
Classes | |
| struct | LocalAccumOp |
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) | |
| typedef Expr< SFadExprTag< T, Num > > | base_expr_type |
| Typename of base-expressions. | |
Static Public Attributes | |
| static const int | num_args = 1 |
| Number of arguments. | |
| static const bool | is_linear = true |
| Is expression linear. | |
Protected Attributes | |
| T | val_ |
| Value. | |
| T | dx_ [Num] |
| Derivatives. | |
| bool | update_val_ |
| Update value. | |
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. | |
| void | cache () const |
| Cache values. | |
| 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. | |
| void | computePartials (const T &bar, T partials[]) const |
| Return partials w.r.t. arguments. | |
| void | getTangents (int i, T dots[]) const |
Return tangent component i of arguments. | |
| template<int Arg> | |
| bool | isActive () const |
| Return whether argument is active. | |
| template<int Arg> | |
| T | getTangent (int i) const |
Return tangent component i of argument Arg. | |
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. | |
Expression template forward-mode AD class with static memory allocation.
This classes specializes Expr to SFad expressions.
Definition at line 78 of file Sacado_ELRCacheFad_SFad.hpp.
| typedef T Sacado::ELRCacheFad::Expr< SFadExprTag< T, Num > >::value_type |
Typename of values.
Definition at line 83 of file Sacado_ELRCacheFad_SFad.hpp.
| typedef ScalarType<T>::type Sacado::ELRCacheFad::Expr< SFadExprTag< T, Num > >::scalar_type |
Typename of scalar's (which may be different from T)
Definition at line 86 of file Sacado_ELRCacheFad_SFad.hpp.
| typedef Expr< SFadExprTag<T,Num> > Sacado::ELRCacheFad::Expr< SFadExprTag< T, Num > >::base_expr_type |
Typename of base-expressions.
Definition at line 89 of file Sacado_ELRCacheFad_SFad.hpp.
| Sacado::ELRCacheFad::Expr< SFadExprTag< T, Num > >::Expr | ( | ) | [inline] |
Default constructor.
Definition at line 103 of file Sacado_ELRCacheFad_SFad.hpp.
| Sacado::ELRCacheFad::Expr< SFadExprTag< T, Num > >::Expr | ( | const T & | x | ) | [inline] |
Constructor with supplied value x.
Initializes value to x and derivative array is empty
Definition at line 109 of file Sacado_ELRCacheFad_SFad.hpp.
| Sacado::ELRCacheFad::Expr< SFadExprTag< T, Num > >::Expr | ( | const int | sz, |
| const T & | x | ||
| ) |
Constructor with size sz and value x.
Initializes value to x and derivative array 0 of length sz
| Sacado::ELRCacheFad::Expr< SFadExprTag< T, Num > >::Expr | ( | const int | sz, |
| const int | i, | ||
| const T & | x | ||
| ) |
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.
| Sacado::ELRCacheFad::Expr< SFadExprTag< T, Num > >::Expr | ( | const Expr< SFadExprTag< T, Num > > & | x | ) | [inline] |
Copy constructor.
Definition at line 127 of file Sacado_ELRCacheFad_SFad.hpp.
| Sacado::ELRCacheFad::Expr< SFadExprTag< T, Num > >::Expr | ( | const Expr< S > & | x | ) |
Copy constructor from any Expression object.
| Sacado::ELRCacheFad::Expr< SFadExprTag< T, Num > >::~Expr | ( | ) | [inline] |
Destructor.
Definition at line 137 of file Sacado_ELRCacheFad_SFad.hpp.
| void Sacado::ELRCacheFad::Expr< SFadExprTag< T, Num > >::diff | ( | const int | ith, |
| const int | n | ||
| ) |
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::ELRCacheFad::Expr< SFadExprTag< T, Num > >::resize | ( | int | sz | ) |
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.
| void Sacado::ELRCacheFad::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.
Definition at line 160 of file Sacado_ELRCacheFad_SFad.hpp.
| void Sacado::ELRCacheFad::Expr< SFadExprTag< T, Num > >::zero | ( | ) | [inline] |
Zero out the derivative array.
Definition at line 163 of file Sacado_ELRCacheFad_SFad.hpp.
| void Sacado::ELRCacheFad::Expr< SFadExprTag< T, Num > >::setUpdateValue | ( | bool | update_val | ) | [inline] |
Set whether this Fad object should update values.
Definition at line 166 of file Sacado_ELRCacheFad_SFad.hpp.
| bool Sacado::ELRCacheFad::Expr< SFadExprTag< T, Num > >::updateValue | ( | ) | const [inline] |
Return whether this Fad object has an updated value.
Definition at line 169 of file Sacado_ELRCacheFad_SFad.hpp.
| void Sacado::ELRCacheFad::Expr< SFadExprTag< T, Num > >::cache | ( | ) | const [inline] |
Cache values.
Definition at line 172 of file Sacado_ELRCacheFad_SFad.hpp.
| bool Sacado::ELRCacheFad::Expr< SFadExprTag< T, Num > >::isEqualTo | ( | const Expr< S > & | x | ) | const [inline] |
Returns whether two Fad objects have the same values.
Definition at line 176 of file Sacado_ELRCacheFad_SFad.hpp.
| const T& Sacado::ELRCacheFad::Expr< SFadExprTag< T, Num > >::val | ( | ) | const [inline] |
Returns value.
Definition at line 193 of file Sacado_ELRCacheFad_SFad.hpp.
| T& Sacado::ELRCacheFad::Expr< SFadExprTag< T, Num > >::val | ( | ) | [inline] |
Returns value.
Definition at line 196 of file Sacado_ELRCacheFad_SFad.hpp.
| int Sacado::ELRCacheFad::Expr< SFadExprTag< T, Num > >::size | ( | ) | const [inline] |
Returns number of derivative components.
Definition at line 206 of file Sacado_ELRCacheFad_SFad.hpp.
| int Sacado::ELRCacheFad::Expr< SFadExprTag< T, Num > >::availableSize | ( | ) | const [inline] |
Returns number of derivative components that can be stored without reallocation.
Definition at line 212 of file Sacado_ELRCacheFad_SFad.hpp.
| bool Sacado::ELRCacheFad::Expr< SFadExprTag< T, Num > >::hasFastAccess | ( | ) | const [inline] |
Returns true if derivative array is not empty.
Definition at line 215 of file Sacado_ELRCacheFad_SFad.hpp.
| bool Sacado::ELRCacheFad::Expr< SFadExprTag< T, Num > >::isPassive | ( | ) | const [inline] |
Returns true if derivative array is empty.
Definition at line 218 of file Sacado_ELRCacheFad_SFad.hpp.
| void Sacado::ELRCacheFad::Expr< SFadExprTag< T, Num > >::setIsConstant | ( | bool | is_const | ) | [inline] |
Set whether variable is constant.
Definition at line 221 of file Sacado_ELRCacheFad_SFad.hpp.
| const T* Sacado::ELRCacheFad::Expr< SFadExprTag< T, Num > >::dx | ( | ) | const [inline] |
Returns derivative array.
Definition at line 224 of file Sacado_ELRCacheFad_SFad.hpp.
| const T& Sacado::ELRCacheFad::Expr< SFadExprTag< T, Num > >::dx | ( | int | i | ) | const [inline] |
Returns derivative component i with bounds checking.
Definition at line 227 of file Sacado_ELRCacheFad_SFad.hpp.
| T& Sacado::ELRCacheFad::Expr< SFadExprTag< T, Num > >::fastAccessDx | ( | int | i | ) | [inline] |
Returns derivative component i without bounds checking.
Definition at line 230 of file Sacado_ELRCacheFad_SFad.hpp.
| const T& Sacado::ELRCacheFad::Expr< SFadExprTag< T, Num > >::fastAccessDx | ( | int | i | ) | const [inline] |
Returns derivative component i without bounds checking.
Definition at line 233 of file Sacado_ELRCacheFad_SFad.hpp.
| void Sacado::ELRCacheFad::Expr< SFadExprTag< T, Num > >::computePartials | ( | const T & | bar, |
| T | partials[] | ||
| ) | const [inline] |
Return partials w.r.t. arguments.
Definition at line 236 of file Sacado_ELRCacheFad_SFad.hpp.
| void Sacado::ELRCacheFad::Expr< SFadExprTag< T, Num > >::getTangents | ( | int | i, |
| T | dots[] | ||
| ) | const [inline] |
Return tangent component i of arguments.
Definition at line 241 of file Sacado_ELRCacheFad_SFad.hpp.
| bool Sacado::ELRCacheFad::Expr< SFadExprTag< T, Num > >::isActive | ( | ) | const [inline] |
Return whether argument is active.
Definition at line 247 of file Sacado_ELRCacheFad_SFad.hpp.
| T Sacado::ELRCacheFad::Expr< SFadExprTag< T, Num > >::getTangent | ( | int | i | ) | const [inline] |
Return tangent component i of argument Arg.
Definition at line 251 of file Sacado_ELRCacheFad_SFad.hpp.
| Expr< SFadExprTag<T,Num> >& Sacado::ELRCacheFad::Expr< SFadExprTag< T, Num > >::operator= | ( | const T & | val | ) |
Assignment operator with constant right-hand-side.
| Expr< SFadExprTag<T,Num> >& Sacado::ELRCacheFad::Expr< SFadExprTag< T, Num > >::operator= | ( | const Expr< SFadExprTag< T, Num > > & | x | ) |
Assignment with Expr right-hand-side.
| Expr< SFadExprTag<T,Num> >& Sacado::ELRCacheFad::Expr< SFadExprTag< T, Num > >::operator= | ( | const Expr< S > & | x | ) |
Assignment operator with any expression right-hand-side.
| Expr< SFadExprTag<T,Num> >& Sacado::ELRCacheFad::Expr< SFadExprTag< T, Num > >::operator+= | ( | const T & | x | ) |
Addition-assignment operator with constant right-hand-side.
| Expr< SFadExprTag<T,Num> >& Sacado::ELRCacheFad::Expr< SFadExprTag< T, Num > >::operator-= | ( | const T & | x | ) |
Subtraction-assignment operator with constant right-hand-side.
| Expr< SFadExprTag<T,Num> >& Sacado::ELRCacheFad::Expr< SFadExprTag< T, Num > >::operator*= | ( | const T & | x | ) |
Multiplication-assignment operator with constant right-hand-side.
| Expr< SFadExprTag<T,Num> >& Sacado::ELRCacheFad::Expr< SFadExprTag< T, Num > >::operator/= | ( | const T & | x | ) |
Division-assignment operator with constant right-hand-side.
| Expr< SFadExprTag<T,Num> >& Sacado::ELRCacheFad::Expr< SFadExprTag< T, Num > >::operator+= | ( | const Expr< S > & | x | ) |
Addition-assignment operator with Expr right-hand-side.
| Expr< SFadExprTag<T,Num> >& Sacado::ELRCacheFad::Expr< SFadExprTag< T, Num > >::operator-= | ( | const Expr< S > & | x | ) |
Subtraction-assignment operator with Expr right-hand-side.
| Expr< SFadExprTag<T,Num> >& Sacado::ELRCacheFad::Expr< SFadExprTag< T, Num > >::operator*= | ( | const Expr< S > & | x | ) |
Multiplication-assignment operator with Expr right-hand-side.
| Expr< SFadExprTag<T,Num> >& Sacado::ELRCacheFad::Expr< SFadExprTag< T, Num > >::operator/= | ( | const Expr< S > & | x | ) |
Division-assignment operator with Expr right-hand-side.
const int Sacado::ELRCacheFad::Expr< SFadExprTag< T, Num > >::num_args = 1 [static] |
Number of arguments.
Definition at line 92 of file Sacado_ELRCacheFad_SFad.hpp.
const bool Sacado::ELRCacheFad::Expr< SFadExprTag< T, Num > >::is_linear = true [static] |
Is expression linear.
Definition at line 95 of file Sacado_ELRCacheFad_SFad.hpp.
T Sacado::ELRCacheFad::Expr< SFadExprTag< T, Num > >::val_ [protected] |
Definition at line 311 of file Sacado_ELRCacheFad_SFad.hpp.
T Sacado::ELRCacheFad::Expr< SFadExprTag< T, Num > >::dx_[Num] [protected] |
Derivatives.
Definition at line 314 of file Sacado_ELRCacheFad_SFad.hpp.
bool Sacado::ELRCacheFad::Expr< SFadExprTag< T, Num > >::update_val_ [protected] |
Update value.
Definition at line 317 of file Sacado_ELRCacheFad_SFad.hpp.
1.7.4