QR decomposition for linear systems (possibly overdetermined) using Givens rotations or Householder transformations