| 140 | |
| 141 | template<class rhs = DenseVector> |
| 142 | class SparseQR : public LinearSolver<SparseMatrix, rhs> |
| 143 | { |
| 144 | private: |
| 145 | bool doSolve(const SparseMatrix &A, const rhs &b, rhs &x) const |
| 146 | { |
| 147 | // Init SparseQR solver (works with rectangular matrices) |
| 148 | Eigen::SparseQR<SparseMatrix, Eigen::COLAMDOrdering<int>> sparseSolver; |
| 149 | sparseSolver.analyzePattern(A); |
| 150 | sparseSolver.factorize(A); |
| 151 | |
| 152 | if (sparseSolver.info() == Eigen::Success) |
| 153 | { |
| 154 | // Solve LSE |
| 155 | x = sparseSolver.solve(b); |
| 156 | |
| 157 | return sparseSolver.info() == Eigen::Success; |
| 158 | } |
| 159 | |
| 160 | return false; |
| 161 | } |
| 162 | }; |
| 163 | |
| 164 | } // namespace SPLINTER |
| 165 |
nothing calls this directly
no outgoing calls
no test coverage detected