by **Julien Langou** » Fri Nov 17, 2017 5:10 pm

Sounds good Markus. Thanks for the comments.

If all is needed to satisfy the user's need is achieved by a simple post processing, so a +/- on R (and on Q, if Q is needed), then I do not feel too bad to leave this up to the user. (This is not that we do not want to do it, this is that we do not know how to do it, we tried, and we failed and had to roll back the code.) In LAPACK case, we do not return Q. We return the Householder vectors. Call them V. If we return R only, yes +/- to achieve nonnegative diagonal in R is easy. If we return Q and R, yes +/- to achieve nonnegative diagonal in R is easy. We return V and R and it is not easy to return a nonnegative diagonal R. This is what GEQRFP does and we had a hard time to get it right and we are not 100% of the numerical stability. We return V and R. We want V and R to be consistent. And getting R with a nonnegative diagonal has complicated implication for V. So this is where we are. I hope this makes sense. So we know of a few applications where users really need V and R, and really need nonnegative diagonal for R. For these applications GEQRFP is really needed. These applications cannot be handle by a simple post processing. The two applications in mind: (a) when doing ``triangle on top of triangle`` QR factorization, (so take R1 and R2 return R factors of R1 on top of R2) the binary operation becomes commutative if we have nonnegative diagonal R in the QR step, (B) this has to do with random distribution of orthogonal matrices. (How to get a random orthogonal matrix.) And now, that I write both, I am not even sure if GEQRFP cannot be bypass actually.

Julien.