Fix evaluation of initial cost and corresponding test
Commit f102a68e411d11b4864e17b69a2d781e9c2692ad seems to have introduced
a bug in both solver_impl.cc and solver_impl_test.cc
solver_impl_test showed 3 errors, where two were due to ceres NOT
failing when the test expected that, and one was due to the initial cost
being wrong (-1 instead of 0.5)
Ceres now does not attempt to evaluate the initial cost if
options.return_initial_xxx is not set. It therefore did not fail in
the tests.
It also seems that the CERES_EVALUATE macro erroneously always sets
final_cost, even when called with 'initial' as argument.
Change-Id: Ia3c3eeb476e7023a3f80b201124010d6c67e9824
2 files changed