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

Method createRoot

cp-profiler/src/cpprofiler/tree/node_tree.cpp:59–83  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

57}
58
59NodeID NodeTree::createRoot(int kids, Label label)
60{
61 auto nid = structure_->createRoot(kids);
62 addEntry(nid);
63 setLabel(nid, label);
64
65 auto depth = kids > 0 ? 2 : 1;
66
67 node_stats_.inform_depth(depth);
68 node_stats_.add_branch(1);
69 node_info_->setStatus(nid, NodeStatus::BRANCH);
70
71 for (auto i = 0; i < kids; ++i)
72 {
73 auto child_nid = structure_->getChild(nid, i);
74 addEntry(child_nid);
75 node_info_->setStatus(child_nid, NodeStatus::UNDETERMINED);
76 }
77
78 node_stats_.add_undetermined(kids);
79
80 emit structureUpdated();
81
82 return nid;
83}
84
85/// Note that this form does not create children
86void NodeTree::db_createRoot(NodeID nid, Label label)

Callers

nothing calls this directly

Calls 5

inform_depthMethod · 0.80
add_branchMethod · 0.80
setStatusMethod · 0.80
add_undeterminedMethod · 0.80
getChildMethod · 0.45

Tested by

no test coverage detected