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

Method getAlternative

cp-profiler/src/cpprofiler/tree/structure.cpp:120–136  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

118}
119
120int Structure::getAlternative(NodeID nid) const
121{
122 auto parent_nid = getParent(nid);
123
124 if (parent_nid == NodeID::NoNode)
125 return -1;
126
127 for (auto i = 0; i < childrenCount(parent_nid); ++i)
128 {
129 if (getChild(parent_nid, i) == nid)
130 {
131 return i;
132 }
133 }
134 throw;
135 return -1;
136}
137
138int Structure::nodeCount() const
139{

Callers 8

save_nodesFunction · 0.45
is_right_most_childFunction · 0.45
partition_stepFunction · 0.45
navLeftMethod · 0.45
navRightMethod · 0.45
printNodeInfoMethod · 0.45
mayMoveSidewardsMethod · 0.45
moveUpwardsMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected