41#include "atomicTraits.hpp"
42#include "misc/enableIfHelpers.hpp"
47 template<
typename Real,
size_t dim>
52 namespace GradientTraits {
63 template<
typename T_Gradient,
typename =
void>
70 static size_t constexpr dim = 1;
86 return std::array<AtomicTraits::RemoveAtomic<Real>,
dim>{
at(gradient, 0)};
91 template<
typename Gradient>
95 template<
typename Gradient>
101 template<
typename Gradient>
107 template<
typename Gradient>
113 template<
typename Gradient>
114 CODI_INLINE std::array<AtomicTraits::RemoveAtomic<typename TraitsImplementation<Gradient>::Real>,
126 template<
typename Gradient,
typename =
void>
129#ifndef DOXYGEN_DISABLE
130 template<
typename Gradient>
138 template<
typename Gradient>
139 bool constexpr isDirection = IsDirection<Gradient>::value;
143 template<
typename Gradient>
#define CODI_INLINE
See codi::Config::ForcedInlines.
Definition config.h:457
#define CODI_DD(Type, Default)
Abbreviation for CODI_DECLARE_DEFAULT.
Definition macros.hpp:94
typename TraitsImplementation< Gradient >::Real Real
The base value used in the gradient entries.
Definition gradientTraits.hpp:92
typename std::enable_if< IsDirection< Gradient >::value >::type EnableIfDirection
Enable if wrapper for EnableIfDirection.
Definition gradientTraits.hpp:144
std::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.
Definition gradientTraits.hpp:116
size_t constexpr dim()
Number of dimensions this gradient value has.
Definition gradientTraits.hpp:96
TraitsImplementation< Gradient >::Real & at(Gradient &gradient, size_t dim)
Get the entry at the given index.
Definition gradientTraits.hpp:102
CoDiPack - Code Differentiation Package.
Definition codi.hpp:90
void CODI_UNUSED(Args const &...)
Disable unused warnings for an arbitrary number of arguments.
Definition macros.hpp:46
std::enable_if< std::is_same< T1, T2 >::value, R > enable_if_same
Enable if abbreviation for "std::is_same".
Definition enableIfHelpers.hpp:51
Fixed size vector mode implementation.
Definition direction.hpp:57
If the expression inherits from Direction. Is either std::false_type or std::true_type.
Definition gradientTraits.hpp:127
Common traits for all types used as gradients.
Definition gradientTraits.hpp:64
static size_t constexpr dim
Number of dimensions this gradient value has.
Definition gradientTraits.hpp:70
static Real & at(Gradient &gradient, size_t dim)
Get the entry at the given index.
Definition gradientTraits.hpp:73
static std::array< AtomicTraits::RemoveAtomic< Real >, dim > toArray(Gradient const &gradient)
Converts the (possibly multi-component) gradient to an array of Reals.
Definition gradientTraits.hpp:85
T_Gradient Gradient
See TraitsImplementation.
Definition gradientTraits.hpp:67
Gradient Real
The base value used in the gradient entries.
Definition gradientTraits.hpp:68
static Real const & at(Gradient const &gradient, size_t dim)
Get the entry at the given index.
Definition gradientTraits.hpp:79