This function computes the QR decomposition of matrix \(A\)
\[A = Q R\]
where \(A\) is a matrix of size \(m \times n\), \(Q\) is orthogonal matrix of size \(m \times m\), and \(R\) is an upper triangular matrix. If instead A is a complex square matrix, then there is a decomposition A = QR where Q is a unitary matrix.