Dune TypeTree (unstable)
accumulate_static.hh
3// SPDX-FileCopyrightInfo: Copyright © DUNE Project contributors, see file LICENSE.md in module root
108 template<typename Node, typename Functor, typename Reduction, typename Functor::result_type current_value, typename TreePath, bool doVisit>
119 template<typename Node, typename Functor, typename Reduction, typename Functor::result_type current_value, typename TreePath>
125 static const result_type result = Reduction::template reduce<current_value,Functor::template visit<Node,TreePath>::result>::result;
130 template<typename Tree, typename Functor, typename Reduction, typename ParentChildReduction, typename Functor::result_type current_value, typename TreePath, typename Tag>
134 template<typename LeafNode, typename Functor, typename Reduction, typename ParentChildReduction, typename Functor::result_type current_value, typename TreePath>
135 struct accumulate_value<LeafNode,Functor,Reduction,ParentChildReduction,current_value,TreePath,LeafNodeTag>
142 accumulate_node_helper<LeafNode,Functor,Reduction,current_value,TreePath,Functor::template doVisit<LeafNode,TreePath>::value>::result;
147 template<typename Node, typename Functor, typename Reduction, typename ParentChildReduction, typename Functor::result_type current_value, typename TreePath, std::size_t i, std::size_t n>
157 static const result_type child_result = accumulate_value<child,Functor,Reduction,ParentChildReduction,current_value,child_tree_path,NodeTag<child>>::result;
159 static const result_type result = accumulate_over_children<Node,Functor,Reduction,ParentChildReduction,child_result,TreePath,i+1,n>::result;
164 template<typename Node, typename Functor, typename Reduction, typename ParentChildReduction, typename Functor::result_type current_value, typename TreePath, std::size_t n>
165 struct accumulate_over_children<Node,Functor,Reduction,ParentChildReduction,current_value,TreePath,n,n>
176 template<typename Node, typename Functor, typename Reduction, typename ParentChildReduction, typename Functor::result_type current_value, typename TreePath>
182 static const result_type child_result = accumulate_over_children<Node,Functor,Reduction,ParentChildReduction,current_value,TreePath,0,StaticDegree<Node>::value>::result;
185 accumulate_node_helper<Node,Functor,ParentChildReduction,child_result,TreePath,Functor::template doVisit<Node,TreePath>::value>::result;
191 template<typename PowerNode, typename Functor, typename Reduction, typename ParentChildReduction, typename Functor::result_type current_value, typename TreePath>
192 struct accumulate_value<PowerNode,Functor,Reduction,ParentChildReduction,current_value,TreePath,PowerNodeTag>
193 : public accumulate_value_generic_composite_node<PowerNode,Functor,Reduction,ParentChildReduction,current_value,TreePath>
197 template<typename CompositeNode, typename Functor, typename Reduction, typename ParentChildReduction, typename Functor::result_type current_value, typename TreePath>
198 struct accumulate_value<CompositeNode,Functor,Reduction,ParentChildReduction,current_value,TreePath,CompositeNodeTag>
199 : public accumulate_value_generic_composite_node<CompositeNode,Functor,Reduction,ParentChildReduction,current_value,TreePath>
261 template<typename Tree, typename Functor, typename Reduction, typename Functor::result_type startValue, typename ParentChildReduction = Reduction>
269 static const result_type result = accumulate_value<Tree,Functor,Reduction,ParentChildReduction,startValue,HybridTreePath<>,NodeTag<Tree>>::result;
287 template<typename Node, typename Functor, typename Reduction, typename current_type, typename TreePath, bool doVisit>
296 template<typename Node, typename Functor, typename Reduction, typename current_type, typename TreePath>
311 template<typename Tree, typename Policy, typename current_type, typename TreePath, typename Tag>
335 template<typename current_type, typename tree_path, typename start_type, typename reduction_strategy>
368 template<typename Node, typename Policy, typename current_type, typename TreePath, std::size_t i, std::size_t n>
402 template<typename Node, typename Policy, typename current_type, typename TreePath, std::size_t n>
604 using preferDynamicTraversal = std::bool_constant<Visitor::treePathType == TreePathType::dynamic>;
std::size_t degree(const Node &node)
Returns the degree of node as run time information.
Definition: nodeinterface.hh:79
typename std::decay_t< Node >::NodeTag NodeTag
Returns the node tag of the given Node.
Definition: nodeinterface.hh:70
constexpr auto hybridTreePath(const T &... t)
Constructs a new HybridTreePath from the given indices.
Definition: treepath.hh:102
Dune::HybridMultiIndex< T... > HybridTreePath
A type for representing tree paths that supports both compile time and run time indices.
Definition: treepath.hh:85
Statically accumulate a type over the nodes of a TypeTree.
Definition: accumulate_static.hh:557
accumulate_type< Tree, Policy, typenamePolicy::start_type, HybridTreePath<>, NodeTag< Tree > >::type type
The accumulated result of the computation.
Definition: accumulate_static.hh:566
Statically accumulate a value over the nodes of a TypeTree.
Definition: accumulate_static.hh:263
Functor::result_type result_type
The result type of the computation.
Definition: accumulate_static.hh:266
static const result_type result
The accumulated result of the computation.
Definition: accumulate_static.hh:269
Definition: accumulate_static.hh:470
ParentChildReduction parent_child_reduction
Definition: accumulate_static.hh:528
StartType start_type
Definition: accumulate_static.hh:536
ReductionAlgorithm reduction_strategy
Definition: accumulate_static.hh:542
Reduction sibling_reduction
Definition: accumulate_static.hh:520
Statically combine two values of type result_type using &&.
Definition: accumulate_static.hh:39
Statically combine two values of type result_type by returning their maximum.
Definition: accumulate_static.hh:94
Statically combine two values of type result_type by returning their minimum.
Definition: accumulate_static.hh:83
Statically combine two values of type result_type using -.
Definition: accumulate_static.hh:61
Statically combine two values of type result_type using *.
Definition: accumulate_static.hh:72
Statically combine two values of type result_type using ||.
Definition: accumulate_static.hh:28
Statically combine two values of type result_type using +.
Definition: accumulate_static.hh:50
|
Legal Statements / Impressum |
Hosted by TU Dresden & Uni Heidelberg |
generated with Hugo v0.111.3
(Jan 10, 23:35, 2026)