Skip to content

Shift-and-invert mode wrong result compared to Matlab #172

@Litbeginner

Description

@Litbeginner

hello, I used the GenEigsRealShiftSolver to compute a large sym matrix (3362*3362), the eigenvalues and eigenvectors are different to the results get in Matlab.
Here is part of the code(it's used to calculate the mode profiles in Computational Electromagnetics):

double shift = (guess * k0) * (guess * k0);
DenseSymShiftSolve<double> op(P0);
SymEigsShiftSolver<DenseSymShiftSolve<double>> eigs(op, nmodes, 2*nmodes+1, shift);
ArrayXXd evalues;
MatrixXd evectors;

eigs.init();
eigs.compute(SortRule::LargestMagn,100000000,1e-8,SortRule::LargestMagn);
if (eigs.info() == CompInfo::Successful)
{
    evalues = eigs.eigenvalues().real();
    evectors = eigs.eigenvectors().real();
}

I think the Maximum number of iterations is big enough, and the difference between the results from this and matlab is obvious.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions