How to do Given's rotation for $3×2$ matrix? (QR decomposition) I need to solve $Ax=b$ in lots of ways using QR decomposition.$$A=\begin{bmatrix}1&1\\-1&1\\1&2\end{bmatrix},\ b=\begin{bmatrix}1\\0\\1\end{bmatrix}.$$I know how to do Given's rotation for $3×3$ matrices as here: Which matrices to use in Given's rotation in QR decomposition But how do I do it for this matrix?
 A: You may find three $2\times2$ rotation matrices $G_1,G_2$ and $G_3$ such that
\begin{align}
\left[\begin{array}{rr}1\\ &G_1\end{array}\right]A
&=\left[\begin{array}{rr}1\\ &G_1\end{array}\right]
\left[\begin{array}{rr}1&1\\ \hline-1&1\\ 1&2\end{array}\right]
=\left[\begin{array}{rr}1&1\\ \hline \ast&\ast\\ 0&\ast\end{array}\right]
=B,\\
\left[\begin{array}{rr}G_2\\ &1\end{array}\right]B
&=\left[\begin{array}{rr}G_2\\ &1\end{array}\right]
\left[\begin{array}{rr}1&1\\ \ast&\ast\\ \hline 0&\ast\end{array}\right]
=\left[\begin{array}{rr}\ast&\ast\\ 0&\ast\\ \hline 0&\ast\end{array}\right]
=C,\\
\left[\begin{array}{rr}1\\ &G_3\end{array}\right]C
&=\left[\begin{array}{rr}1\\ &G_3\end{array}\right]
\left[\begin{array}{rr}\ast&\ast\\ \hline 0&\ast\\ 0&\ast\end{array}\right]
=\left[\begin{array}{rr}\ast&\ast\\ \hline 0&\ast\\ 0&0\end{array}\right]
=R.
\end{align}
Then
$$
A=\underbrace{
\left[\begin{array}{rr}1\\ &G_1^T\end{array}\right]
\left[\begin{array}{rr}G_2^T\\ &1\end{array}\right]
\left[\begin{array}{rr}1\\ &G_3^T\end{array}\right]}_Q\ R=QR.
$$
