Hi all,
I'm wondering whether it would be useful (or more precisely, whether the
cost-benefit calculation would be net positive...) to generalize the
qrdecomp() function to allow column pivoting. Here are a couple of
thoughts and remarks on that:
1) First of all, qrdecomp currently does not return an ordered result.
For example, when doing this:
Q = qrdecomp(mnormal(4)~zeros(4)~mnormal(4) , &R)
then the middle column of R is zero, just following the input. Of
course, this is fully according to spec, nothing else is promised currently.
2) A QR decomposition with pivoting would provide a rank-revealing
operation. The natural workaround and alternative way to do this is SVD.
It is my understanding that SVD would be noticeably slower, however.
(Correct?)
3) In Lapack this is given here:
https://www.netlib.org/lapack/lug/node42.html, and references the
routine xGEQP3 (Level 3 BLAS).
4) In terms of a possible interface, the immediate idea would be to have
a third and optional boolean switch which defaults to the old behavior,
and if set to TRUE then it would use column pivoting. However, perhaps
one also wants to retrieve the resulting permutation matrix P in the
relationship AP=QR (where A is the input). Then perhaps the third
optional argument would be another pointer-to-matrix, just like the
second one. Then column pivoting would only be done if a matrix pointer
is actually provided in the third slot, capturing the P result.
So, what do you think, how difficult would it be to implement this, and
does it make sense?
thanks
sven