Closed jmh530 closed 5 years ago
It looks like orgqr/ungqr are the lapack functions you use to get Q. R can be calculated by matrix multiplication (just by transpose, rather than inverse I have above).
@9il I've got something working (tested at least for square matrices). The only issue right now is organization. I started off using a helper function, like extractQ (it turns out that R is actually done simply without using orgqr).
However, I am partial to putting this functionality into QRResult and then using a flag to switch between outputting the raw matrices (originally) or the actual Q/R matrices. This might reduce allocations versus having them as separate functions.
Any opinion?
Sorry for the huge delay with the answer. I think additional methods that computes Q or R in the current QRResult should be fine.
Another delay on my part. Just submitted pull request .
I think QRResult needs a helper function(s) that produces Q and R from matrix and tau.
I am comparing the result of one of the unittests to how I would do it in R and it doesn't match up. Compare https://run.dlang.io/is/fcMfi9 with below (in R). The lubeck version has a zero in the top left corner for matrix, but I thought it was upper trapezoidal...I know that given R, we can calculate Q as a*inv(R), but I'm not sure I would get the correct R given's lubeck's output.