Add a dense Cholesky factorization based linear solver.
For problems with a small number of variables, but a large
number of residuals, it is sometimes beneficial to use the
Cholesky factorization on the normal equations, instead of
the dense QR factorization of the Jacobian, even though it
is numerically the better thing to do.
Change-Id: I3506b006195754018deec964e6e190b7e8c9ac8f
diff --git a/internal/ceres/unsymmetric_linear_solver_test.cc b/internal/ceres/unsymmetric_linear_solver_test.cc
index f13c5a4..0b0d593 100644
--- a/internal/ceres/unsymmetric_linear_solver_test.cc
+++ b/internal/ceres/unsymmetric_linear_solver_test.cc
@@ -73,7 +73,8 @@
scoped_ptr<SparseMatrix> transformed_A;
- if (linear_solver_type == DENSE_QR) {
+ if (linear_solver_type == DENSE_QR ||
+ linear_solver_type == DENSE_NORMAL_CHOLESKY) {
transformed_A.reset(new DenseSparseMatrix(*A_));
} else if (linear_solver_type == SPARSE_NORMAL_CHOLESKY) {
transformed_A.reset(new CompressedRowSparseMatrix(*A_));
@@ -118,6 +119,10 @@
TestSolver(DENSE_QR, SUITE_SPARSE);
}
+TEST_F(UnsymmetricLinearSolverTest, DenseNormalCholesky) {
+ TestSolver(DENSE_NORMAL_CHOLESKY, SUITE_SPARSE);
+}
+
#ifndef CERES_NO_SUITESPARSE
TEST_F(UnsymmetricLinearSolverTest, SparseNormalCholeskyUsingSuiteSparse) {
TestSolver(SPARSE_NORMAL_CHOLESKY, SUITE_SPARSE);