Improved timing statements
parent
8bec3821df
commit
ea2f0e10e1
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -38,6 +38,7 @@ namespace gtsam {
|
|||
/* ************************************************************************* */
|
||||
template <class FG>
|
||||
void JunctionTree<FG>::construct(const FG& fg, const VariableIndex& variableIndex) {
|
||||
tic(1, "JT Constructor");
|
||||
tic(1, "JT symbolic ET");
|
||||
const typename EliminationTree<IndexFactor>::shared_ptr symETree(EliminationTree<IndexFactor>::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 <class FG>
|
||||
typename JunctionTree<FG>::BayesTree::sharedClique JunctionTree<FG>::eliminate(bool cache) const {
|
||||
if(this->root()) {
|
||||
tic(2,"JT eliminate");
|
||||
pair<typename BayesTree::sharedClique, typename FG::sharedFactor> 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();
|
||||
|
|
Loading…
Reference in New Issue