QR function

QR Decomposition by Graham-Schmidt Orthonormalization