the routines xGEEV('N','N',...) returns the eigenvalues of the matrix but there
is no a-priori rule that gives you the order in which the eigenvalues are. You just get all the eigenvalues of your matrix and that's it.
If you ask for the eigenvectors [e.g. xGEEV('N','V',...) ] , the order of the eigenvectors are
the same as the one of the eigenvalues, but once more, there is no a-priori rule that gives you the order in which the eigenvalues are.
So in your case, the null eigenvalue of your matrix can be a-priori anywhere, you need to look for its position in the array of eigenvalues for each different matrix,