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

Method getChild

cp-profiler/src/cpprofiler/tree/node.cpp:128–151  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

126}
127
128NodeID Node::getChild(int alt) const
129{
130 const auto kids = childrenCount();
131
132 if (kids <= 0)
133 {
134 throw std::exception();
135 }
136 else if (kids <= 2)
137 {
138 if (alt == 0)
139 {
140 return static_cast<NodeID>(static_cast<int>(reinterpret_cast<ptrdiff_t>(m_childrenOrFirstChild) >> 2));
141 }
142 else
143 {
144 return NodeID{-m_noOfChildren};
145 }
146 }
147 else
148 {
149 return getPtr()[alt];
150 }
151}
152
153void Node::addChild()
154{

Callers 15

saveSearchMethod · 0.45
nodes_belowFunction · 0.45
pre_order_applyFunction · 0.45
pre_orderFunction · 0.45
post_orderFunction · 0.45
calc_subtree_sizesFunction · 0.45
copy_tree_intoFunction · 0.45
create_pentagonFunction · 0.45
runMethod · 0.45
linkLocationsPentagonFunction · 0.45
initOrigLocationsMethod · 0.45
runNogoodAnalysisMethod · 0.45

Calls

no outgoing calls

Tested by 1

growing_treeFunction · 0.36