Dear fellows, I just registered in this forum b/z I found so many nice guys and helpful solutions in here.

I have a question and hope someone could give a solution.

I am looking for an orthogonal basis for {u: Au=0}, where u is in R^n, A is a matrix m*n (m<<n), with rank m.

One way is to do QR factorization for A^T (transpose of A), the last n-m columns of Q will be the orthogonal basis for the null space.

That is, if written Q=[Q1,Q2]. Q2 is what I need.

QR factorization can be done with LAPCK subroutine DGEQRF, then the orthogonal Q matrix can be found with DORMQR.

However, after done this, I tested that when apply A to one column of Q2, it's not zeros (as large as ~1.e-2). So, Q2 is not exactly the basis for the null space.

It really confuses me...could someone suggest the possible reasons?

Thanks a lot!

-Powergon