MCPcopy Create free account
hub / github.com/NikolausDemmel/rootba / compute_cost_decrease

Function compute_cost_decrease

src/rootba/solver/bal_bundle_adjustment.cpp:158–171  ·  view source on GitHub ↗

compute actual cost difference for deciding if LM step was successful; this will be compared to model cost change

Source from the content-addressed store, hash-verified

156// compute actual cost difference for deciding if LM step was successful; this
157// will be compared to model cost change
158double compute_cost_decrease(
159 const ResidualInfo& ri_before, const ResidualInfo& ri_after,
160 const SolverOptions::OptimizedCost& optimized_cost) {
161 switch (optimized_cost) {
162 case SolverOptions::OptimizedCost::ERROR:
163 return ri_before.all.error - ri_after.all.error;
164 case SolverOptions::OptimizedCost::ERROR_VALID:
165 return ri_before.valid.error - ri_after.valid.error;
166 case SolverOptions::OptimizedCost::ERROR_VALID_AVG:
167 return ri_before.valid.error_avg() - ri_after.valid.error_avg();
168 default:
169 LOG(FATAL) << "unreachable";
170 }
171}
172
173// check termination based on change in cost value
174bool function_tolerance_reached(const IterationSummary& it,

Callers 1

optimize_lm_oursFunction · 0.85

Calls 1

error_avgMethod · 0.80

Tested by

no test coverage detected