Classes | |
struct | IsDirection |
If the expression inherits from Direction. Is either std::false_type or std::true_type. More... | |
struct | TraitsImplementation |
Common traits for all types used as gradients. More... | |
General gradient traits | |
template<typename Gradient> | |
using | Real = typename TraitsImplementation<Gradient>::Real |
The base value used in the gradient entries. | |
template<typename Gradient> | |
inlinesize_t constexpr | dim () |
Number of dimensions this gradient value has. | |
template<typename Gradient> | |
inlinetypename TraitsImplementation< Gradient >::Real & | at (Gradient &gradient, size_t dim) |
Get the entry at the given index. | |
template<typename Gradient> | |
inlinetypename TraitsImplementation< Gradient >::Real const & | at (Gradient const &gradient, size_t dim) |
Get the entry at the given index. | |
template<typename Gradient> | |
inlinestd::array< AtomicTraits::RemoveAtomic< typename TraitsImplementation< Gradient >::Real >, TraitsImplementation< Gradient >::dim > | toArray (Gradient const &gradient) |
Converts the (possibly multi-component) gradient to an array of Reals. | |
Detection of specific gradient types | |
template<typename Gradient> | |
using | EnableIfDirection = typename std::enable_if<IsDirection<Gradient>::value>::type |
Enable if wrapper for EnableIfDirection. | |
template<typename Gradient> | |
bool constexpr | isDirection = IsDirection<Gradient>::value |
Value entry of IsDirection. | |
Traits for everything that can be an used as a gradient (adjoint, tangent) usually the second template argument of CoDi Gen types codi::RealReverseGen. Possible types are double, codi::RealReverse, codi::Direction etc..
using codi::GradientTraits::Real = typename TraitsImplementation<Gradient>::Real |
The base value used in the gradient entries.
inlinetypename TraitsImplementation< Gradient >::Real & codi::GradientTraits::at | ( | Gradient & | gradient, |
size_t | dim ) |
Get the entry at the given index.
inlinetypename TraitsImplementation< Gradient >::Real const & codi::GradientTraits::at | ( | Gradient const & | gradient, |
size_t | dim ) |
Get the entry at the given index.
|
constexpr |
Number of dimensions this gradient value has.
inlinestd::array< AtomicTraits::RemoveAtomic< typename TraitsImplementation< Gradient >::Real >, TraitsImplementation< Gradient >::dim > codi::GradientTraits::toArray | ( | Gradient const & | gradient | ) |
Converts the (possibly multi-component) gradient to an array of Reals.