Numerically robust computation of model_cost_change.
Change-Id: I421df17bab3bfdf782d95285cf352ed37675d835
diff --git a/examples/bundle_adjuster.cc b/examples/bundle_adjuster.cc
index e5f9100..3e13c86 100644
--- a/examples/bundle_adjuster.cc
+++ b/examples/bundle_adjuster.cc
@@ -270,8 +270,8 @@
Solver::Options options;
SetSolverOptionsFromFlags(&bal_problem, &options);
options.solver_log = FLAGS_solver_log;
- options.gradient_tolerance *= 1e-3;
-
+ options.gradient_tolerance = 1e-12;
+ options.function_tolerance = 1e-12;
Solver::Summary summary;
Solve(options, &problem, &summary);
std::cout << summary.FullReport() << "\n";
diff --git a/examples/nist.cc b/examples/nist.cc
index 0f5951f..4fce3e7 100644
--- a/examples/nist.cc
+++ b/examples/nist.cc
@@ -374,16 +374,18 @@
-std::log10(fabs(summary.final_cost - certified_cost) / certified_cost);
}
+ std::cerr << "start " << start + 1 << " " ;
if (num_matching_digits <= kMinNumMatchingDigits) {
- std::cerr << "start " << start + 1 << " " ;
std::cerr << "FAILURE";
- std::cerr << " summary: "
- << summary.BriefReport()
- << " Certified cost: " << certified_cost
- << std::endl;
} else {
+ std::cerr << "SUCCESS";
++num_success;
}
+ std::cerr << " summary: "
+ << summary.BriefReport()
+ << " Certified cost: " << certified_cost
+ << std::endl;
+
}
return num_success;