Currently RQ, QL, and LQ factorizations are not included in Matlab. Therefore I wrote these mex files, which uses the LAPACK routines. (although these factorizations can also be done by QR and additional matrix manipulations) QR1 is added to complete the set. They can also handle empty matrices. Enforcing positive elements on diagonal R matrix or column pivoting is supported by the QR1 factorization only.
I also wonder if there is any way to remove ratings that occurred a long time ago. Not only are the ratings unfair, the problems they discuss have subsequently been addressed. The resultant rating doesn't do this code justice.
Hi there - great submission. I found this was perfect to be able to use QR which enforces positive diagonal by just changing a couple of lines (dgeqrfp.f and zgeqrfp.f). Perhaps you might consider adding this as an option as I'm sure other people may find it useful.
Great submission, very useful for a lot of purposes! But I found out that there might be some bugs, or maybe it is only because of my Matlab version (2012a), I'm not sure..
For example, when I want to get the QL-decomposition, it's fine for square matrices, but for any kind of non-square matrix, I get a fatal error and Matlab shuts itself down. Did anybody also notice such kind of error?
PLS is there anyone used this function in signal processing???
If there is anyone could you please refer me to any article who used it in signal processing. This part is important for me to do my thesis so I understand more about this fucntion in signal processing and to put some references.
I couldnt find any
Hi, i'm a student and i have some problems with the functions.
- How it works?, because i put,for example, [L,Q]=LQ(A) and matlab displays this message:
"??? Attempt to execute SCRIPT lq as a function"
I put all files in the current directory, and i did File -> Set Path....., but the same message is displayed.
Please help! :(
1) This was based on a quick look at your source code. I didn't see anything in there that looked like macros for this. But as you correctly point out, it is included in blas.h or lapack.h which is included in factor.h which is included in your source code, so you are covered here for later versions of MATLAB. But you are still not covered for earlier version of MATLAB that do not have blas.h or lapack.h available. So your code will not work on those versions (R2006a and earlier??). So you might consider writing your own macros for this, particularly since there are only a handful of functions involved.
3) I think R2006a and earlier do not have the mwSize etc type definitions available.
5) This was based on a quick look at your code. In particular lines like this from your source code:
There is no mention of a build file in the source code, so I didn't realize that the make_factor.m was included for that purpose.
And I will add one addition suggestion:
6) Include in your package help for all of the files. That means including files lq.m, ql.m, qr1.m, and rq.m with the relevant H1 line and associated help text. That way the user can type "help lq" and get some info on the function (e.g., include general syntax and which LAPACK routines are used, etc.). You might also expand the help text in make_factor.m so that "help make_factor" prints out something more descriptive than just "Compilation of mex-files". And add an H1 line to this file too, so that it is easy to find and associate with the functions lq etc. For example, if the user types "lookfor lq" it would be nice if your lq.m help file showed up as well as your make_factor.m file.
Some notes on linking with BLAS/LAPACK libraries you might want to incorporate:
1) Don't hard-code the function names because UNIX based systems have different names than WINDOWS systems, typically with an added underscore at the end. Instead put something like this at the top of the routine and then use the macros in your code. e.g.,
This file has collected some very unfair reviews. First, do any of you realize how difficult it is to write a mexFunction that handles both the real and complex cases? In some cases, it's like writing a completely separate code for the complex case. MATLAB stores its complex matrix in a non-standard way that doesn't map directly to C, C++, or Fortran.
So if a code doesn't handle the complex case, and you want the complex case, it's hardly fair to bash a code because of that. The real case may be the only one the author needs. It's almost like saying a Cholesky factorization is useless because it doesn't handle unsymmetric matrices. Please...
Finally, I also find ratings with no comments to be particularly useless. So why is it poor, Nahla? And why do you need to rate it twice? If you rate a code, give specific reasons why it's good or bad. Otherwise your rating is worthless. Worse than useless, because the reason you say it's poor might be for a fairly self-centered reason (such as the complex / real case I mention above).
I haven't read this code yet (I plan to). I give it a 5 simply to discount the spurious and useless ratings given to it so unfairly, and to place my "vote" against them.
Particularly when the author has now posted an update that *does* handle the complex case . Jacob says it's excellent for the real case ... so why does he unfairly rate this as "poor"?
24 Dec 2007
22 Dec 2007
09 Nov 2007
excellent for real matrices but I use complex matrices, therefore worthless.
08 Nov 2007
It cannot handle the complex case!!!
08 Nov 2007
Thank you so much for useful codes
24 Sep 2007
add mex files
12 Nov 2007
Now also supports single precision and complex matrices.
02 Oct 2010
Updated for new Matlab 64 bit versions
04 Oct 2010
Included the updates as in the comments.
06 Oct 2010
29 Mar 2015
Fixes for new integer data types in newer Matlab versions.
30 Mar 2015
Fix crash in QL/RQ for non-sqaure matrices
Fix make script for newer matlab versions
30 Mar 2015
11 Jul 2015
Added pivoting to the QR1 function using the *GEQP3 Lapack routines.
11 Oct 2015
Add option for QR to enforce positive elements on diagonal R matrix