Sacado Development
Loading...
Searching...
No Matches
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 >:
Collaboration diagram for Sacado::Fad::Exp::GeneralFad< Storage >:

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

Public Member Functions

Initialization methods
 GeneralFad ()=default
 Default constructor.
 GeneralFad (const GeneralFad &x)=default
 Copy constructor.
 GeneralFad (GeneralFad &&x)=default
 Move constructor.
template<typename S>
 GeneralFad (const S &x, typename mpl::enable_if_c< std::is_convertible< S, value_type >::value &&!is_view, void * >::type=0)
 Constructor with value (disabled for ViewFad).
template<typename S>
 GeneralFad (const Expr< S > &x, typename mpl::enable_if_c< std::is_convertible< typename Expr< S >::derived_type::value_type, value_type >::value &&(ExprLevel< typename Expr< S >::derived_type::value_type >::value==ExprLevel< value_type >::value) &&!is_view, void * >::type=0)
 Copy constructor from any Expression object (disabled for ViewFad).
 ~GeneralFad ()=default
 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>
mpl::enable_if_c< std::is_convertible< typenameExpr< S >::derived_type::value_type, value_type >::value &&ExprLevel< typenameExpr< S >::derived_type::value_type >::value==ExprLevel< value_type >::value, bool >::type isEqualTo (const Expr< S > &xx) 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.
void setIsConstant (bool is_const)
 Set whether variable is constant.
Assignment operators
template<typename S>
Sacado::mpl::enable_if< std::is_convertible< S, value_type >, GeneralFad & >::type operator= (const S &v)
 Assignment operator with constant right-hand-side.
GeneralFadoperator= (const GeneralFad &x)=default
 Assignment with GeneralFad right-hand-side.
GeneralFadoperator= (GeneralFad &&x)=default
 Move assignment with GeneralFad right-hand-side.
template<typename S>
mpl::enable_if_c< std::is_convertible< typenameExpr< S >::derived_type::value_type, value_type >::value &&ExprLevel< typenameExpr< S >::derived_type::value_type >::value==ExprLevel< value_type >::value, GeneralFad & >::type operator= (const Expr< S > &x)
 Assignment operator with any expression right-hand-side.
Unary operators
template<typename S>
Sacado::mpl::enable_if< std::is_convertible< S, value_type >, GeneralFad & >::type operator+= (const S &v)
 Addition-assignment operator with constant right-hand-side.
template<typename S>
Sacado::mpl::enable_if< std::is_convertible< S, value_type >, GeneralFad & >::type operator-= (const S &v)
 Subtraction-assignment operator with constant right-hand-side.
template<typename S>
Sacado::mpl::enable_if< std::is_convertible< S, value_type >, GeneralFad & >::type operator*= (const S &v)
 Multiplication-assignment operator with constant right-hand-side.
template<typename S>
Sacado::mpl::enable_if< std::is_convertible< S, value_type >, GeneralFad & >::type operator/= (const S &v)
 Division-assignment operator with constant right-hand-side.
GeneralFadoperator+= (const GeneralFad &x)
 Addition-assignment operator with GeneralFad right-hand-side.
GeneralFadoperator-= (const GeneralFad &x)
 Subtraction-assignment operator with GeneralFad right-hand-side.
GeneralFadoperator*= (const GeneralFad &x)
 Multiplication-assignment operator with GeneralFad right-hand-side.
GeneralFadoperator/= (const GeneralFad &x)
 Division-assignment operator with GeneralFad right-hand-side.
template<typename S>
mpl::enable_if_c< std::is_convertible< typenameExpr< S >::derived_type::value_type, value_type >::value &&ExprLevel< typenameExpr< S >::derived_type::value_type >::value==ExprLevel< value_type >::value, GeneralFad & >::type operator+= (const Expr< S > &x)
 Addition-assignment operator with Expr right-hand-side.
template<typename S>
mpl::enable_if_c< std::is_convertible< typenameExpr< S >::derived_type::value_type, value_type >::value &&ExprLevel< typenameExpr< S >::derived_type::value_type >::value==ExprLevel< value_type >::value, GeneralFad & >::type operator-= (const Expr< S > &x)
 Subtraction-assignment operator with Expr right-hand-side.
template<typename S>
mpl::enable_if_c< std::is_convertible< typenameExpr< S >::derived_type::value_type, value_type >::value &&ExprLevel< typenameExpr< S >::derived_type::value_type >::value==ExprLevel< value_type >::value, GeneralFad & >::type operator*= (const Expr< S > &x)
 Multiplication-assignment operator with Expr right-hand-side.
template<typename S>
mpl::enable_if_c< std::is_convertible< typenameExpr< S >::derived_type::value_type, value_type >::value &&ExprLevel< typenameExpr< S >::derived_type::value_type >::value==ExprLevel< value_type >::value, GeneralFad & >::type operator/= (const Expr< S > &x)
 Division-assignment operator with Expr right-hand-side.
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.

Static Public Attributes

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

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.

Member Function Documentation

◆ cache()

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

Cache values.

Retained for backward compatibility.

◆ diff()

template<typename Storage>
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.

◆ setUpdateValue()

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

Set whether this Fad object should update values.

Retained for backward compatibility.

◆ updateValue()

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

Return whether this Fad object has an updated value.

Retained for backward compatibility.


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