Keir Mierle | 8ebb073 | 2012-04-30 23:09:08 -0700 | [diff] [blame] | 1 | // Ceres Solver - A fast non-linear least squares minimizer |
| 2 | // Copyright 2010, 2011, 2012 Google Inc. All rights reserved. |
| 3 | // http://code.google.com/p/ceres-solver/ |
| 4 | // |
| 5 | // Redistribution and use in source and binary forms, with or without |
| 6 | // modification, are permitted provided that the following conditions are met: |
| 7 | // |
| 8 | // * Redistributions of source code must retain the above copyright notice, |
| 9 | // this list of conditions and the following disclaimer. |
| 10 | // * Redistributions in binary form must reproduce the above copyright notice, |
| 11 | // this list of conditions and the following disclaimer in the documentation |
| 12 | // and/or other materials provided with the distribution. |
| 13 | // * Neither the name of Google Inc. nor the names of its contributors may be |
| 14 | // used to endorse or promote products derived from this software without |
| 15 | // specific prior written permission. |
| 16 | // |
| 17 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
| 18 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 19 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
| 20 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
| 21 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
| 22 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
| 23 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
| 24 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
| 25 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
| 26 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
| 27 | // POSSIBILITY OF SUCH DAMAGE. |
| 28 | // |
| 29 | // Author: sameeragarwal@google.com (Sameer Agarwal) |
| 30 | |
Sameer Agarwal | 8140f0f | 2013-03-12 09:45:08 -0700 | [diff] [blame] | 31 | #if !defined(CERES_NO_SUITESPARSE) || !defined(CERES_NO_CXSPARSE) |
| 32 | |
Keir Mierle | 8ebb073 | 2012-04-30 23:09:08 -0700 | [diff] [blame] | 33 | #include "ceres/sparse_normal_cholesky_solver.h" |
| 34 | |
| 35 | #include <algorithm> |
| 36 | #include <cstring> |
| 37 | #include <ctime> |
Sameer Agarwal | b051873 | 2012-05-29 00:27:57 -0700 | [diff] [blame] | 38 | |
Keir Mierle | 8ebb073 | 2012-04-30 23:09:08 -0700 | [diff] [blame] | 39 | #include "ceres/compressed_row_sparse_matrix.h" |
Sergey Sharybin | f258e46 | 2013-08-15 14:50:08 +0600 | [diff] [blame] | 40 | #include "ceres/cxsparse.h" |
Sameer Agarwal | 42a84b8 | 2013-02-01 12:22:53 -0800 | [diff] [blame] | 41 | #include "ceres/internal/eigen.h" |
| 42 | #include "ceres/internal/scoped_ptr.h" |
Keir Mierle | 8ebb073 | 2012-04-30 23:09:08 -0700 | [diff] [blame] | 43 | #include "ceres/linear_solver.h" |
| 44 | #include "ceres/suitesparse.h" |
| 45 | #include "ceres/triplet_sparse_matrix.h" |
Keir Mierle | 8ebb073 | 2012-04-30 23:09:08 -0700 | [diff] [blame] | 46 | #include "ceres/types.h" |
Sameer Agarwal | 42a84b8 | 2013-02-01 12:22:53 -0800 | [diff] [blame] | 47 | #include "ceres/wall_time.h" |
Keir Mierle | 8ebb073 | 2012-04-30 23:09:08 -0700 | [diff] [blame] | 48 | |
| 49 | namespace ceres { |
| 50 | namespace internal { |
| 51 | |
| 52 | SparseNormalCholeskySolver::SparseNormalCholeskySolver( |
| 53 | const LinearSolver::Options& options) |
Sergey Sharybin | f258e46 | 2013-08-15 14:50:08 +0600 | [diff] [blame] | 54 | : factor_(NULL), |
| 55 | cxsparse_factor_(NULL), |
| 56 | options_(options) { |
Sameer Agarwal | b051873 | 2012-05-29 00:27:57 -0700 | [diff] [blame] | 57 | } |
Keir Mierle | 8ebb073 | 2012-04-30 23:09:08 -0700 | [diff] [blame] | 58 | |
Richard Stebbing | 3253078 | 2014-04-26 07:42:23 +0100 | [diff] [blame] | 59 | void SparseNormalCholeskySolver::FreeFactorization() { |
Sameer Agarwal | b051873 | 2012-05-29 00:27:57 -0700 | [diff] [blame] | 60 | #ifndef CERES_NO_SUITESPARSE |
Sameer Agarwal | 7a3c43b | 2012-06-05 23:10:59 -0700 | [diff] [blame] | 61 | if (factor_ != NULL) { |
| 62 | ss_.Free(factor_); |
| 63 | factor_ = NULL; |
Keir Mierle | 8ebb073 | 2012-04-30 23:09:08 -0700 | [diff] [blame] | 64 | } |
Richard Stebbing | 3253078 | 2014-04-26 07:42:23 +0100 | [diff] [blame] | 65 | #endif // CERES_NO_SUITESPARSE |
Petter Strandmark | 1e3cbd9 | 2012-08-29 09:39:56 -0700 | [diff] [blame] | 66 | |
| 67 | #ifndef CERES_NO_CXSPARSE |
| 68 | if (cxsparse_factor_ != NULL) { |
| 69 | cxsparse_.Free(cxsparse_factor_); |
| 70 | cxsparse_factor_ = NULL; |
| 71 | } |
| 72 | #endif // CERES_NO_CXSPARSE |
Keir Mierle | 8ebb073 | 2012-04-30 23:09:08 -0700 | [diff] [blame] | 73 | } |
| 74 | |
Richard Stebbing | 3253078 | 2014-04-26 07:42:23 +0100 | [diff] [blame] | 75 | SparseNormalCholeskySolver::~SparseNormalCholeskySolver() { |
| 76 | FreeFactorization(); |
| 77 | } |
| 78 | |
Keir Mierle | 8ebb073 | 2012-04-30 23:09:08 -0700 | [diff] [blame] | 79 | LinearSolver::Summary SparseNormalCholeskySolver::SolveImpl( |
| 80 | CompressedRowSparseMatrix* A, |
| 81 | const double* b, |
| 82 | const LinearSolver::PerSolveOptions& per_solve_options, |
| 83 | double * x) { |
Sameer Agarwal | b16e118 | 2013-11-25 05:47:43 -0800 | [diff] [blame] | 84 | |
Sameer Agarwal | b051873 | 2012-05-29 00:27:57 -0700 | [diff] [blame] | 85 | const int num_cols = A->num_cols(); |
Sameer Agarwal | f14f6bf | 2013-12-26 09:50:45 -0800 | [diff] [blame] | 86 | VectorRef(x, num_cols).setZero(); |
| 87 | A->LeftMultiply(b, x); |
Sameer Agarwal | b051873 | 2012-05-29 00:27:57 -0700 | [diff] [blame] | 88 | |
| 89 | if (per_solve_options.D != NULL) { |
| 90 | // Temporarily append a diagonal block to the A matrix, but undo |
| 91 | // it before returning the matrix to the user. |
Sameer Agarwal | 2b16b00 | 2013-12-20 15:22:26 -0800 | [diff] [blame] | 92 | scoped_ptr<CompressedRowSparseMatrix> regularizer; |
| 93 | if (A->col_blocks().size() > 0) { |
| 94 | regularizer.reset(CompressedRowSparseMatrix::CreateBlockDiagonalMatrix( |
| 95 | per_solve_options.D, A->col_blocks())); |
| 96 | } else { |
| 97 | regularizer.reset(new CompressedRowSparseMatrix( |
| 98 | per_solve_options.D, num_cols)); |
| 99 | } |
| 100 | A->AppendRows(*regularizer); |
Sameer Agarwal | b051873 | 2012-05-29 00:27:57 -0700 | [diff] [blame] | 101 | } |
| 102 | |
Sameer Agarwal | f14f6bf | 2013-12-26 09:50:45 -0800 | [diff] [blame] | 103 | LinearSolver::Summary summary; |
| 104 | switch (options_.sparse_linear_algebra_library_type) { |
| 105 | case SUITE_SPARSE: |
| 106 | summary = SolveImplUsingSuiteSparse(A, per_solve_options, x); |
| 107 | break; |
| 108 | case CX_SPARSE: |
| 109 | summary = SolveImplUsingCXSparse(A, per_solve_options, x); |
| 110 | break; |
| 111 | default: |
| 112 | LOG(FATAL) << "Unknown sparse linear algebra library : " |
| 113 | << options_.sparse_linear_algebra_library_type; |
| 114 | } |
Sameer Agarwal | b051873 | 2012-05-29 00:27:57 -0700 | [diff] [blame] | 115 | |
Sameer Agarwal | f14f6bf | 2013-12-26 09:50:45 -0800 | [diff] [blame] | 116 | if (per_solve_options.D != NULL) { |
| 117 | A->DeleteRows(num_cols); |
| 118 | } |
| 119 | |
| 120 | return summary; |
| 121 | } |
| 122 | |
| 123 | #ifndef CERES_NO_CXSPARSE |
| 124 | LinearSolver::Summary SparseNormalCholeskySolver::SolveImplUsingCXSparse( |
| 125 | CompressedRowSparseMatrix* A, |
| 126 | const LinearSolver::PerSolveOptions& per_solve_options, |
| 127 | double * rhs_and_solution) { |
| 128 | EventLogger event_logger("SparseNormalCholeskySolver::CXSparse::Solve"); |
| 129 | |
| 130 | LinearSolver::Summary summary; |
| 131 | summary.num_iterations = 1; |
| 132 | summary.termination_type = LINEAR_SOLVER_SUCCESS; |
| 133 | summary.message = "Success."; |
Sameer Agarwal | b051873 | 2012-05-29 00:27:57 -0700 | [diff] [blame] | 134 | |
| 135 | // Compute the normal equations. J'J delta = J'f and solve them |
| 136 | // using a sparse Cholesky factorization. Notice that when compared |
| 137 | // to SuiteSparse we have to explicitly compute the transpose of Jt, |
| 138 | // and then the normal equations before they can be |
| 139 | // factorized. CHOLMOD/SuiteSparse on the other hand can just work |
| 140 | // off of Jt to compute the Cholesky factorization of the normal |
| 141 | // equations. |
Sameer Agarwal | f14f6bf | 2013-12-26 09:50:45 -0800 | [diff] [blame] | 142 | if (outer_product_.get() == NULL) { |
| 143 | outer_product_.reset( |
| 144 | CompressedRowSparseMatrix::CreateOuterProductMatrixAndProgram( |
| 145 | *A, &pattern_)); |
Sameer Agarwal | b051873 | 2012-05-29 00:27:57 -0700 | [diff] [blame] | 146 | } |
Sameer Agarwal | f14f6bf | 2013-12-26 09:50:45 -0800 | [diff] [blame] | 147 | |
| 148 | CompressedRowSparseMatrix::ComputeOuterProduct( |
| 149 | *A, pattern_, outer_product_.get()); |
| 150 | cs_di AtA_view = |
| 151 | cxsparse_.CreateSparseMatrixTransposeView(outer_product_.get()); |
| 152 | cs_di* AtA = &AtA_view; |
| 153 | |
Sameer Agarwal | 42a84b8 | 2013-02-01 12:22:53 -0800 | [diff] [blame] | 154 | event_logger.AddEvent("Setup"); |
| 155 | |
Petter Strandmark | 1e3cbd9 | 2012-08-29 09:39:56 -0700 | [diff] [blame] | 156 | // Compute symbolic factorization if not available. |
Richard Stebbing | 3253078 | 2014-04-26 07:42:23 +0100 | [diff] [blame] | 157 | if (options_.dynamic_sparsity) { |
| 158 | FreeFactorization(); |
| 159 | } |
Petter Strandmark | 1e3cbd9 | 2012-08-29 09:39:56 -0700 | [diff] [blame] | 160 | if (cxsparse_factor_ == NULL) { |
Sameer Agarwal | d5b93bf | 2013-04-26 21:17:49 -0700 | [diff] [blame] | 161 | if (options_.use_postordering) { |
Sameer Agarwal | b16e118 | 2013-11-25 05:47:43 -0800 | [diff] [blame] | 162 | cxsparse_factor_ = cxsparse_.BlockAnalyzeCholesky(AtA, |
| 163 | A->col_blocks(), |
| 164 | A->col_blocks()); |
Sameer Agarwal | d5b93bf | 2013-04-26 21:17:49 -0700 | [diff] [blame] | 165 | } else { |
Richard Stebbing | 3253078 | 2014-04-26 07:42:23 +0100 | [diff] [blame] | 166 | if (options_.dynamic_sparsity) { |
| 167 | cxsparse_factor_ = cxsparse_.AnalyzeCholesky(AtA); |
| 168 | } else { |
| 169 | cxsparse_factor_ = cxsparse_.AnalyzeCholeskyWithNaturalOrdering(AtA); |
| 170 | } |
Sameer Agarwal | d5b93bf | 2013-04-26 21:17:49 -0700 | [diff] [blame] | 171 | } |
Petter Strandmark | 1e3cbd9 | 2012-08-29 09:39:56 -0700 | [diff] [blame] | 172 | } |
Sameer Agarwal | 42a84b8 | 2013-02-01 12:22:53 -0800 | [diff] [blame] | 173 | event_logger.AddEvent("Analysis"); |
| 174 | |
Sameer Agarwal | b16e118 | 2013-11-25 05:47:43 -0800 | [diff] [blame] | 175 | if (cxsparse_factor_ == NULL) { |
Sameer Agarwal | 33e01b9 | 2013-11-27 10:24:03 -0800 | [diff] [blame] | 176 | summary.termination_type = LINEAR_SOLVER_FATAL_ERROR; |
Sameer Agarwal | 89a592f | 2013-11-26 11:35:49 -0800 | [diff] [blame] | 177 | summary.message = |
| 178 | "CXSparse failure. Unable to find symbolic factorization."; |
Sameer Agarwal | f14f6bf | 2013-12-26 09:50:45 -0800 | [diff] [blame] | 179 | } else if (!cxsparse_.SolveCholesky(AtA, cxsparse_factor_, rhs_and_solution)) { |
Sameer Agarwal | 33e01b9 | 2013-11-27 10:24:03 -0800 | [diff] [blame] | 180 | summary.termination_type = LINEAR_SOLVER_FAILURE; |
Sameer Agarwal | b051873 | 2012-05-29 00:27:57 -0700 | [diff] [blame] | 181 | } |
Sameer Agarwal | 42a84b8 | 2013-02-01 12:22:53 -0800 | [diff] [blame] | 182 | event_logger.AddEvent("Solve"); |
Richard Stebbing | 3253078 | 2014-04-26 07:42:23 +0100 | [diff] [blame] | 183 | |
Sameer Agarwal | b051873 | 2012-05-29 00:27:57 -0700 | [diff] [blame] | 184 | return summary; |
| 185 | } |
| 186 | #else |
| 187 | LinearSolver::Summary SparseNormalCholeskySolver::SolveImplUsingCXSparse( |
| 188 | CompressedRowSparseMatrix* A, |
Sameer Agarwal | b051873 | 2012-05-29 00:27:57 -0700 | [diff] [blame] | 189 | const LinearSolver::PerSolveOptions& per_solve_options, |
Sameer Agarwal | f14f6bf | 2013-12-26 09:50:45 -0800 | [diff] [blame] | 190 | double * rhs_and_solution) { |
Sameer Agarwal | b051873 | 2012-05-29 00:27:57 -0700 | [diff] [blame] | 191 | LOG(FATAL) << "No CXSparse support in Ceres."; |
Keir Mierle | efe7ac6 | 2012-06-24 22:25:28 -0700 | [diff] [blame] | 192 | |
| 193 | // Unreachable but MSVC does not know this. |
| 194 | return LinearSolver::Summary(); |
Sameer Agarwal | b051873 | 2012-05-29 00:27:57 -0700 | [diff] [blame] | 195 | } |
| 196 | #endif |
| 197 | |
| 198 | #ifndef CERES_NO_SUITESPARSE |
| 199 | LinearSolver::Summary SparseNormalCholeskySolver::SolveImplUsingSuiteSparse( |
| 200 | CompressedRowSparseMatrix* A, |
Sameer Agarwal | b051873 | 2012-05-29 00:27:57 -0700 | [diff] [blame] | 201 | const LinearSolver::PerSolveOptions& per_solve_options, |
Sameer Agarwal | f14f6bf | 2013-12-26 09:50:45 -0800 | [diff] [blame] | 202 | double * rhs_and_solution) { |
Sameer Agarwal | 42a84b8 | 2013-02-01 12:22:53 -0800 | [diff] [blame] | 203 | EventLogger event_logger("SparseNormalCholeskySolver::SuiteSparse::Solve"); |
Sameer Agarwal | b16e118 | 2013-11-25 05:47:43 -0800 | [diff] [blame] | 204 | LinearSolver::Summary summary; |
Sameer Agarwal | 33e01b9 | 2013-11-27 10:24:03 -0800 | [diff] [blame] | 205 | summary.termination_type = LINEAR_SOLVER_SUCCESS; |
Sameer Agarwal | b16e118 | 2013-11-25 05:47:43 -0800 | [diff] [blame] | 206 | summary.num_iterations = 1; |
Sameer Agarwal | 89a592f | 2013-11-26 11:35:49 -0800 | [diff] [blame] | 207 | summary.message = "Success."; |
Keir Mierle | 8ebb073 | 2012-04-30 23:09:08 -0700 | [diff] [blame] | 208 | |
Sameer Agarwal | 42a84b8 | 2013-02-01 12:22:53 -0800 | [diff] [blame] | 209 | const int num_cols = A->num_cols(); |
Sameer Agarwal | 2560b17 | 2013-04-19 08:19:11 -0700 | [diff] [blame] | 210 | cholmod_sparse lhs = ss_.CreateSparseMatrixTransposeView(A); |
Sameer Agarwal | 42a84b8 | 2013-02-01 12:22:53 -0800 | [diff] [blame] | 211 | event_logger.AddEvent("Setup"); |
Keir Mierle | 8ebb073 | 2012-04-30 23:09:08 -0700 | [diff] [blame] | 212 | |
Richard Stebbing | 3253078 | 2014-04-26 07:42:23 +0100 | [diff] [blame] | 213 | if (options_.dynamic_sparsity) { |
| 214 | FreeFactorization(); |
| 215 | } |
Sameer Agarwal | 7a3c43b | 2012-06-05 23:10:59 -0700 | [diff] [blame] | 216 | if (factor_ == NULL) { |
Sameer Agarwal | 9189f4e | 2013-04-19 17:09:49 -0700 | [diff] [blame] | 217 | if (options_.use_postordering) { |
Sameer Agarwal | 79bde35 | 2013-11-21 21:33:51 -0800 | [diff] [blame] | 218 | factor_ = ss_.BlockAnalyzeCholesky(&lhs, |
| 219 | A->col_blocks(), |
Sameer Agarwal | b16e118 | 2013-11-25 05:47:43 -0800 | [diff] [blame] | 220 | A->row_blocks(), |
Sameer Agarwal | 89a592f | 2013-11-26 11:35:49 -0800 | [diff] [blame] | 221 | &summary.message); |
Sameer Agarwal | 7a3c43b | 2012-06-05 23:10:59 -0700 | [diff] [blame] | 222 | } else { |
Richard Stebbing | 3253078 | 2014-04-26 07:42:23 +0100 | [diff] [blame] | 223 | if (options_.dynamic_sparsity) { |
| 224 | factor_ = ss_.AnalyzeCholesky(&lhs, &summary.message); |
| 225 | } else { |
| 226 | factor_ = ss_.AnalyzeCholeskyWithNaturalOrdering(&lhs, &summary.message); |
| 227 | } |
Sameer Agarwal | 7a3c43b | 2012-06-05 23:10:59 -0700 | [diff] [blame] | 228 | } |
Sameer Agarwal | 7a3c43b | 2012-06-05 23:10:59 -0700 | [diff] [blame] | 229 | } |
Sameer Agarwal | 42a84b8 | 2013-02-01 12:22:53 -0800 | [diff] [blame] | 230 | event_logger.AddEvent("Analysis"); |
Keir Mierle | 8ebb073 | 2012-04-30 23:09:08 -0700 | [diff] [blame] | 231 | |
Sameer Agarwal | 79bde35 | 2013-11-21 21:33:51 -0800 | [diff] [blame] | 232 | if (factor_ == NULL) { |
Sameer Agarwal | 33e01b9 | 2013-11-27 10:24:03 -0800 | [diff] [blame] | 233 | summary.termination_type = LINEAR_SOLVER_FATAL_ERROR; |
Sameer Agarwal | 79bde35 | 2013-11-21 21:33:51 -0800 | [diff] [blame] | 234 | return summary; |
| 235 | } |
| 236 | |
Sameer Agarwal | 89a592f | 2013-11-26 11:35:49 -0800 | [diff] [blame] | 237 | summary.termination_type = ss_.Cholesky(&lhs, factor_, &summary.message); |
Sameer Agarwal | 33e01b9 | 2013-11-27 10:24:03 -0800 | [diff] [blame] | 238 | if (summary.termination_type != LINEAR_SOLVER_SUCCESS) { |
Sameer Agarwal | 79bde35 | 2013-11-21 21:33:51 -0800 | [diff] [blame] | 239 | return summary; |
| 240 | } |
| 241 | |
Sameer Agarwal | f14f6bf | 2013-12-26 09:50:45 -0800 | [diff] [blame] | 242 | cholmod_dense* rhs = ss_.CreateDenseVector(rhs_and_solution, num_cols, num_cols); |
| 243 | cholmod_dense* solution = ss_.Solve(factor_, rhs, &summary.message); |
Sameer Agarwal | 42a84b8 | 2013-02-01 12:22:53 -0800 | [diff] [blame] | 244 | event_logger.AddEvent("Solve"); |
Keir Mierle | 8ebb073 | 2012-04-30 23:09:08 -0700 | [diff] [blame] | 245 | |
| 246 | ss_.Free(rhs); |
Sameer Agarwal | f14f6bf | 2013-12-26 09:50:45 -0800 | [diff] [blame] | 247 | if (solution != NULL) { |
| 248 | memcpy(rhs_and_solution, solution->x, num_cols * sizeof(*rhs_and_solution)); |
| 249 | ss_.Free(solution); |
Sameer Agarwal | b16e118 | 2013-11-25 05:47:43 -0800 | [diff] [blame] | 250 | } else { |
Sameer Agarwal | 33e01b9 | 2013-11-27 10:24:03 -0800 | [diff] [blame] | 251 | summary.termination_type = LINEAR_SOLVER_FAILURE; |
Keir Mierle | 8ebb073 | 2012-04-30 23:09:08 -0700 | [diff] [blame] | 252 | } |
| 253 | |
Sameer Agarwal | 42a84b8 | 2013-02-01 12:22:53 -0800 | [diff] [blame] | 254 | event_logger.AddEvent("Teardown"); |
Keir Mierle | 8ebb073 | 2012-04-30 23:09:08 -0700 | [diff] [blame] | 255 | return summary; |
| 256 | } |
Sameer Agarwal | b051873 | 2012-05-29 00:27:57 -0700 | [diff] [blame] | 257 | #else |
| 258 | LinearSolver::Summary SparseNormalCholeskySolver::SolveImplUsingSuiteSparse( |
| 259 | CompressedRowSparseMatrix* A, |
Sameer Agarwal | b051873 | 2012-05-29 00:27:57 -0700 | [diff] [blame] | 260 | const LinearSolver::PerSolveOptions& per_solve_options, |
Sameer Agarwal | f14f6bf | 2013-12-26 09:50:45 -0800 | [diff] [blame] | 261 | double * rhs_and_solution) { |
Sameer Agarwal | b051873 | 2012-05-29 00:27:57 -0700 | [diff] [blame] | 262 | LOG(FATAL) << "No SuiteSparse support in Ceres."; |
Keir Mierle | efe7ac6 | 2012-06-24 22:25:28 -0700 | [diff] [blame] | 263 | |
| 264 | // Unreachable but MSVC does not know this. |
| 265 | return LinearSolver::Summary(); |
Sameer Agarwal | b051873 | 2012-05-29 00:27:57 -0700 | [diff] [blame] | 266 | } |
| 267 | #endif |
Keir Mierle | 8ebb073 | 2012-04-30 23:09:08 -0700 | [diff] [blame] | 268 | |
| 269 | } // namespace internal |
| 270 | } // namespace ceres |
Sameer Agarwal | 8140f0f | 2013-03-12 09:45:08 -0700 | [diff] [blame] | 271 | |
| 272 | #endif // !defined(CERES_NO_SUITESPARSE) || !defined(CERES_NO_CXSPARSE) |