MCPcopy Create free account
hub / github.com/Gecode/gecode / reset

Method reset

gecode/gist/treecanvas.cpp:825–856  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

823 }
824
825 void
826 TreeCanvas::reset(void) {
827 QMutexLocker locker(&mutex);
828 Space* rootSpace =
829 root->getStatus() == FAILED ? nullptr :
830 root->getSpace(*na,curBest,c_d,a_d);
831 if (curBest != nullptr) {
832 delete curBest;
833 curBest = new BestNode(nullptr);
834 }
835 if (root) {
836 DisposeCursor dc(root,*na);
837 PreorderNodeVisitor<DisposeCursor>(dc).run();
838 }
839 delete na;
840 na = new Node::NodeAllocator(curBest != nullptr);
841 int rootIdx = na->allocate(rootSpace);
842 assert(rootIdx == 0); (void) rootIdx;
843 root = (*na)[0];
844 root->setMarked(true);
845 currentNode = root;
846 pathHead = root;
847 scale = 1.0;
848 stats = Statistics();
849 for (int i=bookmarks.size(); i--;)
850 emit removedBookmark(i);
851 bookmarks.clear();
852 root->layout(*na);
853
854 emit statusChanged(currentNode, stats, true);
855 update();
856 }
857
858 void
859 TreeCanvas::bookmarkNode(void) {

Callers

nothing calls this directly

Calls 10

updateFunction · 0.85
getStatusMethod · 0.80
setMarkedMethod · 0.80
layoutMethod · 0.80
StatisticsClass · 0.70
getSpaceMethod · 0.45
runMethod · 0.45
allocateMethod · 0.45
sizeMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected