# Tag Info

To apply the rotations, you're only modifying rows $i$ and $i+1$. So, you can write $R \gets G^T R$ as $$R[i:i+1, :] \gets G^T[i:i+1, i:i+1] R[i:i+1, :],$$ which is just a $2\times2\times n$ matrix product. Similarly for $Q$, you can get $$Q[:, i:i+1] \gets Q[:, i:i+1]G[i:i+1, i:i+1].$$ You may want to look at BLAS's ?rot routines (where ? is one of s,d,c,...