I'm trying to implement the tiled QR decomposition in MATLAB (in an attempt to understand it), and I'm trying to check that my SGEQRF (upper corner tiles) function is working correctly. I have a similar C implementation that does work correctly (for SGEQRF) but I get a slightly different answer for some matrices, and I'm trying to understand how to reclaim Q from the H vectors.
For example on the matrix A = $$ \left( \begin{array}{ccc} 1 & 1 & 1 & 1\\ 2 & 2 & 2 & 2 \\ 3 & 3 & 3 & 3\\ 4 & 4 & 4 & 4 \end{array}\right) $$
my C implementation retrieves a resulting matrix: $$ \left( \begin{array}{ccc} -5.477 & -5.477 & -5.477 & -5.477\\ 0.309 & 0 & 0 & 0 \\ 0.463 & 0 & 0 & 0\\ 0.618 & 0 & 0 & 0 \end{array}\right) $$
with tau matrix: $$ \left( \begin{array}{ccc} 1.183 \\ 2 \\ 2\\ 0 \end{array}\right) $$
When I used the LAPACK SGEQRF function on the same matrix, it gets different tau and result matrices, however using SOGRQF on my result does return a Q matrix such that Q*R = A, so am satisfied that implementation does work.
What I don't understand however, is how to recover Q from the resulting matrix (ideally I would like to implement this myself in MATLAB so I can understand whats going on).
Presumably you can compute $Q_1$ from $\tau_1 $, $r_{1,1}$ and $v_1$ (where $v_1$ is the lower diagonal first column of the resulting matrix) somehow but I can't see how.
For my example it seems like:
$$ \left( \begin{array} $1 \\ v_0 \\ \end{array} \right)\ $$ $\times \tau_0 \times r_{0,0} +$ $$ \left( \begin{array} $r_{0,0}\\ 0 \\ \end{array} \right)$$
is approximately equal to the first column of A. (Sorry I can't get that latex sum to work for some reason :/ ).
However I'm not sure this is the case always, and the first value doesn't seem to quite be correct (I get 1.0051 instead of 1, which seems to be more than rounding error likely). Further I'm not sure how to propagate this through the matrix.
How does this change when you have the tiled version, where each tile below the corner has its own $\tau$ value?
Thanks