Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Thanks for pointing me to the right direction. I did not realize that I actually needed to compute a good QR decomposition of a rectangular matrix.(After I was reading about QR, I realize it is essentially same as Gram-Schmidt for square matrices, so I think "don't use G-S" is a bit misleading.)