Search code examples
c++linear-algebrasparse-matrixnumerical-methodssvd

SVD to solve harwell-boeing sparse a.x=b system in C/C++?


Does anybody know of a sparse SVD solver for c++? My problem involves some badly conditioned matrices that might have zeroed columns/rows. My data is stored in a uBLAS matrix which is the Harwell-Boeing sparse format.

I am having some trouble finding:

The SVD solver

  1. The SVD solver that can operate on sparse matrices. Lapack doesn't seem to be able to do this? I want to have sparse matrices passed to the function and sparse matrices output.
  2. A way to recombine the results... So that I can read off the xs from x=b(A^-1). I would expect this to be x=(b)(v.(d^-1).(u^t))

I am hoping to recreate the following two steps from GSL

gsl_linalg_SV_decomp_jacobi (gsl_matrix * A, gsl_matrix * V, gsl_vector * S) 
gsl_linalg_SV_solve (const gsl_matrix * U, const gsl_matrix * V, const gsl_vector * S, const gsl_vector * b, gsl_vector * x)

I also have no clue how to wrap a FORTRAN library in c++. Where/Are there any PROPACK c/c++ bindings?

Edit 1: I'm having some trouble with PROPACK. Does PROPACK output sparse matrices? It seems to output V as "V(LDV,KMAX): DOUBLE PRECISION array." which would imply that it doesn't?


Solution

  • SVDLIBC is a C library with partial support for the Harwell-Boeing format. I am not familiar with the library, but on the surface it seems to match your requirements.