diff --git a/gtsam_unstable/discrete/examples/schedulingExample.cpp b/gtsam_unstable/discrete/examples/schedulingExample.cpp index 60b8a197d..9c22586fd 100644 --- a/gtsam_unstable/discrete/examples/schedulingExample.cpp +++ b/gtsam_unstable/discrete/examples/schedulingExample.cpp @@ -156,7 +156,7 @@ void solveStaged(size_t addMutex = 2) { gttoc_(eliminate); // find root node - DiscreteConditional::shared_ptr root = *(chordal->rbegin()); + DiscreteConditional::shared_ptr root = *(chordal->end()-1); if (debug) root->print(""/*scheduler.studentName(s)*/); @@ -223,7 +223,7 @@ void sampleSolutions() { vector stats(19, 0); vector samples; for (size_t i = 0; i < 7; i++) { - samples.push_back(sample(*samplers[i])); + samples.push_back(samplers[i]->sample()); schedulers[i].accumulateStats(samples[i], stats); } size_t max = *max_element(stats.begin(), stats.end()); @@ -309,7 +309,7 @@ void accomodateStudent() { DiscreteBayesNet::shared_ptr chordal = scheduler.eliminate(); // find root node - DiscreteConditional::shared_ptr root = *(chordal->rbegin()); + DiscreteConditional::shared_ptr root = *(chordal->end()-1); if (debug) root->print(""/*scheduler.studentName(s)*/); // GTSAM_PRINT(*chordal); @@ -327,7 +327,7 @@ void accomodateStudent() { // sample schedules for (size_t n = 0; n < 10; n++) { - Scheduler::sharedValues sample0 = sample(*chordal); + Scheduler::sharedValues sample0 = chordal->sample(); scheduler.printAssignment(sample0); } } diff --git a/gtsam_unstable/discrete/examples/schedulingQuals12.cpp b/gtsam_unstable/discrete/examples/schedulingQuals12.cpp index 1cb61e942..05a305422 100644 --- a/gtsam_unstable/discrete/examples/schedulingQuals12.cpp +++ b/gtsam_unstable/discrete/examples/schedulingQuals12.cpp @@ -130,7 +130,7 @@ void runLargeExample() { tictoc_finishedIteration(); tictoc_print(); for (size_t i=0;i<100;i++) { - DiscreteFactor::sharedValues assignment = sample(*chordal); + DiscreteFactor::sharedValues assignment = chordal->sample(); vector stats(scheduler.nrFaculty()); scheduler.accumulateStats(assignment, stats); size_t max = *max_element(stats.begin(), stats.end()); @@ -183,7 +183,7 @@ void solveStaged(size_t addMutex = 2) { gttoc_(eliminate); // find root node - DiscreteConditional::shared_ptr root = *(chordal->rbegin()); + DiscreteConditional::shared_ptr root = *(chordal->end()-1); if (debug) root->print(""/*scheduler.studentName(s)*/); @@ -234,7 +234,7 @@ void sampleSolutions() { vector stats(19, 0); vector samples; for (size_t i = 0; i < NRSTUDENTS; i++) { - samples.push_back(sample(*samplers[i])); + samples.push_back(samplers[i]->sample()); schedulers[i].accumulateStats(samples[i], stats); } size_t max = *max_element(stats.begin(), stats.end()); diff --git a/gtsam_unstable/discrete/examples/schedulingQuals13.cpp b/gtsam_unstable/discrete/examples/schedulingQuals13.cpp index 5548e4300..35217942b 100644 --- a/gtsam_unstable/discrete/examples/schedulingQuals13.cpp +++ b/gtsam_unstable/discrete/examples/schedulingQuals13.cpp @@ -208,7 +208,7 @@ void solveStaged(size_t addMutex = 2) { gttoc_(eliminate); // find root node - DiscreteConditional::shared_ptr root = *(chordal->rbegin()); + DiscreteConditional::shared_ptr root = *(chordal->end()-1); if (debug) root->print(""/*scheduler.studentName(s)*/); @@ -262,7 +262,7 @@ void sampleSolutions() { vector stats(nrFaculty, 0); vector samples; for (size_t i = 0; i < NRSTUDENTS; i++) { - samples.push_back(sample(*samplers[i])); + samples.push_back(samplers[i]->sample()); schedulers[i].accumulateStats(samples[i], stats); } size_t max = *max_element(stats.begin(), stats.end());