41#include "atomicTraits.hpp"
42#include "misc/enableIfHelpers.hpp"
47 template<
typename Real,
size_t dim>
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>,
115 TraitsImplementation<Gradient>::dim>
126 template<
typename Gradient,
typename =
void>
129#ifndef DOXYGEN_DISABLE
130 template<
typename Gradient>
137 template<
typename Gradient>
141 template<
typename Gradient>
#define CODI_INLINE
See codi::Config::ForcedInlines.
Definition config.h:469
#define CODI_DD(Type, Default)
Abbreviation for CODI_DECLARE_DEFAULT.
Definition macros.hpp:96
Definition gradientTraits.hpp:52
bool constexpr isDirection
Value entry of IsDirection.
Definition gradientTraits.hpp:138
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:142
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.
Definition gradientTraits.hpp:116
inlinesize_t constexpr dim()
Number of dimensions this gradient value has.
Definition gradientTraits.hpp:96
inlinetypename 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:94
std::enable_if< std::is_same< T1, T2 >::value, R > enable_if_same
Enable if abbreviation for "std::is_same".
Definition enableIfHelpers.hpp:51
inlinevoid CODI_UNUSED(Args const &...)
Disable unused warnings for an arbitrary number of arguments.
Definition macros.hpp:54
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
Definition gradientTraits.hpp:70
inlinestatic Real & at(Gradient &gradient, size_t dim)
Get the entry at the given index.
Definition gradientTraits.hpp:73
inlinestatic 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
Gradient Gradient
Definition gradientTraits.hpp:67
Gradient Real
Definition gradientTraits.hpp:68
inlinestatic Real const & at(Gradient const &gradient, size_t dim)
Get the entry at the given index.
Definition gradientTraits.hpp:79