30#ifndef SACADO_FAD_EXP_GENERALFAD_HPP
31#define SACADO_FAD_EXP_GENERALFAD_HPP
49 template <
typename Storage>
51 public Expr< GeneralFad<Storage> >,
66 using typename StorageType::value_type;
72 static constexpr bool is_view = Storage::is_view;
94 using ExtenderType::ExtenderType;
109 template <
typename S>
115 template <
typename S>
136 if (this->size() != n)
162 template <
typename S>
166 const expr_type&
x = xx.derived();
169 if (
x.size() !=
this->size())
return false;
170 bool eq = IE::eval(
x.val(),
this->val());
171 const int sz = this->size();
210 template <
typename S>
214 if (this->size()) this->resize(0);
229 template <
typename S>
244 template <
typename S>
252 template <
typename S>
260 template <
typename S>
263 const int sz = this->size();
271 template <
typename S>
274 const int sz = this->size();
310 template <
typename S>
318 template <
typename S>
326 template <
typename S>
334 template <
typename S>
345 template <
typename S>
351 template <
typename S>
359 template <
typename S>
360 struct IsView< Fad::Exp::GeneralFad<S> > {
364 template <
typename S>
365 struct IsFad< Fad::Exp::GeneralFad<S> > {
369 template <
typename S>
370 struct IsExpr< Fad::Exp::GeneralFad<S> > {
374 template <
typename S>
#define SACADO_INLINE_FUNCTION
#define SACADO_DEFAULTED_FUNCTION
#define SACADO_FAD_DERIV_LOOP(I, SZ)
expr expr expr fastAccessDx(i)) FAD_UNARYOP_MACRO(exp
#define SACADO_EXP_ENABLE_EXPR_FUNC(RETURN_TYPE)
#define SACADO_ENABLE_VALUE_FUNC(RETURN_TYPE)
#define SACADO_EXP_ENABLE_EXPR_CTOR_DECL
#define SACADO_EXP_ENABLE_VALUE_CTOR_DECL
Fad specializations for Teuchos::BLAS wrappers.
static SACADO_INLINE_FUNCTION void assign_divide_equal(DstType &dst, const SrcType &x)
Implementation of dst /= x.
static SACADO_INLINE_FUNCTION void assign_plus_equal(DstType &dst, const SrcType &x)
Implementation of dst += x.
static SACADO_INLINE_FUNCTION void assign_times_equal(DstType &dst, const SrcType &x)
Implementation of dst *= x.
static SACADO_INLINE_FUNCTION void assign_equal(DstType &dst, const SrcType &x)
Implementation of dst = x.
static SACADO_INLINE_FUNCTION void assign_minus_equal(DstType &dst, const SrcType &x)
Implementation of dst -= x.
Wrapper for a generic expression template.
T derived_type
Typename of derived object, returned by derived()
SACADO_INLINE_FUNCTION const derived_type & derived() const
Return derived object.
Extension class for extending interface of its argument.
Forward-mode AD class templated on the storage for the derivative array.
SACADO_INLINE_FUNCTION void diff(const int ith, const int n)
Set GeneralFad object as the ith independent variable.
SACADO_DEFAULTED_FUNCTION ~GeneralFad()=default
Destructor.
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 GeneralFad(const Expr< S > &x, SACADO_EXP_ENABLE_EXPR_CTOR_DECL)
Copy constructor from any Expression object (disabled for ViewFad)
SACADO_INLINE_FUNCTION bool hasFastAccess() const
Returns true if derivative array is not empty.
SACADO_INLINE_FUNCTION int availableSize() const
Returns number of derivative components that can be stored without reallocation.
SACADO_INLINE_FUNCTION SACADO_EXP_ENABLE_EXPR_FUNC(bool) isEqualTo(const Expr< S > &xx) const
Returns whether two Fad objects have the same values.
SACADO_DEFAULTED_FUNCTION GeneralFad()=default
Default constructor.
Extender< Storage > ExtenderType
Extender type.
SACADO_INLINE_FUNCTION void cache() const
Cache values.
Storage StorageType
Storage type.
SACADO_INLINE_FUNCTION GeneralFad(const S &x, SACADO_EXP_ENABLE_VALUE_CTOR_DECL)
Constructor with value (disabled for ViewFad)
static constexpr bool is_view
Whether we are a view.
SACADO_INLINE_FUNCTION void setIsConstant(bool is_const)
Set whether variable is constant.
ScalarType< value_type >::type scalar_type
Typename of scalar's (which may be different from T)
SACADO_DEFAULTED_FUNCTION GeneralFad(const GeneralFad &x)=default
Copy constructor.
SACADO_DEFAULTED_FUNCTION GeneralFad(GeneralFad &&x)=default
Move constructor.
SACADO_DEFAULTED_FUNCTION GeneralFad & operator=(GeneralFad &&x)=default
Move assignment with GeneralFad right-hand-side.
SACADO_INLINE_FUNCTION SACADO_ENABLE_VALUE_FUNC(GeneralFad &) operator
Assignment operator with constant right-hand-side.
Expr< GeneralFad< Storage > > ExprType
Expression type.
Forward-mode AD class templated on the storage for the derivative array.
@ NoInitDerivArray
Do not initialize the derivative array.
Fad::Exp::GeneralFad< S > type
Get the base Fad type from a view/expression.
Meta-function for determining nesting with an expression.
static constexpr unsigned value
Replace static derivative length.
Storage::template apply_N< N >::type S
Turn GeneralFad into a meta-function class usable with mpl::apply.
Storage::template apply< T >::type S
Determine whether a given type is an expression.
static constexpr bool value
Base template specification for whether a type is a Fad type.
Determine whether a given type is a view.