Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature request] ETA sparse solvers? #1197

Open
Makogan opened this issue Jan 25, 2023 · 3 comments · May be fixed by #1289
Open

[feature request] ETA sparse solvers? #1197

Makogan opened this issue Jan 25, 2023 · 3 comments · May be fixed by #1289

Comments

@Makogan
Copy link

Makogan commented Jan 25, 2023

Hello,

The documentation seems to indicate there are currently no sparse solvers in nalgebra-sparse. I was wondering if there is a plan on releasing some in the near future.

Best and thank you for the awesome library.

@iverks
Copy link

iverks commented Jul 7, 2023

Bumping this since I bumped into issues with this as well. I tried starting discussion on sparsemat, but in retrospect I have more faith in this happening for Nalgebra.

I tried implementing it myself, but was quickly stumped. I tried porting code from scipy.sparse, which I found out is (atleast for my application) only a thin wrapper around a bundled version of ARPACK-NG.
simplified callstack:

  1. scipy.sparse.eigs(some_matrix, ...other_params)
  2. _UnsymmetricArpackParams().iterate()
  3. _UnsymmetricArpackParams()._arpack_solver() # This is a reference to the fortran library

The main issue I struggled with when trying to do this myself was with how to FFI with fortran. I tried then to reimplement the routines I needed, but I met the same issue because they depend on BLAS and LAPACK.

A great first step would be to implement a wrapper like the lapack crate around ARPACK-NG, or to reimplement it in rust using the lapack crate and the blas crate (if necessary)

@Andlon
Copy link
Sponsor Collaborator

Andlon commented Jul 7, 2023

@Makogan: no one is working on this at the moment. However, I'm using some bindings to Intel MKL's sparse direct solvers in my own projects, based on my unreleased mkl-corrode library. I'm planning to eventually contribute these to nalgebra-sparse. Writing efficient sparse direct solvers is a major undertaking, for which I don't think I'll personally have any time soon. I think such an effort should anyway be consolidated in a lower-level crate, through which higher-level crates like nalgebra-sparse could wrap in a simpler API. The folks over at the Rust Linear Solver Toolbox project might eventually perhaps go in a direction like this, but I'm not aware of a concerted effort at this time.

@iverks: I'm a little confused, are you interested in a sparse eigenvalue solver? I think the original poster referred to linear system solvers. I'm further confused because you mention a number of dense linear algebra libraries (LAPACK/BLAS). Admittedly, dense decompositions/algorithms are often building blocks of sparse solvers, but I'm a little confused about what it is that you are actually suggesting.

@iverks
Copy link

iverks commented Jul 7, 2023

You would be right, I wrongly assumed he was referring to sparse eigenvalue solvers. As you say, the reason I mentioned LAPACK/BLAS is because these subroutines are used as building blocks in ARPACK. My suggestion was making wrappers for ARPACK-NG, analogously to your suggestion of creating a lower level crate. This crate could then be used by nalgebra-sparse.

@JulianKnodt JulianKnodt linked a pull request Oct 9, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants