BatchFixedLagSmoother: add ability to limit warning debug prints

This mimics the behavior of `LevenbergMarquardtOptimizer.cpp`.
release/4.3a0
Anthony Cowley 2023-01-09 12:30:44 -05:00
parent 00dc32df0d
commit 0e6676c082
1 changed files with 4 additions and 1 deletions

View File

@ -282,9 +282,12 @@ FixedLagSmoother::Result BatchFixedLagSmoother::optimize() {
// Reject this change
if (lambda >= lambdaUpperBound) {
// The maximum lambda has been used. Print a warning and end the search.
cout
if(parameters_.verbosity >= NonlinearOptimizerParams::TERMINATION
|| parameters_.verbosityLM == LevenbergMarquardtParams::SUMMARY) {
cout
<< "Warning: Levenberg-Marquardt giving up because cannot decrease error with maximum lambda"
<< endl;
}
break;
} else {
// Increase lambda and continue searching