DGELS and sparse matrix

Open discussion regarding features, bugs, issues, vendors, etc.

DGELS and sparse matrix

Postby Telemachus » Mon Aug 13, 2018 3:31 pm

Hi. I am solving an under-determined system with DGELS. The matrix A has dimensions MxN, with M<N. This matrix is sparse, but is non diagonal, the elements appear at some determined places.

I wanted to know if there is a way to tell lapack that this matrix is sparse, in order to not having to initialize all the entries that are zero, saving memory space, and avoiding trivial computations like a(9,9)*zero. What I would like to do is to entry only the non zero elements, and then lapack do the thing. Is there a way to do this?

Bye there!
Posts: 1
Joined: Mon Aug 13, 2018 11:42 am

Re: DGELS and sparse matrix

Postby Julien Langou » Mon Aug 13, 2018 9:06 pm


As you noted, LAPACK is about dense matrices.

If you feed a sparse matrix to LAPACK, LAPACK will not take advantage of the sparsity. (As you are correctly stating.)

If your matrix is banded then you can use LAPACK and LAPACK will take advantage of the band structure, but it will assume density in the band.

For sparse matrices and QR factorization, there are currently two nice projects that I know of.
The goal for both of these software is to compute QR factorization of sparse matrices (and take advantage of the sparsity).

Julien Langou
Posts: 835
Joined: Thu Dec 09, 2004 12:32 pm
Location: Denver, CO, USA

Return to User Discussion

Who is online

Users browsing this forum: No registered users and 3 guests