1#ifndef __DUNE_ACFEM_EXPRESSIONS_EXAMINEUTIL_HH__
2#define __DUNE_ACFEM_EXPRESSIONS_EXAMINEUTIL_HH__
4#include "../mpl/accumulate.hh"
6#include "runtimeequal.hh"
25 template<
class E,
class T>
39 template<
class E,
class T>
43 using NumberOfTerminals = ExamineAdd<E, IsSelfExpression>;
46 constexpr inline std::size_t numberOfTerminals()
48 return NumberOfTerminals<E>::value;
52 constexpr inline std::size_t numberOfTerminals(E&&)
54 return numberOfTerminals<E>();
71 template<
class E,
class T>
72 using SubExpressionMultiplicity = ExamineAdd<EnclosedType<E>, AreRuntimeEqual, EnclosedType<T> >;
75 template<
class E,
class T>
76 constexpr auto subExpressionMultiplicity(E&& e = E{}, T&& t = T{})
78 return SubExpressionMultiplicity<E, T>::value;
84 template<
class Dummy,
class ArgDepths>
92 using Depth = ExamineRecurse<E, std::size_t, Max, ExamineImpl::DepthFunctor>;
96 constexpr std::size_t depth()
98 return Depth<E>::value;
103 constexpr auto depth(E&& e)
108 template<
class T,
class SFINAE =
void>
109 constexpr inline std::size_t ExpressionWeightV = addLoop<Arity<T>::value>([](
auto i) {
return ExpressionWeightV<Operand<
decltype(i)::value, T> >; }, WeightV<T>);
112 constexpr inline std::size_t ExpressionWeightV<T, std::enable_if_t<IsSelfExpression<T>::value> > = WeightV<T>;
116 constexpr auto weight()
118 return ExpressionWeightV<E>;
123 constexpr auto weight(E&&)
131 template<std::
size_t Id,
class E>
132 using ExplicitlyDependsOn = ExamineOr<E, IndeterminateMatch, IndexConstant<Id> >;
136 using Expressions::ExpressionWeightV;
decltype(operate(std::declval< OptOrF >(), std::declval< Rest >()...)) ExpressionType
Generate the type of an expression by calling operate().
Definition: optimizationbase.hh:256
Constant< std::size_t, V > IndexConstant
Short-cut for integral constant of type std::size_t.
Definition: types.hh:44
Definition: examineutil.hh:87