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 | |
| 59 | SparseNormalCholeskySolver::~SparseNormalCholeskySolver() { |
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 | } |
Sameer Agarwal | b051873 | 2012-05-29 00:27:57 -0700 | [diff] [blame] | 65 | #endif |
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 | |
| 75 | LinearSolver::Summary SparseNormalCholeskySolver::SolveImpl( |
| 76 | CompressedRowSparseMatrix* A, |
| 77 | const double* b, |
| 78 | const LinearSolver::PerSolveOptions& per_solve_options, |
| 79 | double * x) { |
Sameer Agarwal | 367b65e | 2013-08-09 10:35:37 -0700 | [diff] [blame] | 80 | switch (options_.sparse_linear_algebra_library_type) { |
Sameer Agarwal | b051873 | 2012-05-29 00:27:57 -0700 | [diff] [blame] | 81 | case SUITE_SPARSE: |
| 82 | return SolveImplUsingSuiteSparse(A, b, per_solve_options, x); |
| 83 | case CX_SPARSE: |
| 84 | return SolveImplUsingCXSparse(A, b, per_solve_options, x); |
| 85 | default: |
| 86 | LOG(FATAL) << "Unknown sparse linear algebra library : " |
Sameer Agarwal | 367b65e | 2013-08-09 10:35:37 -0700 | [diff] [blame] | 87 | << options_.sparse_linear_algebra_library_type; |
Sameer Agarwal | b051873 | 2012-05-29 00:27:57 -0700 | [diff] [blame] | 88 | } |
| 89 | |
| 90 | LOG(FATAL) << "Unknown sparse linear algebra library : " |
Sameer Agarwal | 367b65e | 2013-08-09 10:35:37 -0700 | [diff] [blame] | 91 | << options_.sparse_linear_algebra_library_type; |
Sameer Agarwal | b051873 | 2012-05-29 00:27:57 -0700 | [diff] [blame] | 92 | return LinearSolver::Summary(); |
| 93 | } |
| 94 | |
| 95 | #ifndef CERES_NO_CXSPARSE |
| 96 | LinearSolver::Summary SparseNormalCholeskySolver::SolveImplUsingCXSparse( |
| 97 | CompressedRowSparseMatrix* A, |
| 98 | const double* b, |
| 99 | const LinearSolver::PerSolveOptions& per_solve_options, |
| 100 | double * x) { |
Sameer Agarwal | 42a84b8 | 2013-02-01 12:22:53 -0800 | [diff] [blame] | 101 | EventLogger event_logger("SparseNormalCholeskySolver::CXSparse::Solve"); |
| 102 | |
Sameer Agarwal | b051873 | 2012-05-29 00:27:57 -0700 | [diff] [blame] | 103 | LinearSolver::Summary summary; |
| 104 | summary.num_iterations = 1; |
Sameer Agarwal | b16e118 | 2013-11-25 05:47:43 -0800 | [diff] [blame] | 105 | summary.termination_type = TOLERANCE; |
Sameer Agarwal | 89a592f | 2013-11-26 11:35:49 -0800 | [diff] [blame] | 106 | summary.message = "Success."; |
Sameer Agarwal | b16e118 | 2013-11-25 05:47:43 -0800 | [diff] [blame] | 107 | |
Sameer Agarwal | b051873 | 2012-05-29 00:27:57 -0700 | [diff] [blame] | 108 | const int num_cols = A->num_cols(); |
| 109 | Vector Atb = Vector::Zero(num_cols); |
| 110 | A->LeftMultiply(b, Atb.data()); |
| 111 | |
| 112 | if (per_solve_options.D != NULL) { |
| 113 | // Temporarily append a diagonal block to the A matrix, but undo |
| 114 | // it before returning the matrix to the user. |
| 115 | CompressedRowSparseMatrix D(per_solve_options.D, num_cols); |
| 116 | A->AppendRows(D); |
| 117 | } |
| 118 | |
| 119 | VectorRef(x, num_cols).setZero(); |
| 120 | |
| 121 | // Wrap the augmented Jacobian in a compressed sparse column matrix. |
Petter Strandmark | 1e3cbd9 | 2012-08-29 09:39:56 -0700 | [diff] [blame] | 122 | cs_di At = cxsparse_.CreateSparseMatrixTransposeView(A); |
Sameer Agarwal | b051873 | 2012-05-29 00:27:57 -0700 | [diff] [blame] | 123 | |
| 124 | // Compute the normal equations. J'J delta = J'f and solve them |
| 125 | // using a sparse Cholesky factorization. Notice that when compared |
| 126 | // to SuiteSparse we have to explicitly compute the transpose of Jt, |
| 127 | // and then the normal equations before they can be |
| 128 | // factorized. CHOLMOD/SuiteSparse on the other hand can just work |
| 129 | // off of Jt to compute the Cholesky factorization of the normal |
| 130 | // equations. |
Sameer Agarwal | d5b93bf | 2013-04-26 21:17:49 -0700 | [diff] [blame] | 131 | cs_di* A2 = cxsparse_.TransposeMatrix(&At); |
| 132 | cs_di* AtA = cxsparse_.MatrixMatrixMultiply(&At, A2); |
Sameer Agarwal | b051873 | 2012-05-29 00:27:57 -0700 | [diff] [blame] | 133 | |
Petter Strandmark | 1e3cbd9 | 2012-08-29 09:39:56 -0700 | [diff] [blame] | 134 | cxsparse_.Free(A2); |
Sameer Agarwal | b051873 | 2012-05-29 00:27:57 -0700 | [diff] [blame] | 135 | if (per_solve_options.D != NULL) { |
| 136 | A->DeleteRows(num_cols); |
| 137 | } |
Sameer Agarwal | 42a84b8 | 2013-02-01 12:22:53 -0800 | [diff] [blame] | 138 | event_logger.AddEvent("Setup"); |
| 139 | |
Petter Strandmark | 1e3cbd9 | 2012-08-29 09:39:56 -0700 | [diff] [blame] | 140 | // Compute symbolic factorization if not available. |
| 141 | if (cxsparse_factor_ == NULL) { |
Sameer Agarwal | d5b93bf | 2013-04-26 21:17:49 -0700 | [diff] [blame] | 142 | if (options_.use_postordering) { |
Sameer Agarwal | b16e118 | 2013-11-25 05:47:43 -0800 | [diff] [blame] | 143 | cxsparse_factor_ = cxsparse_.BlockAnalyzeCholesky(AtA, |
| 144 | A->col_blocks(), |
| 145 | A->col_blocks()); |
Sameer Agarwal | d5b93bf | 2013-04-26 21:17:49 -0700 | [diff] [blame] | 146 | } else { |
Sameer Agarwal | b16e118 | 2013-11-25 05:47:43 -0800 | [diff] [blame] | 147 | cxsparse_factor_ = cxsparse_.AnalyzeCholeskyWithNaturalOrdering(AtA); |
Sameer Agarwal | d5b93bf | 2013-04-26 21:17:49 -0700 | [diff] [blame] | 148 | } |
Petter Strandmark | 1e3cbd9 | 2012-08-29 09:39:56 -0700 | [diff] [blame] | 149 | } |
Sameer Agarwal | 42a84b8 | 2013-02-01 12:22:53 -0800 | [diff] [blame] | 150 | event_logger.AddEvent("Analysis"); |
| 151 | |
Sameer Agarwal | b16e118 | 2013-11-25 05:47:43 -0800 | [diff] [blame] | 152 | if (cxsparse_factor_ == NULL) { |
| 153 | summary.termination_type = FATAL_ERROR; |
Sameer Agarwal | 89a592f | 2013-11-26 11:35:49 -0800 | [diff] [blame] | 154 | summary.message = |
| 155 | "CXSparse failure. Unable to find symbolic factorization."; |
Sameer Agarwal | b16e118 | 2013-11-25 05:47:43 -0800 | [diff] [blame] | 156 | } else if (cxsparse_.SolveCholesky(AtA, cxsparse_factor_, Atb.data())) { |
Sameer Agarwal | b051873 | 2012-05-29 00:27:57 -0700 | [diff] [blame] | 157 | VectorRef(x, Atb.rows()) = Atb; |
Sameer Agarwal | b16e118 | 2013-11-25 05:47:43 -0800 | [diff] [blame] | 158 | } else { |
| 159 | summary.termination_type = FAILURE; |
Sameer Agarwal | b051873 | 2012-05-29 00:27:57 -0700 | [diff] [blame] | 160 | } |
Sameer Agarwal | 42a84b8 | 2013-02-01 12:22:53 -0800 | [diff] [blame] | 161 | event_logger.AddEvent("Solve"); |
| 162 | |
Petter Strandmark | 1e3cbd9 | 2012-08-29 09:39:56 -0700 | [diff] [blame] | 163 | cxsparse_.Free(AtA); |
Sameer Agarwal | 42a84b8 | 2013-02-01 12:22:53 -0800 | [diff] [blame] | 164 | event_logger.AddEvent("Teardown"); |
Sameer Agarwal | b051873 | 2012-05-29 00:27:57 -0700 | [diff] [blame] | 165 | return summary; |
| 166 | } |
| 167 | #else |
| 168 | LinearSolver::Summary SparseNormalCholeskySolver::SolveImplUsingCXSparse( |
| 169 | CompressedRowSparseMatrix* A, |
| 170 | const double* b, |
| 171 | const LinearSolver::PerSolveOptions& per_solve_options, |
| 172 | double * x) { |
| 173 | LOG(FATAL) << "No CXSparse support in Ceres."; |
Keir Mierle | efe7ac6 | 2012-06-24 22:25:28 -0700 | [diff] [blame] | 174 | |
| 175 | // Unreachable but MSVC does not know this. |
| 176 | return LinearSolver::Summary(); |
Sameer Agarwal | b051873 | 2012-05-29 00:27:57 -0700 | [diff] [blame] | 177 | } |
| 178 | #endif |
| 179 | |
| 180 | #ifndef CERES_NO_SUITESPARSE |
| 181 | LinearSolver::Summary SparseNormalCholeskySolver::SolveImplUsingSuiteSparse( |
| 182 | CompressedRowSparseMatrix* A, |
| 183 | const double* b, |
| 184 | const LinearSolver::PerSolveOptions& per_solve_options, |
| 185 | double * x) { |
Sameer Agarwal | 42a84b8 | 2013-02-01 12:22:53 -0800 | [diff] [blame] | 186 | EventLogger event_logger("SparseNormalCholeskySolver::SuiteSparse::Solve"); |
Sameer Agarwal | b16e118 | 2013-11-25 05:47:43 -0800 | [diff] [blame] | 187 | LinearSolver::Summary summary; |
| 188 | summary.termination_type = TOLERANCE; |
| 189 | summary.num_iterations = 1; |
Sameer Agarwal | 89a592f | 2013-11-26 11:35:49 -0800 | [diff] [blame] | 190 | summary.message = "Success."; |
Keir Mierle | 8ebb073 | 2012-04-30 23:09:08 -0700 | [diff] [blame] | 191 | |
Sameer Agarwal | 42a84b8 | 2013-02-01 12:22:53 -0800 | [diff] [blame] | 192 | const int num_cols = A->num_cols(); |
Keir Mierle | 8ebb073 | 2012-04-30 23:09:08 -0700 | [diff] [blame] | 193 | Vector Atb = Vector::Zero(num_cols); |
| 194 | A->LeftMultiply(b, Atb.data()); |
| 195 | |
| 196 | if (per_solve_options.D != NULL) { |
Sameer Agarwal | b16e118 | 2013-11-25 05:47:43 -0800 | [diff] [blame] | 197 | // Temporarily append a diagonal block to the A matrix, but undo |
| 198 | // it before returning the matrix to the user. |
Keir Mierle | 8ebb073 | 2012-04-30 23:09:08 -0700 | [diff] [blame] | 199 | CompressedRowSparseMatrix D(per_solve_options.D, num_cols); |
| 200 | A->AppendRows(D); |
| 201 | } |
| 202 | |
| 203 | VectorRef(x, num_cols).setZero(); |
Sameer Agarwal | 2560b17 | 2013-04-19 08:19:11 -0700 | [diff] [blame] | 204 | cholmod_sparse lhs = ss_.CreateSparseMatrixTransposeView(A); |
Sameer Agarwal | 42a84b8 | 2013-02-01 12:22:53 -0800 | [diff] [blame] | 205 | event_logger.AddEvent("Setup"); |
Keir Mierle | 8ebb073 | 2012-04-30 23:09:08 -0700 | [diff] [blame] | 206 | |
Sameer Agarwal | 7a3c43b | 2012-06-05 23:10:59 -0700 | [diff] [blame] | 207 | if (factor_ == NULL) { |
Sameer Agarwal | 9189f4e | 2013-04-19 17:09:49 -0700 | [diff] [blame] | 208 | if (options_.use_postordering) { |
Sameer Agarwal | 79bde35 | 2013-11-21 21:33:51 -0800 | [diff] [blame] | 209 | factor_ = ss_.BlockAnalyzeCholesky(&lhs, |
| 210 | A->col_blocks(), |
Sameer Agarwal | b16e118 | 2013-11-25 05:47:43 -0800 | [diff] [blame] | 211 | A->row_blocks(), |
Sameer Agarwal | 89a592f | 2013-11-26 11:35:49 -0800 | [diff] [blame] | 212 | &summary.message); |
Sameer Agarwal | 7a3c43b | 2012-06-05 23:10:59 -0700 | [diff] [blame] | 213 | } else { |
Sameer Agarwal | 89a592f | 2013-11-26 11:35:49 -0800 | [diff] [blame] | 214 | factor_ = ss_.AnalyzeCholeskyWithNaturalOrdering(&lhs, &summary.message); |
Sameer Agarwal | 7a3c43b | 2012-06-05 23:10:59 -0700 | [diff] [blame] | 215 | } |
Sameer Agarwal | 7a3c43b | 2012-06-05 23:10:59 -0700 | [diff] [blame] | 216 | } |
Sameer Agarwal | 42a84b8 | 2013-02-01 12:22:53 -0800 | [diff] [blame] | 217 | event_logger.AddEvent("Analysis"); |
Keir Mierle | 8ebb073 | 2012-04-30 23:09:08 -0700 | [diff] [blame] | 218 | |
Sameer Agarwal | 79bde35 | 2013-11-21 21:33:51 -0800 | [diff] [blame] | 219 | if (factor_ == NULL) { |
| 220 | if (per_solve_options.D != NULL) { |
| 221 | A->DeleteRows(num_cols); |
| 222 | } |
Sameer Agarwal | 79bde35 | 2013-11-21 21:33:51 -0800 | [diff] [blame] | 223 | summary.termination_type = FATAL_ERROR; |
| 224 | return summary; |
| 225 | } |
| 226 | |
Sameer Agarwal | 89a592f | 2013-11-26 11:35:49 -0800 | [diff] [blame] | 227 | summary.termination_type = ss_.Cholesky(&lhs, factor_, &summary.message); |
Sameer Agarwal | b16e118 | 2013-11-25 05:47:43 -0800 | [diff] [blame] | 228 | if (summary.termination_type != TOLERANCE) { |
Sameer Agarwal | 79bde35 | 2013-11-21 21:33:51 -0800 | [diff] [blame] | 229 | if (per_solve_options.D != NULL) { |
| 230 | A->DeleteRows(num_cols); |
| 231 | } |
Sameer Agarwal | 79bde35 | 2013-11-21 21:33:51 -0800 | [diff] [blame] | 232 | return summary; |
| 233 | } |
| 234 | |
| 235 | cholmod_dense* rhs = ss_.CreateDenseVector(Atb.data(), num_cols, num_cols); |
Sameer Agarwal | 89a592f | 2013-11-26 11:35:49 -0800 | [diff] [blame] | 236 | cholmod_dense* sol = ss_.Solve(factor_, rhs, &summary.message); |
Sameer Agarwal | 42a84b8 | 2013-02-01 12:22:53 -0800 | [diff] [blame] | 237 | event_logger.AddEvent("Solve"); |
Keir Mierle | 8ebb073 | 2012-04-30 23:09:08 -0700 | [diff] [blame] | 238 | |
| 239 | ss_.Free(rhs); |
Keir Mierle | 8ebb073 | 2012-04-30 23:09:08 -0700 | [diff] [blame] | 240 | if (per_solve_options.D != NULL) { |
| 241 | A->DeleteRows(num_cols); |
| 242 | } |
| 243 | |
Keir Mierle | 8ebb073 | 2012-04-30 23:09:08 -0700 | [diff] [blame] | 244 | if (sol != NULL) { |
| 245 | memcpy(x, sol->x, num_cols * sizeof(*x)); |
Keir Mierle | 8ebb073 | 2012-04-30 23:09:08 -0700 | [diff] [blame] | 246 | ss_.Free(sol); |
Sameer Agarwal | b16e118 | 2013-11-25 05:47:43 -0800 | [diff] [blame] | 247 | } else { |
| 248 | summary.termination_type = FAILURE; |
Keir Mierle | 8ebb073 | 2012-04-30 23:09:08 -0700 | [diff] [blame] | 249 | } |
| 250 | |
Sameer Agarwal | 42a84b8 | 2013-02-01 12:22:53 -0800 | [diff] [blame] | 251 | event_logger.AddEvent("Teardown"); |
Keir Mierle | 8ebb073 | 2012-04-30 23:09:08 -0700 | [diff] [blame] | 252 | return summary; |
| 253 | } |
Sameer Agarwal | b051873 | 2012-05-29 00:27:57 -0700 | [diff] [blame] | 254 | #else |
| 255 | LinearSolver::Summary SparseNormalCholeskySolver::SolveImplUsingSuiteSparse( |
| 256 | CompressedRowSparseMatrix* A, |
| 257 | const double* b, |
| 258 | const LinearSolver::PerSolveOptions& per_solve_options, |
| 259 | double * x) { |
| 260 | LOG(FATAL) << "No SuiteSparse support in Ceres."; |
Keir Mierle | efe7ac6 | 2012-06-24 22:25:28 -0700 | [diff] [blame] | 261 | |
| 262 | // Unreachable but MSVC does not know this. |
| 263 | return LinearSolver::Summary(); |
Sameer Agarwal | b051873 | 2012-05-29 00:27:57 -0700 | [diff] [blame] | 264 | } |
| 265 | #endif |
Keir Mierle | 8ebb073 | 2012-04-30 23:09:08 -0700 | [diff] [blame] | 266 | |
| 267 | } // namespace internal |
| 268 | } // namespace ceres |
Sameer Agarwal | 8140f0f | 2013-03-12 09:45:08 -0700 | [diff] [blame] | 269 | |
| 270 | #endif // !defined(CERES_NO_SUITESPARSE) || !defined(CERES_NO_CXSPARSE) |