The columns of the matrix must be linearly independent in order to preform QR factorization. Note: this uses Gram Schmidt orthogonalization which is numerically unstable. Alternate algorithms include modified Gram Schmidt, Givens rotations, and Householder reflections. (TODO: implement these alternative methods)

Written by Adrian Stoll on 10 Jul 2016