Add a general sparse iterative solver: CGNR This adds a new LinearOperator which implements symmetric products of a matrix, and a new CGNR solver to leverage CG to directly solve the normal equations. This also includes a block diagonal preconditioner. In experiments on problem-16, the non-preconditioned version is about 1/5 the speed of SPARSE_SCHUR, and the preconditioned version using block cholesky is about 20% slower than SPARSE_SCHUR.
diff --git a/internal/ceres/linear_solver.cc b/internal/ceres/linear_solver.cc index e3912eb..fd40252 100644 --- a/internal/ceres/linear_solver.cc +++ b/internal/ceres/linear_solver.cc
@@ -31,7 +31,7 @@ #include "ceres/linear_solver.h" #include <glog/logging.h> -#include "ceres/conjugate_gradients_solver.h" +#include "ceres/cgnr_solver.h" #include "ceres/dense_qr_solver.h" #include "ceres/iterative_schur_complement_solver.h" #include "ceres/schur_complement_solver.h" @@ -47,7 +47,7 @@ LinearSolver* LinearSolver::Create(const LinearSolver::Options& options) { switch (options.type) { case CONJUGATE_GRADIENTS: - return new ConjugateGradientsSolver(options); + return new CgnrSolver(options); case SPARSE_NORMAL_CHOLESKY: #ifndef CERES_NO_SUITESPARSE