10 #ifndef SACADO_FAD_SIMPLEFAD_HPP
11 #define SACADO_FAD_SIMPLEFAD_HPP
31 template <
typename ValueT>
98 for (
int i=0;
i<this->
size();
i++)
110 if (x.
size() != this->
size())
return false;
111 bool eq = IE::eval(x.
val(), this->
val());
112 for (
int i=0;
i<this->
size();
i++)
113 eq = eq && IE::eval(x.
dx(
i), this->
dx(
i));
118 template <
typename S>
120 GeneralFadType::operator=(v);
126 GeneralFadType::operator=(static_cast<const GeneralFadType&>(x));
131 template <
typename S>
134 GeneralFadType::operator+=(x);
139 template <
typename S>
142 GeneralFadType::operator-=(x);
147 template <
typename S>
150 GeneralFadType::operator*=(x);
155 template <
typename S>
158 GeneralFadType::operator/=(x);
165 GeneralFadType::operator+=(static_cast<const GeneralFadType&>(x));
172 GeneralFadType::operator-=(static_cast<const GeneralFadType&>(x));
179 GeneralFadType::operator*=(static_cast<const GeneralFadType&>(x));
186 GeneralFadType::operator/=(static_cast<const GeneralFadType&>(x));
199 #endif // SACADO_FAD_SIMPLEFAD_HPP
SimpleFad(const SimpleFad &x, const ValueT &v, const ValueT &partial)
Tangent copy constructor.
ScalarType< value_type >::type scalar_type
Typename of scalar's (which may be different from T)
#define SACADO_ENABLE_VALUE_CTOR_DECL
GeneralFadType::scalar_type scalar_type
Typename of scalar's (which may be different from value_type)
RemoveConst< T >::type value_type
Typename of values.
GeneralFad< ValueT, StorageType > GeneralFadType
ScalarType< ValueT >::type ScalarT
Typename of scalar's (which may be different from ValueT)
SimpleFad(const SimpleFad &x)
Copy constructor.
Forward-mode AD class using dynamic memory allocation but no expression templates.
SimpleFad()
Default constructor.
SACADO_INLINE_FUNCTION DynamicStorage & operator=(const DynamicStorage &x)
Assignment.
SimpleFad(const int sz, const ValueT &x, const DerivInit zero_out=InitDerivArray)
Constructor with size sz and value x.
#define SACADO_ENABLE_VALUE_FUNC(RETURN_TYPE)
Base template specification for testing equivalence.
SACADO_INLINE_FUNCTION ValueT & fastAccessDx(int i)
Returns derivative component i without bounds checking.
Turn SimpleFad into a meta-function class usable with mpl::apply.
bool isEqualTo(const SimpleFad &x) const
Returns whether two Fad objects have the same values.
SACADO_INLINE_FUNCTION const T & val() const
Returns value.
DerivInit
Enum use to signal whether the derivative array should be initialized in AD object constructors...
GeneralFadType::value_type value_type
Typename of values.
SACADO_INLINE_FUNCTION int size() const
Returns number of derivative components.
Initialize the derivative array.
SimpleFad(const int sz, const int i, const ValueT &x)
Constructor with size sz, index i, and value x.
DynamicStorage< ValueT > StorageType
Base classes.
#define SACADO_INLINE_FUNCTION
SimpleFad(const S &x, SACADO_ENABLE_VALUE_CTOR_DECL)
Constructor with supplied value x convertible to ValueT.
SACADO_INLINE_FUNCTION const U * dx() const
Returns derivative array.
Forward-mode AD class templated on the storage for the derivative array.