I've been working on speeding up some code by rewriting it in Fortran. One of the critical steps is to determine x such that Ax = 0. That is to find the nullspace of A=A'. Matlab seems to do this very well with the eig() function but I cannot reproduce the resulting nullspace eigenvectors with Lapack's DSYEV.
DSYEV has a bug where using "U" (upper diagonal) to store the matrix gives erroneous results. I'm using the lower diagonal option here.
Nonetheless, the vectors produced by eig() and DSYEV corresponding to small eigenvalues (<1e-13) are not the same. Both eig() and DSYEV produce orthonormal vectors that lead to Ax=0 for each vector. But it seems the vectors produced by eig() are much cleaner. They produce better results in the application I'm using them in.
How can I reproduce the results given by eig() so that it can be used in an optimized fortran code which runs faster than MATLAB. I'm keen on running independently of MATLAB. What is eig() doing that DSYEV is not. my matrix does not need any permutations or scaling. I've tried using DGESVD which also does not do as well as eig(). Thanks,
Best Answer