diff --git a/gtsam/base/cholesky.cpp b/gtsam/base/cholesky.cpp index 9585d024b..80c983323 100644 --- a/gtsam/base/cholesky.cpp +++ b/gtsam/base/cholesky.cpp @@ -225,11 +225,12 @@ void choleskyPartial(MatrixColMajor& ABC, size_t nFrontal) { } toc(1, "dpotrf"); } else { + tic(1, "choleskyCareful"); bool fullRank = choleskyCareful(ABC, nFrontal).second; if(!fullRank) throw invalid_argument("Rank-deficient"); + toc(1, "choleskyCareful"); } - toc(1, "dpotrf"); #ifndef NDEBUG // Check for non-finite values diff --git a/gtsam/base/timing.h b/gtsam/base/timing.h index 28bfce9c8..c72e51c3b 100644 --- a/gtsam/base/timing.h +++ b/gtsam/base/timing.h @@ -188,7 +188,13 @@ inline void toc_(size_t id) { } inline void toc_(size_t id, const std::string& label) { - assert(label == timingCurrent.lock()->label_); +#ifndef NDEBUG + if(label != timingCurrent.lock()->label_) { + std::cerr << "gtsam timing: toc called with id=" << id << ", label=\"" << label << "\", but expecting \"" << timingCurrent.lock()->label_ << "\"" << std::endl; + timingRoot->print(); + exit(1); + } +#endif toc_(id); } diff --git a/gtsam/inference/JunctionTree-inl.h b/gtsam/inference/JunctionTree-inl.h index 517691ee7..4ce33da41 100644 --- a/gtsam/inference/JunctionTree-inl.h +++ b/gtsam/inference/JunctionTree-inl.h @@ -38,6 +38,7 @@ namespace gtsam { /* ************************************************************************* */ template void JunctionTree::construct(const FG& fg, const VariableIndex& variableIndex) { + tic(1, "JT Constructor"); tic(1, "JT symbolic ET"); const typename EliminationTree::shared_ptr symETree(EliminationTree::Create(fg, variableIndex)); toc(1, "JT symbolic ET"); @@ -52,6 +53,7 @@ namespace gtsam { tic(4, "distributeFactors"); this->root_ = distributeFactors(fg, sbt.root()); toc(4, "distributeFactors"); + toc(1, "JT Constructor"); } /* ************************************************************************* */ @@ -191,9 +193,11 @@ namespace gtsam { template typename JunctionTree::BayesTree::sharedClique JunctionTree::eliminate(bool cache) const { if(this->root()) { + tic(2,"JT eliminate"); pair ret = this->eliminateOneClique(this->root(), cache); if (ret.second->size() != 0) throw runtime_error("JuntionTree::eliminate: elimination failed because of factors left over!"); + toc(2,"JT eliminate"); return ret.first; } else return typename BayesTree::sharedClique();