fixed iteration counter

release/4.3a0
Luca 2014-02-26 14:36:51 -05:00
parent a90c5797e0
commit e127f07336
1 changed files with 3 additions and 2 deletions

View File

@ -165,7 +165,6 @@ void LevenbergMarquardtOptimizer::iterate() {
// Keep increasing lambda until we make make progress // Keep increasing lambda until we make make progress
while (true) { while (true) {
++state_.totalNumberInnerIterations;
if (lmVerbosity >= LevenbergMarquardtParams::TRYLAMBDA) cout << "trying lambda = " << state_.lambda << endl; if (lmVerbosity >= LevenbergMarquardtParams::TRYLAMBDA) cout << "trying lambda = " << state_.lambda << endl;
@ -180,10 +179,12 @@ void LevenbergMarquardtOptimizer::iterate() {
boost::posix_time::ptime currentTime = boost::posix_time::microsec_clock::universal_time(); boost::posix_time::ptime currentTime = boost::posix_time::microsec_clock::universal_time();
os << state_.iterations << "," << 1e-6 * (currentTime - state_.startTime).total_microseconds() << "," os << state_.totalNumberInnerIterations << "," << 1e-6 * (currentTime - state_.startTime).total_microseconds() << ","
<< state_.error << "," << state_.lambda << endl; << state_.error << "," << state_.lambda << endl;
} }
++state_.totalNumberInnerIterations;
// Solve Damped Gaussian Factor Graph // Solve Damped Gaussian Factor Graph
const VectorValues delta = solve(dampedSystem, state_.values, params_); const VectorValues delta = solve(dampedSystem, state_.values, params_);