Removed spurious printing when increasing lambda due to negative matrix

release/4.3a0
Richard Roberts 2011-09-09 01:56:41 +00:00
parent 43bc372a83
commit fd4c4fda5d
2 changed files with 6 additions and 3 deletions

View File

@ -168,8 +168,10 @@ Eigen::LDLT<Matrix>::TranspositionType ldlPartial(Matrix& ABC, size_t nFrontal)
ldlt.compute(ABC.block(0,0,nFrontal,nFrontal).selfadjointView<Eigen::Upper>());
if(ldlt.vectorD().unaryExpr(boost::bind(less<double>(), _1, 0.0)).any()) {
gtsam::print(Matrix(ldlt.matrixU()), "U: ");
gtsam::print(Vector(ldlt.vectorD()), "D: ");
if(debug) {
gtsam::print(Matrix(ldlt.matrixU()), "U: ");
gtsam::print(Vector(ldlt.vectorD()), "D: ");
}
throw NegativeMatrixException();
}

View File

@ -203,7 +203,8 @@ namespace gtsam {
}
}
} catch(const NegativeMatrixException& e) {
cout << "Negative matrix, increasing lambda" << endl;
if(verbosity >= Parameters::LAMBDA)
cout << "Negative matrix, increasing lambda" << endl;
// Either we're not cautious, or the same lambda was worse than the current error.
// The more adventurous lambda was worse too, so make lambda more conservative
// and keep the same values.