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

Class SparseLU

include/linearsolvers.h:117–139  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

115
116template<class rhs = DenseVector>
117class SparseLU : public LinearSolver<SparseMatrix, rhs>
118{
119private:
120 bool doSolve(const SparseMatrix &A, const rhs &b, rhs &x) const
121 {
122 // Init SparseLU solver (requires square matrices)
123 Eigen::SparseLU<SparseMatrix> sparseSolver;
124 // Compute the ordering permutation vector from the structural pattern of A
125 sparseSolver.analyzePattern(A);
126 // Compute the numerical factorization
127 sparseSolver.factorize(A);
128
129 if (sparseSolver.info() == Eigen::Success)
130 {
131 // Solve LSE
132 x = sparseSolver.solve(b);
133
134 return sparseSolver.info() == Eigen::Success;
135 }
136
137 return false;
138 }
139};
140
141template<class rhs = DenseVector>
142class SparseQR : public LinearSolver<SparseMatrix, rhs>

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected