sparsemat / sprs

sparse linear algebra library for rust
Apache License 2.0
381 stars 45 forks source link

Spare Linear Matrix Solver #322

Closed kesleta closed 9 months ago

kesleta commented 1 year ago

Sorry if I'm overlooking something obvious here, but does this library include a way to solve sparse matrix equations? E.g. I have a matrix A and a vector v and I want to find the vector x` that satisfies the equationAx=v`. I looked in the documentation and could not find any functions under "inverse" or "solve" other than the triangular solvers, which seem like they are meant only for a specialized case. Is there, or is there planned to be, a method of solving such equations using this library? Thank you for any help or guidance.

mulimoen commented 1 year ago

There is the sprs_ldl package for solving a hermitian positive definite matrix. Have a look at suitesparse and we could see if a wrapper for some function might fit your usecase

jlogan03 commented 1 year ago

I have a pr out (https://github.com/sparsemat/sprs/pull/327) to add bindings to umfpack, which handles more general square systems - hopefully that helps

jlogan03 commented 1 year ago

@kesleta , #327 is merged, so you should be able to use the methods in sprs_suitesparse_umfpack to do arbitrary square Ax=b solves with a dense right-hand-side.