Verification sequence of eigenvalue problem

What is the normal procedure to verify that I got the correct results (eigenvalues and eigen vectors) from the eigenvalue problem?

I'm using the lapack library to solve eigenvalue problem summarized below. I've 2 matrices K and M and I get the negative results for eigenvalues which arouse my suspicion that the results could be wrong. In order to verify that, the given solutions (eigenvalues and eigenvectors) must comply with that K*X = λ*M*X equation where λ=eigenvalues and X =eigenvectors. I multiplied that λ*M, where I was expecting the K matrix but the results(named as "Verification phase" below) are not even close to those inner products of K matrix.

Just to add: I think you got confused about whch quantites are scalars matrices or vectors in your equation K*X = λ*M*X

If you write it in that form, X is a column vector corresponding to the scalar λ, so you can't "cancel the vector X from each side". Of course there are really N separate equations, one for each λ and the corresponding X.

You can write it as one big matrix equation, but then you have to put the eigenvalues on the right hand side, ##KX = MX \Lambda## where ##\Lambda## is a diagonal matrix containing the λ's. ##\Lambda MX## multiplies the rows of MX by the eigenvalues, but ##MX\Lambda## multipkies the columns of MX which is what you want.

And you can't "cancel out X" from ##KX = MX \Lambda## either, but you can write ##X^TKX = X^TMX \Lambda##, and you should find that ##X^TKX## and ##X^TMX## are both diagonal matrices. In fact the eigenvectors are often scaled so that ##X^TMX = I## and ##X^TKX = \Lambda##.