Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.
The Intel sign-in experience has changed to support enhanced security controls. If you sign in, click here for more information.
6733 Discussions

separating QR factorisation from function gels?


i want to implement an iterative algorithm that needs to solve one LLS-problem per iteration. The system matix A remains the same over all iterations, only b changes. The function "gels" does exactly what i need, but itperforms thea call to "geqrf" on every call.For performance reasons i would like to do the QR factorisation only once at the beginning of the algortithm and only change b from one iteration to the next.
Is this possible with gels? What happens if i provide a result from geqrf as parameter A to gels?
Which combination of functions do is have to use?

0 Kudos
1 Reply
Hi Hillar,

Yes, gegrf and other several lapack functions combination can do this.

Actually, there are two kind ofLAPACK routine:
1)LAPACK computational routines . These routines perform distinct computational tasks
for example, geqrf do QR factorization.

2) driver routine , like gels
solves a complete problem. To arrive at the solution, driver routines typically call a sequence of appropriate computational routines.

Soyou may call computation rountines for your purpose.

As mkl reference manual discrible,
To solve a particular problem, you usually call several computational routines. Sometimes you need to combine the routines of this chapter with other LAPACK routines described in "LAPACK Routines: Linear Equations" as well as with BLAS routines described in "BLAS and Sparse BLAS Routines".

For example, to solve a set of least squares problems minimizing ||Ax - b||2 for all columns b of a given matrix B (where A and B are real matrices), you can call ?geqrf to form the factorization A = QR, then call ?ormqr to compute C = QHB and finally call the BLAS routine ?trsm to solve for X the system of equations RX = C.

Another way is to call an appropriate driver routine that performs several tasks in one call. For example, to solve the least squares problem the driver routine ?gels can be used.

Some forum users' problem for your reference:

Best Regards,