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

Method createRoot

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

Source from the content-addressed store, hash-verified

24}
25
26NodeID Structure::createRoot(int kids)
27{
28 if (nodes_.size() > 0)
29 {
30 throw invalid_tree();
31 }
32
33 const auto root_nid = createNode(NodeID::NoNode, kids);
34
35 /// create white nodes for children nodes
36 for (auto i = 0; i < kids; ++i)
37 {
38 createChild(root_nid, i, 0);
39 }
40
41 return root_nid;
42}
43
44NodeID Structure::createNode(NodeID pid, int kids)
45{

Callers 15

handleNodeMethod · 0.45
ExecutionMethod · 0.45
runMethod · 0.45
growing_treeFunction · 0.45
binary_tree_executionFunction · 0.45
nary_executionFunction · 0.45
larger_nary_executionFunction · 0.45
simple_nary_executionFunction · 0.45
build_for_comparison_aFunction · 0.45
build_for_comparison_bFunction · 0.45

Calls 2

invalid_treeClass · 0.85
sizeMethod · 0.45

Tested by 12

growing_treeFunction · 0.36
binary_tree_executionFunction · 0.36
nary_executionFunction · 0.36
larger_nary_executionFunction · 0.36
simple_nary_executionFunction · 0.36
build_for_comparison_aFunction · 0.36
build_for_comparison_bFunction · 0.36
tree_buildingFunction · 0.36
hiding_failed_testFunction · 0.36
restart_treeFunction · 0.36