1

I'm trying to solve a large sparse 30,000x1,000 matrix using the a LAPACK solver in the Trilinos package. My goal is to minimise computation time however this Lapack solver only takes square matrices. So I'm manually converting my non-square matrix (A) into a square matrix by multiplying by its transpose, essentially solving the system like so:

(AT*A)x = AT*b

What is making my solve slow are the matrix multiplications by AT steps. Any ideas on how to fix this?

user_777
  • 41
  • 2

1 Answers1

1

You can directly compute the QR-decomposition (wikipedia-link) and use that to solve your least squares problem. This way you don't have to compute the matrix product A^T A.

There are multiple LAPACK routines for the computation of QR-decompositions, e.g. gels is a driver routine for general matrices (intel-link).

I must say that I don't know if Trilinos supplies that routine but it is a standard LAPACK routine.

jack
  • 1,658
  • 1
  • 7
  • 18