4 #ifndef DUNE_TYPETREE_TRAVERSALUTILITIES_HH
5 #define DUNE_TYPETREE_TRAVERSALUTILITIES_HH
25 template<
typename F,
typename R,
typename ResultType>
26 struct LeafReductionVisitor
27 :
public TypeTree::TreeVisitor
32 template<
typename Node,
typename TreePath>
38 LeafReductionVisitor(F functor, R reduction, ResultType startValue)
80 template<
typename ResultType,
typename Tree,
typename F,
typename R>
81 ResultType
reduceOverLeafs(
const Tree& tree, F functor, R reduction, ResultType startValue)
83 LeafReductionVisitor<F,R,ResultType> visitor(functor,reduction,startValue);
85 return visitor.result();
static const result_type result
Definition: accumulate_static.hh:110
R _reduction
Definition: traversalutilities.hh:47
F _functor
Definition: traversalutilities.hh:46
static const TreePathType::Type treePathType
Definition: traversalutilities.hh:30
ResultType _value
Definition: traversalutilities.hh:48
ResultType reduceOverLeafs(const Tree &tree, F functor, R reduction, ResultType startValue)
Calculate a quantity as a reduction over the leaf nodes of a TypeTree.
Definition: traversalutilities.hh:81
void applyToTree(Tree &&tree, Visitor &&visitor)
Apply visitor to TypeTree.
Definition: traversal.hh:237
constexpr HybridTreePath< T... > treePath(const T &... t)
Constructs a new HybridTreePath from the given indices.
Definition: treepath.hh:188
HybridTreePath< Dune::index_constant< i >... > TreePath
Definition: treepath.hh:433
Definition: accumulate_static.hh:13
Type
Definition: treepath.hh:30
@ dynamic
Definition: treepath.hh:30