41 template <
typename ValueT,
int Num>
43 public Expr< SFadExprTag<ValueT,Num > > {
48 typedef Expr< SFadExprTag<ValueT,Num > >
ExprType;
102 SFad(
const int sz,
const int i,
const ValueT & x) :
111 template <
typename S>
123 template <
typename S>
126 ExprType::operator=(v);
133 ExprType::operator=(static_cast<const ExprType&>(x));
138 template <
typename S>
142 ExprType::operator=(x);
147 template <
typename S>
150 ExprType::operator+=(x);
155 template <
typename S>
158 ExprType::operator-=(x);
163 template <
typename S>
166 ExprType::operator*=(x);
171 template <
typename S>
174 ExprType::operator/=(x);
181 ExprType::operator+=(static_cast<const ExprType&>(x));
188 ExprType::operator-=(static_cast<const ExprType&>(x));
195 ExprType::operator*=(static_cast<const ExprType&>(x));
202 ExprType::operator/=(static_cast<const ExprType&>(x));
207 template <
typename S>
210 ExprType::operator+=(x);
215 template <
typename S>
218 ExprType::operator-=(x);
223 template <
typename S>
226 ExprType::operator*=(x);
231 template <
typename S>
234 ExprType::operator/=(x);
240 template <
typename T,
int Num>
242 const Expr< SFadExprTag<T,Num> >& x) {
243 os << x.val() <<
" [";
245 for (
int i=0; i< x.size(); i++) {
246 os <<
" " << x.dx(i);
253 template <
typename T,
int N>
255 static const unsigned value =
256 ExprLevel< typename SFad<T,N>::value_type >::value + 1;
259 template <
typename T,
int N>
261 static const bool value =
true;
266 template <
typename T,
int N>
271 template <
typename T,
int N>
276 template <
typename T,
int N>
281 template <
typename T,
unsigned,
unsigned>
struct ViewFadType;
283 template <
typename,
unsigned,
unsigned,
typename>
class ViewFad;
287 template<
class ValueType,
int N,
unsigned length,
unsigned str
ide >
296 template<
class ValueType,
int N,
unsigned length,
unsigned str
ide >
ExprType::scalar_type scalar_type
Typename of scalar's (which may be different from value_type)
KOKKOS_INLINE_FUNCTION SFad(const S &x, SACADO_ENABLE_VALUE_CTOR_DECL)
Constructor with supplied value x convertible to ValueT.
KOKKOS_INLINE_FUNCTION SFad(const int sz, const ValueT &x, const DerivInit zero_out=InitDerivArray)
Constructor with size sz and value x.
KOKKOS_INLINE_FUNCTION ~SFad()
Destructor.
#define SACADO_ENABLE_VALUE_CTOR_DECL
Base template specification for whether a type is a Fad type.
Sacado::FAD_NS::ViewFad< ValueType, length, stride, Sacado::FAD_NS::SFad< ValueType, N > > type
Forward-mode AD class using dynamic memory allocation and expression templates.
Turn SFad into a meta-function class usable with mpl::apply.
ScalarType< ValueT >::type ScalarT
Typename of scalar's (which may be different from ValueT)
#define SACADO_ENABLE_EXPR_CTOR_DECL
std::ostream & operator<<(std::ostream &os, const Expr< SFadExprTag< T, Num > > &x)
FAD_NS::SFad< T, N >::base_expr_type type
#define KOKKOS_INLINE_FUNCTION
#define SACADO_ENABLE_VALUE_FUNC(RETURN_TYPE)
Get the base Fad type from a view/expression.
KOKKOS_INLINE_FUNCTION SFad(const Expr< S > &x, SACADO_ENABLE_EXPR_CTOR_DECL)
Copy constructor from any Expression object.
Expr< SFadExprTag< ValueT, Num > > ExprType
Base classes.
#define SACADO_ENABLE_EXPR_FUNC(RETURN_TYPE)
DerivInit
Enum use to signal whether the derivative array should be initialized in AD object constructors...
ExprType::value_type value_type
Typename of values.
KOKKOS_INLINE_FUNCTION SFad(const int sz, const int i, const ValueT &x)
Constructor with size sz, index i, and value x.
Forward-mode AD class using static memory allocation.
Initialize the derivative array.
KOKKOS_INLINE_FUNCTION SFad(const SFad &x)
Copy constructor.
Sacado::FAD_NS::ViewFad< const ValueType, length, stride, Sacado::FAD_NS::SFad< ValueType, N > > type
KOKKOS_INLINE_FUNCTION SFad()
Default constructor.
Get view type for any Fad type.