in{equation}
    k = \underset{q&lt; k\le p}{\operatorname{argmax}} \textbf{q}_k^T\textbf{r}.\nonumber
\end{equation}\]</div>
<p>Note the calculations above require the values of <span class="arithmatex">\(\textbf{q}_1, ..., \textbf{q}_q\)</span>, which are already available from <span class="arithmatex">\(\textbf{Q}_1\)</span> in QR decomposition. After we get <span class="arithmatex">\(\textbf{q}_k\)</span>, we rename it to <span class="arithmatex">\(\textbf{q}_{q+1}\)</span>, and then we can augment <spa