Sacado Package Browser (Single Doxygen Collection) Version of the Day
Loading...
Searching...
No Matches
Classes | Public Types | Static Public Attributes | List of all members
Sacado::Fad::Exp::GeneralFad< Storage > Class Template Reference

Forward-mode AD class templated on the storage for the derivative array. More...

#include <Sacado_Fad_Exp_GeneralFad.hpp>

Inheritance diagram for Sacado::Fad::Exp::GeneralFad< Storage >:
Inheritance graph
[legend]

Classes

struct  apply
 Turn GeneralFad into a meta-function class usable with mpl::apply. More...
 
struct  apply_N
 Replace static derivative length. More...
 

Public Types

typedef Storage StorageType
 Storage type.
 
typedef Expr< GeneralFad< Storage > > ExprType
 Expression type.
 
typedef Extender< Storage > ExtenderType
 Extender type.
 
typedef ScalarType< value_type >::type scalar_type
 Typename of scalar's (which may be different from T)
 
- Public Types inherited from Sacado::Fad::Exp::Expr< GeneralFad< Storage > >
typedef GeneralFad< Storage > derived_type
 Typename of derived object, returned by derived()
 
- Public Types inherited from Sacado::Fad::Exp::Extender< Storage >
typedef ExprSpecDefault expr_spec_type
 

Static Public Attributes

static constexpr bool is_view = Storage::is_view
 Whether we are a view.
 

Initialization methods

SACADO_DEFAULTED_FUNCTION GeneralFad ()=default
 Default constructor.
 
SACADO_DEFAULTED_FUNCTION GeneralFad (const GeneralFad &x)=default
 Copy constructor.
 
SACADO_DEFAULTED_FUNCTION GeneralFad (GeneralFad &&x)=default
 Move constructor.
 
template<typename S >
SACADO_INLINE_FUNCTION GeneralFad (const S &x, SACADO_EXP_ENABLE_VALUE_CTOR_DECL)
 Constructor with value (disabled for ViewFad)
 
template<typename S >
SACADO_INLINE_FUNCTION GeneralFad (const Expr< S > &x, SACADO_EXP_ENABLE_EXPR_CTOR_DECL)
 Copy constructor from any Expression object (disabled for ViewFad)
 
SACADO_DEFAULTED_FUNCTION ~GeneralFad ()=default
 Destructor.
 
SACADO_INLINE_FUNCTION void diff (const int ith, const int n)
 Set GeneralFad object as the ith independent variable.
 
SACADO_INLINE_FUNCTION void setUpdateValue (bool update_val)
 Set whether this Fad object should update values.
 
SACADO_INLINE_FUNCTION bool updateValue () const
 Return whether this Fad object has an updated value.
 
SACADO_INLINE_FUNCTION void cache () const
 Cache values.
 
template<typename S >
SACADO_INLINE_FUNCTION SACADO_EXP_ENABLE_EXPR_FUNC (bool) isEqualTo(const Expr< S > &xx) const
 Returns whether two Fad objects have the same values.
 

Derivative accessor methods

SACADO_INLINE_FUNCTION int availableSize () const
 Returns number of derivative components that can be stored without reallocation.
 
SACADO_INLINE_FUNCTION bool hasFastAccess () const
 Returns true if derivative array is not empty.
 
SACADO_INLINE_FUNCTION void setIsConstant (bool is_const)
 Set whether variable is constant.
 

Assignment operators

template<typename S >
SACADO_INLINE_FUNCTION SACADO_ENABLE_VALUE_FUNC (GeneralFad &) operator
 Assignment operator with constant right-hand-side.
 
SACADO_DEFAULTED_FUNCTION GeneralFadoperator= (GeneralFad &&x)=default
 Move assignment with GeneralFad right-hand-side.
 

Additional Inherited Members

- Public Member Functions inherited from Sacado::Fad::Exp::Expr< GeneralFad< Storage > >
SACADO_INLINE_FUNCTION const derived_typederived () const
 Return derived object.
 
SACADO_INLINE_FUNCTION const volatile derived_typederived () const volatile
 Return derived object.
 

Detailed Description

template<typename Storage>
class Sacado::Fad::Exp::GeneralFad< Storage >

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.

Definition at line 50 of file Sacado_Fad_Exp_GeneralFad.hpp.

Member Typedef Documentation

◆ StorageType

template<typename Storage >
typedef Storage Sacado::Fad::Exp::GeneralFad< Storage >::StorageType

Storage type.

Definition at line 57 of file Sacado_Fad_Exp_GeneralFad.hpp.

◆ ExprType

template<typename Storage >
typedef Expr< GeneralFad<Storage> > Sacado::Fad::Exp::GeneralFad< Storage >::ExprType

Expression type.

Definition at line 60 of file Sacado_Fad_Exp_GeneralFad.hpp.

◆ ExtenderType

template<typename Storage >
typedef Extender<Storage> Sacado::Fad::Exp::GeneralFad< Storage >::ExtenderType

Extender type.

Definition at line 63 of file Sacado_Fad_Exp_GeneralFad.hpp.

◆ scalar_type

template<typename Storage >
typedef ScalarType<value_type>::type Sacado::Fad::Exp::GeneralFad< Storage >::scalar_type

Typename of scalar's (which may be different from T)

Definition at line 69 of file Sacado_Fad_Exp_GeneralFad.hpp.

Constructor & Destructor Documentation

◆ GeneralFad() [1/5]

template<typename Storage >
SACADO_DEFAULTED_FUNCTION Sacado::Fad::Exp::GeneralFad< Storage >::GeneralFad ( )
default

Default constructor.

◆ GeneralFad() [2/5]

template<typename Storage >
SACADO_DEFAULTED_FUNCTION Sacado::Fad::Exp::GeneralFad< Storage >::GeneralFad ( const GeneralFad< Storage > & x)
default

Copy constructor.

◆ GeneralFad() [3/5]

template<typename Storage >
SACADO_DEFAULTED_FUNCTION Sacado::Fad::Exp::GeneralFad< Storage >::GeneralFad ( GeneralFad< Storage > && x)
default

Move constructor.

◆ GeneralFad() [4/5]

template<typename Storage >
template<typename S >
SACADO_INLINE_FUNCTION Sacado::Fad::Exp::GeneralFad< Storage >::GeneralFad ( const S & x,
SACADO_EXP_ENABLE_VALUE_CTOR_DECL  )
inline

Constructor with value (disabled for ViewFad)

Definition at line 111 of file Sacado_Fad_Exp_GeneralFad.hpp.

◆ GeneralFad() [5/5]

template<typename Storage >
template<typename S >
SACADO_INLINE_FUNCTION Sacado::Fad::Exp::GeneralFad< Storage >::GeneralFad ( const Expr< S > & x,
SACADO_EXP_ENABLE_EXPR_CTOR_DECL  )
inline

Copy constructor from any Expression object (disabled for ViewFad)

Definition at line 117 of file Sacado_Fad_Exp_GeneralFad.hpp.

◆ ~GeneralFad()

template<typename Storage >
SACADO_DEFAULTED_FUNCTION Sacado::Fad::Exp::GeneralFad< Storage >::~GeneralFad ( )
default

Destructor.

Member Function Documentation

◆ diff()

template<typename Storage >
SACADO_INLINE_FUNCTION void Sacado::Fad::Exp::GeneralFad< 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 135 of file Sacado_Fad_Exp_GeneralFad.hpp.

◆ setUpdateValue()

template<typename Storage >
SACADO_INLINE_FUNCTION void Sacado::Fad::Exp::GeneralFad< Storage >::setUpdateValue ( bool update_val)
inline

Set whether this Fad object should update values.

Retained for backward compatibility.

Definition at line 147 of file Sacado_Fad_Exp_GeneralFad.hpp.

◆ updateValue()

template<typename Storage >
SACADO_INLINE_FUNCTION bool Sacado::Fad::Exp::GeneralFad< Storage >::updateValue ( ) const
inline

Return whether this Fad object has an updated value.

Retained for backward compatibility.

Definition at line 153 of file Sacado_Fad_Exp_GeneralFad.hpp.

◆ cache()

template<typename Storage >
SACADO_INLINE_FUNCTION void Sacado::Fad::Exp::GeneralFad< Storage >::cache ( ) const
inline

Cache values.

Retained for backward compatibility.

Definition at line 159 of file Sacado_Fad_Exp_GeneralFad.hpp.

◆ SACADO_EXP_ENABLE_EXPR_FUNC()

template<typename Storage >
template<typename S >
SACADO_INLINE_FUNCTION Sacado::Fad::Exp::GeneralFad< Storage >::SACADO_EXP_ENABLE_EXPR_FUNC ( bool ) const &
inline

Returns whether two Fad objects have the same values.

Definition at line 164 of file Sacado_Fad_Exp_GeneralFad.hpp.

◆ availableSize()

template<typename Storage >
SACADO_INLINE_FUNCTION int Sacado::Fad::Exp::GeneralFad< Storage >::availableSize ( ) const
inline

Returns number of derivative components that can be stored without reallocation.

Definition at line 189 of file Sacado_Fad_Exp_GeneralFad.hpp.

◆ hasFastAccess()

template<typename Storage >
SACADO_INLINE_FUNCTION bool Sacado::Fad::Exp::GeneralFad< Storage >::hasFastAccess ( ) const
inline

Returns true if derivative array is not empty.

Definition at line 193 of file Sacado_Fad_Exp_GeneralFad.hpp.

◆ setIsConstant()

template<typename Storage >
SACADO_INLINE_FUNCTION void Sacado::Fad::Exp::GeneralFad< Storage >::setIsConstant ( bool is_const)
inline

Set whether variable is constant.

Definition at line 197 of file Sacado_Fad_Exp_GeneralFad.hpp.

◆ SACADO_ENABLE_VALUE_FUNC()

template<typename Storage >
template<typename S >
SACADO_INLINE_FUNCTION Sacado::Fad::Exp::GeneralFad< Storage >::SACADO_ENABLE_VALUE_FUNC ( GeneralFad< Storage > & )

Assignment operator with constant right-hand-side.

◆ operator=()

template<typename Storage >
SACADO_DEFAULTED_FUNCTION GeneralFad & Sacado::Fad::Exp::GeneralFad< Storage >::operator= ( GeneralFad< Storage > && x)
default

Move assignment with GeneralFad right-hand-side.

Member Data Documentation

◆ is_view

template<typename Storage >
constexpr bool Sacado::Fad::Exp::GeneralFad< Storage >::is_view = Storage::is_view
staticconstexpr

Whether we are a view.

Definition at line 72 of file Sacado_Fad_Exp_GeneralFad.hpp.


The documentation for this class was generated from the following file: