DUNE-ACFEM (unstable)
SequenceAccumulate
Accumulate over all elements of a sequence using functors. More...
Modules | |
SequenceAccumulateFunctors | |
Pre-defined functors as argument to the AccumulateSequence template. | |
Typedefs | |
template<class F , class Seq > | |
using | Dune::ACFem::AccumulateSequence = Constant< typename Seq::value_type, AccumulateSequenceHelper< Seq, F >::value > |
Accumulate the values of the sequence according to the supplied functor. More... | |
Detailed Description
Accumulate over all elements of a sequence using functors.
Typedef Documentation
◆ AccumulateSequence
template<class F , class Seq >
using Dune::ACFem::AccumulateSequence = typedef Constant<typename Seq::value_type, AccumulateSequenceHelper<Seq, F>::value> |
Accumulate the values of the sequence according to the supplied functor.
The functor must define an "Apply"-template of the following type, where the neutralValue
is the result value for the empty sequence and the value the last element of the sequence will be combined with. Front
is the current element, Tail
the resulting value obtained by accumulating the rest of the sequence. T will be TYPE when instantiating the Apply alias.
struct Functor
{
template<class T>
using NeutralValue = Constant<T, SOMETHING>;
template<class T, T Front, T Tail>
using Apply = IntegerConstant<TYPE, EXPRESSION(Front, Tail)>;
};
integral_constant< T, V > Constant
Short-cut for any integral constant.
Definition: types.hh:40
Gets the type of the n-th element of a tuple-like or the std::integral_constant corresponding to the ...
Definition: access.hh:42
- Note
- AccumulateSequence is rather general. For simple things it is probably better to use the builtin fold expressions of the compiler.
|
Legal Statements / Impressum |
Hosted by TU Dresden |
generated with Hugo v0.111.3
(Dec 27, 23:30, 2024)