mirror of
https://github.com/ceres-solver/ceres-solver.git
synced 2026-08-29 16:40:38 +08:00
Fix tiny_solver_test
Verify that the final cost is small enough instead of the norm of the residual vector. Change-Id: I9591d97d3e8f1c71067d99270967f1e593889843
This commit is contained in:
@@ -146,13 +146,11 @@ void TestHelper(const Function& f, const Vector& x0) {
|
||||
Vector x = x0;
|
||||
Vec2 residuals;
|
||||
f(x.data(), residuals.data(), NULL);
|
||||
EXPECT_GT(residuals.norm(), 1e-10);
|
||||
EXPECT_GT(residuals.squaredNorm() / 2.0, 1e-10);
|
||||
|
||||
TinySolver<Function> solver;
|
||||
solver.Solve(f, &x);
|
||||
|
||||
f(x.data(), residuals.data(), NULL);
|
||||
EXPECT_NEAR(0.0, residuals.norm(), 1e-10);
|
||||
EXPECT_NEAR(0.0, solver.summary.final_cost, 1e-10);
|
||||
}
|
||||
|
||||
// A test case for when the cost function is statically sized.
|
||||
|
||||
Reference in New Issue
Block a user