Calculates QR decomposition of square matrix.
an array of { orthogonal matrix, upper triangular matrix }.