diff --git a/gtsam/nonlinear/DoglegOptimizerImpl.h b/gtsam/nonlinear/DoglegOptimizerImpl.h index 999147156..ed74066d2 100644 --- a/gtsam/nonlinear/DoglegOptimizerImpl.h +++ b/gtsam/nonlinear/DoglegOptimizerImpl.h @@ -191,7 +191,6 @@ typename DoglegOptimizerImpl::IterationResult DoglegOptimizerImpl::Iterate( if(verbose) cout << "rho = " << rho << endl; if(rho >= 0.75) { - tic(7, "Rho >= 0.75"); // M agrees very well with f, so try to increase lambda const double dx_d_norm = result.dx_d.vector().norm(); const double newDelta = std::max(Delta, 3.0 * dx_d_norm); // Compute new Delta @@ -209,14 +208,12 @@ typename DoglegOptimizerImpl::IterationResult DoglegOptimizerImpl::Iterate( assert(false); } Delta = newDelta; // Update Delta from new Delta - toc(7, "Rho >= 0.75"); } else if(0.75 > rho && rho >= 0.25) { // M agrees so-so with f, keep the same Delta stay = false; } else if(0.25 > rho && rho >= 0.0) { - tic(8, "0.25 > Rho >= 0.75"); // M does not agree well with f, decrease Delta until it does double newDelta; if(Delta > 1e-5) @@ -232,11 +229,8 @@ typename DoglegOptimizerImpl::IterationResult DoglegOptimizerImpl::Iterate( assert(false); } Delta = newDelta; // Update Delta from new Delta - toc(8, "0.25 > Rho >= 0.75"); - } - else { - tic(9, "Rho < 0"); + } else { // f actually increased, so keep decreasing Delta until f does not decrease assert(0.0 > rho); if(Delta > 1e-5) { @@ -247,7 +241,6 @@ typename DoglegOptimizerImpl::IterationResult DoglegOptimizerImpl::Iterate( if(verbose) cout << "Warning: Dog leg stopping because cannot decrease error with minimum Delta" << endl; stay = false; } - toc(9, "Rho < 0"); } } diff --git a/gtsam/nonlinear/ISAM2.cpp b/gtsam/nonlinear/ISAM2.cpp index b9a95b51a..eb8ee9898 100644 --- a/gtsam/nonlinear/ISAM2.cpp +++ b/gtsam/nonlinear/ISAM2.cpp @@ -591,9 +591,16 @@ void ISAM2::updateDelta(bool forceFullSolve) const { Values ISAM2::calculateEstimate() const { // We use ExpmapMasked here instead of regular expmap because the former // handles Permuted + tic(1, "Copy Values"); Values ret(theta_); + toc(1, "Copy Values"); + tic(2, "getDelta"); + const Permuted& delta(getDelta()); + toc(2, "getDelta"); + tic(3, "Expmap"); vector mask(ordering_.nVars(), true); - Impl::ExpmapMasked(ret, getDelta(), ordering_, mask); + Impl::ExpmapMasked(ret, delta, ordering_, mask); + toc(3, "Expmap"); return ret; }