The LAPACK forum has moved to https://github.com/Reference-LAPACK/lapack/discussions.

Solve Least Squares System using QR with Column Pivoting

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

Solve Least Squares System using QR with Column Pivoting

Postby Lapackuser999 » Wed Apr 14, 2010 3:00 pm

Hi,

I am trying to replicate MATLAB's implementation of its "mldivide" function that solves a linear system using the QR factorization with column pivoting.

Hence, x = A\b; would be the solution.

MATLAB mentions that is uses DGEQP3, DORMQR, and DTRTRS LAPACK routines to accomplish this. I was wondering how I should go about using the 3 aforementioned LAPACK routines, to recreate the MATLAB results.

Any help will be appreciated.

Thanks
Lapackuser999
 
Posts: 5
Joined: Wed Apr 14, 2010 2:50 pm

Re: Solve Least Squares System using QR with Column Pivoting

Postby ssalha » Sat Jun 05, 2010 3:20 pm

I have the same problem! I was trying to replicate qr, as well as \.

I used PDGEQRF, PDORMQR, PDTRTRS, the first one gets the q and r, the second one multiplies the rhs (B) with
Q transpose, and the last one is the \ for the triangular matrix.
Here I was trying to solve AX = B

I followed what matlab says they use, but can't quite get it to work on any matrix.

It works for a randomly generated matrix only.

If you were able to get more insight into it, I would very much appreciate your feedback.

Thank you,
Sara
ssalha
 
Posts: 7
Joined: Fri Jun 04, 2010 4:32 pm


Return to User Discussion

Who is online

Users browsing this forum: No registered users and 7 guests