MCPcopy Create free account
hub / github.com/MiniZinc/MiniZincIDE / pre_order_apply

Function pre_order_apply

cp-profiler/src/cpprofiler/utils/tree_utils.cpp:88–107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

86}
87
88void pre_order_apply(const tree::NodeTree &nt, NodeID start, const NodeAction &action)
89{
90 std::stack<NodeID> stk;
91
92 stk.push(start);
93
94 while (stk.size() > 0)
95 {
96 auto nid = stk.top();
97 stk.pop();
98
99 action(nid);
100
101 for (auto i = nt.childrenCount(nid) - 1; i >= 0; --i)
102 {
103 auto child = nt.getChild(nid, i);
104 stk.push(child);
105 }
106 }
107}
108
109bool is_right_most_child(const tree::NodeTree &nt, NodeID nid)
110{

Callers 1

showLabelsDownMethod · 0.85

Calls 4

topMethod · 0.80
sizeMethod · 0.45
childrenCountMethod · 0.45
getChildMethod · 0.45

Tested by

no test coverage detected