MCPcopy Create free account
hub / github.com/NGSolve/ngsolve / InverseSparseMatrixTM

Function InverseSparseMatrixTM

linalg/sparsematrix.cpp:2327–2343  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2325
2326template <class TM, class TV_ROW, class TV_COL>
2327shared_ptr<BaseMatrix> InverseSparseMatrixTM (shared_ptr<const SparseMatrix<TM,TV_ROW,TV_COL>> A, shared_ptr<BitArray> const &subset, shared_ptr<const Array<int>> const &clusters)
2328{
2329 auto invtype = A->GetInverseType();
2330 #ifdef USE_SUPERLU
2331 if(invtype == "superlu") return new SuperLUInverse<TM,TV_ROW,TV_COL> (*A, subset, clusters);
2332 #endif
2333 #ifdef USE_UMFPACK
2334 if(invtype == "umfpack") return make_shared<UmfpackInverse<TM,TV_ROW,TV_COL>>(A, subset, clusters);
2335 #endif
2336 #ifdef USE_MUMPS
2337 if(invtype == "mumps") return make_shared<MumpsInverse<TM,TV_ROW,TV_COL>> (*A, subset, clusters);
2338 #endif
2339 if(is_pardiso_available && (invtype == "pardiso" || invtype == "pardisospd"))
2340 return make_shared<PardisoInverse<TM,TV_ROW,TV_COL>> (A, subset, clusters);
2341 if(invtype == "sparsecholesky") return make_shared<SparseCholesky<TM,TV_ROW,TV_COL>>(A, subset, clusters);
2342 throw Exception ("SparseMatrix::InverseMatrix: no inverse available for type " + invtype);
2343}
2344
2345
2346shared_ptr<BaseMatrix> CreateSparseMatrixInverse(shared_ptr<const BaseSparseMatrix> baseA,

Callers 1

Calls 1

GetInverseTypeMethod · 0.80

Tested by

no test coverage detected