I am having a problem getting the correct results when solving a generalized eigenvalue problem of the form Ax=yBx. In my small test application the A and B matrices are both 3x3 real symmetric matrices. The dfeast_sygv solver returns only two eigenvalues between -10 and 10 of -1.313409 and 1.842060, both of which are wrong. I have also tested it using dfeast_scsrgv and get the same incorrect results. My test code is attached.
The correct eigenvalues for my text case are -1.18725, -0.28274 and 1.711014. I have verified these using Matlab and also in Excel using the Matrix.xla routines. I have also checked that the equation Ax=yBx is satisfied using the returned eigenvalues and eigenvectors.
Interestingly, if I zero all the non-diagonal terms of the B matrix then dfeast_sygv returns the correct eigenvalues of -1.650985, 0.4497689 and 6.284550. This shows that the problem only occurs when there are non-zero terms away from the diagonal of the B matrix.
Am I doing something that the Feast solver isn't meant for? I am using MKL v2017.2 with the latest 2017.2 Intel Fortran compiler in VS2015.