Fix tests broken by the CGNR change.
diff --git a/internal/ceres/solver_impl_test.cc b/internal/ceres/solver_impl_test.cc index 6f22357..99733a2 100644 --- a/internal/ceres/solver_impl_test.cc +++ b/internal/ceres/solver_impl_test.cc
@@ -37,7 +37,6 @@ #include "ceres/solver_impl.h" #include "ceres/sized_cost_function.h" - namespace ceres { namespace internal { @@ -363,14 +362,6 @@ EXPECT_EQ(parameter_blocks[2]->user_state(), &y); } - -TEST(SolverImpl, CreateLinearSolverConjugateGradients) { - Solver::Options options; - options.linear_solver_type = CONJUGATE_GRADIENTS; - string error; - EXPECT_FALSE(SolverImpl::CreateLinearSolver(&options, &error)); -} - #ifdef CERES_NO_SUITESPARSE TEST(SolverImpl, CreateLinearSolverNoSuiteSparse) { Solver::Options options;
diff --git a/internal/ceres/symmetric_linear_solver_test.cc b/internal/ceres/symmetric_linear_solver_test.cc index 365c9c0..8a7ce68 100644 --- a/internal/ceres/symmetric_linear_solver_test.cc +++ b/internal/ceres/symmetric_linear_solver_test.cc
@@ -36,6 +36,7 @@ // more badly conditioned problem. #include "gtest/gtest.h" +#include "ceres/conjugate_gradients_solver.h" #include "ceres/linear_solver.h" #include "ceres/triplet_sparse_matrix.h" #include "ceres/internal/eigen.h" @@ -63,14 +64,13 @@ LinearSolver::Options options; options.max_num_iterations = 10; options.constant_sparsity = false; - options.type = CONJUGATE_GRADIENTS; LinearSolver::PerSolveOptions per_solve_options; per_solve_options.r_tolerance = 1e-9; - scoped_ptr<LinearSolver> solver(LinearSolver::Create(options)); + ConjugateGradientsSolver solver(options); LinearSolver::Summary summary = - solver->Solve(A.get(), b.data(), per_solve_options, x.data()); + solver.Solve(A.get(), b.data(), per_solve_options, x.data()); EXPECT_EQ(summary.termination_type, TOLERANCE); ASSERT_EQ(summary.num_iterations, 1); @@ -121,15 +121,13 @@ LinearSolver::Options options; options.max_num_iterations = 10; - options.constant_sparsity = false; - options.type = CONJUGATE_GRADIENTS; LinearSolver::PerSolveOptions per_solve_options; per_solve_options.r_tolerance = 1e-9; - scoped_ptr<LinearSolver> solver(LinearSolver::Create(options)); + ConjugateGradientsSolver solver(options); LinearSolver::Summary summary = - solver->Solve(A.get(), b.data(), per_solve_options, x.data()); + solver.Solve(A.get(), b.data(), per_solve_options, x.data()); EXPECT_EQ(summary.termination_type, TOLERANCE);