MCPcopy Create free account
hub / github.com/bgrimstad/splinter / SparseQR

Class SparseQR

include/linearsolvers.h:142–162  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

140
141template<class rhs = DenseVector>
142class SparseQR : public LinearSolver<SparseMatrix, rhs>
143{
144private:
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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected