diff --git a/examples/UGM_chain.cpp b/examples/UGM_chain.cpp index b029379f2..58e4c14dc 100644 --- a/examples/UGM_chain.cpp +++ b/examples/UGM_chain.cpp @@ -79,7 +79,7 @@ int main(int argc, char** argv) { cout << "\nComputing Node Marginals ..(Sequential Elimination)" << endl; - tic_(1, "Sequential"); + tic_(Sequential); for (vector::iterator itr = nodes.begin(); itr != nodes.end(); ++itr) { //Compute the marginal @@ -89,14 +89,14 @@ int main(int argc, char** argv) { cout << "Node#" << setw(4) << itr->first << " : "; print(margProbs); } - toc_(1, "Sequential"); + toc_(Sequential); // Here we'll make use of DiscreteMarginals class, which makes use of // bayes-tree based shortcut evaluation of marginals DiscreteMarginals marginals(graph); cout << "\nComputing Node Marginals ..(BayesTree based)" << endl; - tic_(2, "Multifrontal"); + tic_(Multifrontal); for (vector::iterator itr = nodes.begin(); itr != nodes.end(); ++itr) { //Compute the marginal @@ -106,7 +106,7 @@ int main(int argc, char** argv) { cout << "Node#" << setw(4) << itr->first << " : "; print(margProbs); } - toc_(2, "Multifrontal"); + toc_(Multifrontal); tictoc_print_(); return 0; diff --git a/gtsam/base/tests/timeVirtual2.cpp b/gtsam/base/tests/timeVirtual2.cpp index 56190b91e..c36ed9979 100644 --- a/gtsam/base/tests/timeVirtual2.cpp +++ b/gtsam/base/tests/timeVirtual2.cpp @@ -82,51 +82,55 @@ int main(int argc, char *argv[]) { int n = 10000000; + { VirtualBase** b = new VirtualBase*[n]; - tic_(0, "Virtual"); - tic_(0, "new"); + tic_(Virtual); + tic_(new); for(int i=0; imethod(); - toc_(1, "method"); - tic_(2, "dynamic_cast"); + toc_(method); + tic_(dynamic_cast); for(int i=0; i(b[i]); if(d) d->method(); } - toc_(2, "dynamic_cast"); - tic_(3, "delete"); + toc_(dynamic_cast); + tic_(delete); for(int i=0; imethod(); - toc_(1, "method"); - tic_(2, "dynamic_cast (does nothing)"); + toc_(method); + tic_(dynamic_cast (does nothing)); for(int i=0; imethod(); - toc_(2, "dynamic_cast (does nothing)"); - tic_(3, "delete"); + toc_(dynamic_cast (does nothing)); + tic_(delete); for(int i=0; irbegin()); diff --git a/gtsam_unstable/discrete/examples/schedulingQuals12.cpp b/gtsam_unstable/discrete/examples/schedulingQuals12.cpp index 7007bb665..af62e04a0 100644 --- a/gtsam_unstable/discrete/examples/schedulingQuals12.cpp +++ b/gtsam_unstable/discrete/examples/schedulingQuals12.cpp @@ -178,9 +178,9 @@ void solveStaged(size_t addMutex = 2) { scheduler.buildGraph(addMutex); // Do EXACT INFERENCE - tic_(3,"eliminate"); + tic_(eliminate); DiscreteBayesNet::shared_ptr chordal = scheduler.eliminate(); - toc_(3,"eliminate"); + toc_(eliminate); // find root node DiscreteConditional::shared_ptr root = *(chordal->rbegin()); diff --git a/tests/timeIncremental.cpp b/tests/timeIncremental.cpp index 1c2beb8bc..f1a3c5e0f 100644 --- a/tests/timeIncremental.cpp +++ b/tests/timeIncremental.cpp @@ -46,11 +46,11 @@ int main(int argc, char *argv[]) { cout << "Loading data..." << endl; - tic_(1, "Find datafile (script only)"); + tic_(Find_datafile); string datasetFile = findExampleDataFile("w10000-odom"); std::pair data = load2D(datasetFile); - toc_(1, "Find datafile (script only)"); + toc_(Find_datafile); NonlinearFactorGraph measurements = *data.first; Values initial = *data.second; @@ -66,7 +66,7 @@ int main(int argc, char *argv[]) { NonlinearFactorGraph newFactors; // Collect measurements and new variables for the current step - tic_(2, "Collect measurements (script only)"); + tic_(Collect_measurements); if(step == 1) { // cout << "Initializing " << 0 << endl; newVariables.insert(0, Pose()); @@ -114,19 +114,19 @@ int main(int argc, char *argv[]) { } ++ nextMeasurement; } - toc_(2, "Collect measurements (script only)"); + toc_(Collect_measurements); // Update iSAM2 - tic_(3, "Update ISAM2"); + tic_(Update_ISAM2); isam2.update(newFactors, newVariables); - toc_(3, "Update ISAM2"); + toc_(Update_ISAM2); if(step % 100 == 0) { - tic_(4, "chi2 (script only)"); + tic_(chi2); Values estimate(isam2.calculateEstimate()); double chi2 = chi2_red(isam2.getFactorsUnsafe(), estimate); cout << "chi2 = " << chi2 << endl; - toc_(4, "chi2 (script only)"); + toc_(chi2); } tictoc_finishedIteration_(); @@ -141,9 +141,9 @@ int main(int argc, char *argv[]) { Marginals marginals(isam2.getFactorsUnsafe(), isam2.calculateEstimate()); int i=0; BOOST_FOREACH(Key key, initial.keys()) { - tic_(5, "marginalInformation"); + tic_(marginalInformation); Matrix info = marginals.marginalInformation(key); - toc_(5, "marginalInformation"); + toc_(marginalInformation); tictoc_finishedIteration_(); if(i % 1000 == 0) tictoc_print_();