mirror of
https://github.com/ceres-solver/ceres-solver.git
synced 2026-08-29 16:40:38 +08:00
310a252fb6
Previously it could be the case that a residual block could return a residual whose squared norm overflows and generates an infinity which we did not detect. This would then lead to the trust region minimizer incorrectly terminating indicating convergence while generating a cost delta of NaN. This change adds a check for that and also does two minor cosmetic changes. 1. Reduce the level of nesting in program_evaluator.h by adding an early return. 2. The error message when IterationZero fails now says that the Initial residual and Jacobian failed, to indicate that the optimizer had no chance to do any work. Fixes https://github.com/ceres-solver/ceres-solver/issues/988 Thanks to @Ashray-g for reporting this. Change-Id: I52ae7627a66f637135209dbb2e42935b52c8bc77