Sacado Package Browser (Single Doxygen Collection)
Version of the Day
|
Forward-mode AD class using dynamic memory allocation but no expression templates. More...
#include <Sacado_Fad_SimpleFad.hpp>
Classes | |
struct | apply |
Turn SimpleFad into a meta-function class usable with mpl::apply. More... | |
Public Types | |
typedef DynamicStorage< ValueT > | StorageType |
Base classes. More... | |
typedef GeneralFad< ValueT, StorageType > | GeneralFadType |
typedef GeneralFadType::value_type | value_type |
Typename of values. More... | |
typedef GeneralFadType::scalar_type | scalar_type |
Typename of scalar's (which may be different from value_type) More... | |
typedef ScalarType< ValueT >::type | ScalarT |
Typename of scalar's (which may be different from ValueT) More... | |
Public Types inherited from Sacado::Fad::GeneralFad< ValueT, DynamicStorage< ValueT > > | |
typedef RemoveConst< ValueT >::type | value_type |
Typename of values. More... | |
typedef ScalarType< value_type > ::type | scalar_type |
Typename of scalar's (which may be different from T) More... | |
Public Types inherited from Sacado::Fad::DynamicStorage< ValueT > | |
typedef ValueT | value_type |
Public Member Functions | |
~SimpleFad () | |
Destructor. More... | |
bool | isEqualTo (const SimpleFad &x) const |
Returns whether two Fad objects have the same values. More... | |
Public Member Functions inherited from Sacado::Fad::GeneralFad< ValueT, DynamicStorage< ValueT > > | |
KOKKOS_INLINE_FUNCTION | GeneralFad () |
Default constructor. More... | |
KOKKOS_INLINE_FUNCTION | GeneralFad (const S &x, SACADO_ENABLE_VALUE_CTOR_DECL) |
Constructor with supplied value x . More... | |
KOKKOS_INLINE_FUNCTION | GeneralFad (const int sz, const ValueT &x, const DerivInit zero_out=InitDerivArray) |
Constructor with size sz and value x . More... | |
KOKKOS_INLINE_FUNCTION | GeneralFad (const int sz, const int i, const ValueT &x) |
Constructor with size sz , index i , and value x . More... | |
KOKKOS_INLINE_FUNCTION | GeneralFad (const DynamicStorage< ValueT > &s) |
Constructor with supplied storage s . More... | |
KOKKOS_INLINE_FUNCTION | GeneralFad (const GeneralFad &x) |
Copy constructor. More... | |
KOKKOS_INLINE_FUNCTION | GeneralFad (const Expr< S > &x, SACADO_ENABLE_EXPR_CTOR_DECL) |
Copy constructor from any Expression object. More... | |
KOKKOS_INLINE_FUNCTION | ~GeneralFad () |
Destructor. More... | |
KOKKOS_INLINE_FUNCTION void | diff (const int ith, const int n) |
Set GeneralFad object as the ith independent variable. More... | |
KOKKOS_INLINE_FUNCTION void | setUpdateValue (bool update_val) |
Set whether this Fad object should update values. More... | |
KOKKOS_INLINE_FUNCTION bool | updateValue () const |
Return whether this Fad object has an updated value. More... | |
KOKKOS_INLINE_FUNCTION void | cache () const |
Cache values. More... | |
KOKKOS_INLINE_FUNCTION | SACADO_ENABLE_EXPR_FUNC (bool) isEqualTo(const Expr< S > &x) const |
Returns whether two Fad objects have the same values. More... | |
KOKKOS_INLINE_FUNCTION int | availableSize () const |
Returns number of derivative components that can be stored without reallocation. More... | |
KOKKOS_INLINE_FUNCTION bool | hasFastAccess () const |
Returns true if derivative array is not empty. More... | |
KOKKOS_INLINE_FUNCTION bool | isPassive () const |
Returns true if derivative array is empty. More... | |
KOKKOS_INLINE_FUNCTION void | setIsConstant (bool is_const) |
Set whether variable is constant. More... | |
Public Member Functions inherited from Sacado::Fad::DynamicStorage< ValueT > | |
KOKKOS_INLINE_FUNCTION | DynamicStorage (const S &x, SACADO_ENABLE_VALUE_CTOR_DECL) |
Default constructor. More... | |
KOKKOS_INLINE_FUNCTION | DynamicStorage (const int sz, const ValueT &x, const DerivInit zero_out=InitDerivArray) |
Constructor with size sz . More... | |
KOKKOS_INLINE_FUNCTION | DynamicStorage (const DynamicStorage &x) |
Copy constructor. More... | |
KOKKOS_INLINE_FUNCTION | ~DynamicStorage () |
Destructor. More... | |
KOKKOS_INLINE_FUNCTION DynamicStorage & | operator= (const DynamicStorage &x) |
Assignment. More... | |
KOKKOS_INLINE_FUNCTION int | size () const |
Returns number of derivative components. More... | |
KOKKOS_INLINE_FUNCTION int | length () const |
Returns array length. More... | |
KOKKOS_INLINE_FUNCTION void | resize (int sz) |
Resize the derivative array to sz. More... | |
KOKKOS_INLINE_FUNCTION void | resizeAndZero (int sz) |
Resize the derivative array to sz. More... | |
KOKKOS_INLINE_FUNCTION void | expand (int sz) |
Expand derivative array to size sz. More... | |
KOKKOS_INLINE_FUNCTION void | zero () |
Zero out derivative array. More... | |
KOKKOS_INLINE_FUNCTION const ValueT & | val () const |
Returns value. More... | |
KOKKOS_INLINE_FUNCTION ValueT & | val () |
Returns value. More... | |
KOKKOS_INLINE_FUNCTION const ValueT * | dx () const |
Returns derivative array. More... | |
KOKKOS_INLINE_FUNCTION ValueT | dx (int i) const |
Returns derivative component i with bounds checking. More... | |
KOKKOS_INLINE_FUNCTION ValueT & | fastAccessDx (int i) |
Returns derivative component i without bounds checking. More... | |
KOKKOS_INLINE_FUNCTION const ValueT & | fastAccessDx (int i) const |
Returns derivative component i without bounds checking. More... | |
Initialization methods | |
SimpleFad () | |
Default constructor. More... | |
template<typename S > | |
SimpleFad (const S &x, SACADO_ENABLE_VALUE_CTOR_DECL) | |
Constructor with supplied value x convertible to ValueT. More... | |
SimpleFad (const int sz, const ValueT &x, const DerivInit zero_out=InitDerivArray) | |
Constructor with size sz and value x . More... | |
SimpleFad (const int sz, const int i, const ValueT &x) | |
Constructor with size sz , index i , and value x . More... | |
SimpleFad (const SimpleFad &x) | |
Copy constructor. More... | |
SimpleFad (const SimpleFad &x, const ValueT &v, const ValueT &partial) | |
Tangent copy constructor. More... | |
Additional Inherited Members | |
Protected Attributes inherited from Sacado::Fad::DynamicStorage< ValueT > | |
ValueT | val_ |
Value. More... | |
int | sz_ |
Derivative array size. More... | |
int | len_ |
Derivative array length. More... | |
ValueT * | dx_ |
Derivative array. More... | |
Forward-mode AD class using dynamic memory allocation but no expression templates.
This is the user-level class for forward mode AD with dynamic memory allocation, and is appropriate for whenever the number of derivative components is not known at compile time. The user interface is provided by Sacado::Fad::GeneralFad.
Definition at line 52 of file Sacado_Fad_SimpleFad.hpp.
typedef DynamicStorage<ValueT> Sacado::Fad::SimpleFad< ValueT >::StorageType |
Base classes.
Definition at line 57 of file Sacado_Fad_SimpleFad.hpp.
typedef GeneralFad<ValueT,StorageType> Sacado::Fad::SimpleFad< ValueT >::GeneralFadType |
Definition at line 58 of file Sacado_Fad_SimpleFad.hpp.
typedef GeneralFadType::value_type Sacado::Fad::SimpleFad< ValueT >::value_type |
Typename of values.
Definition at line 61 of file Sacado_Fad_SimpleFad.hpp.
typedef GeneralFadType::scalar_type Sacado::Fad::SimpleFad< ValueT >::scalar_type |
Typename of scalar's (which may be different from value_type)
Definition at line 64 of file Sacado_Fad_SimpleFad.hpp.
typedef ScalarType<ValueT>::type Sacado::Fad::SimpleFad< ValueT >::ScalarT |
Typename of scalar's (which may be different from ValueT)
Definition at line 67 of file Sacado_Fad_SimpleFad.hpp.
|
inline |
Default constructor.
Initializes value to 0 and derivative array is empty
Definition at line 84 of file Sacado_Fad_SimpleFad.hpp.
|
inline |
Constructor with supplied value x
convertible to ValueT.
Initializes value to ValueT(x)
and derivative array is empty.
Definition at line 92 of file Sacado_Fad_SimpleFad.hpp.
|
inline |
Constructor with size sz
and value x
.
Initializes value to x
and derivative array 0 of length sz
Definition at line 99 of file Sacado_Fad_SimpleFad.hpp.
|
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 108 of file Sacado_Fad_SimpleFad.hpp.
|
inline |
Copy constructor.
Definition at line 112 of file Sacado_Fad_SimpleFad.hpp.
|
inline |
Tangent copy constructor.
Definition at line 116 of file Sacado_Fad_SimpleFad.hpp.
|
inline |
Destructor.
Definition at line 125 of file Sacado_Fad_SimpleFad.hpp.
|
inline |
Returns whether two Fad objects have the same values.
Definition at line 128 of file Sacado_Fad_SimpleFad.hpp.