- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I'm trying to solve least squares problem. Given matrix A(mxn), m > n, minimize (Ax - b)2. MKL Reference suggests to use QR Factorization. And all calculation is done in several steps - factorization itself, normalizing matrix form, multiplying rhs, etc.
However, its a little complicated and I found no straightforward explanation on how to compute result x from given A and b. For now I don't even sure how to acquire matrix R. Should I manually multiply A with QT? Or should I extract it somehow from QR result?
I think it'd be pretty convenient to provide manual with simple code example of function
SolveLSP(int m, int n, float* A, float* b, float* x);
using LAPACKE_sgeqrf(), LAPACKE_sorgqr() etc. calls, which is exactly my problem. One may assume matrix_order to be LAPACK_ROW_MAJOR.
E.g. ippmQRDecomp reference is great. Even with picture and enough explanation on storage, though one should not be concerned of it granted with simple ippmQRBackSubst function.
Would you please grant me with such example or with some simple explanation of what functions should I call in what order?
Thanks a lot.
I'm trying to solve least squares problem. Given matrix A(mxn), m > n, minimize (Ax - b)2. MKL Reference suggests to use QR Factorization. And all calculation is done in several steps - factorization itself, normalizing matrix form, multiplying rhs, etc.
However, its a little complicated and I found no straightforward explanation on how to compute result x from given A and b. For now I don't even sure how to acquire matrix R. Should I manually multiply A with QT? Or should I extract it somehow from QR result?
I think it'd be pretty convenient to provide manual with simple code example of function
SolveLSP(int m, int n, float* A, float* b, float* x);
using LAPACKE_sgeqrf(), LAPACKE_sorgqr() etc. calls, which is exactly my problem. One may assume matrix_order to be LAPACK_ROW_MAJOR.
E.g. ippmQRDecomp reference is great. Even with picture and enough explanation on storage, though one should not be concerned of it granted with simple ippmQRBackSubst function.
Would you please grant me with such example or with some simple explanation of what functions should I call in what order?
Thanks a lot.
1 Solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you are interested only in obtaining a least-squares solution rather than in the intermediate results such as Q and R, please look at the LAPACKE_?gels routines, and the several examples in the ../mkl/examples/lapacke/source directory.
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you are interested only in obtaining a least-squares solution rather than in the intermediate results such as Q and R, please look at the LAPACKE_?gels routines, and the several examples in the ../mkl/examples/lapacke/source directory.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This is the best answer I didn't even dare to hear :)
Thanks!
Thanks!

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page