7 #ifndef SPECTRA_GEN_EIGS_COMPLEX_SHIFT_SOLVER_H
8 #define SPECTRA_GEN_EIGS_COMPLEX_SHIFT_SOLVER_H
32 template <
typename OpType = DenseGenComplexShiftSolve<
double>>
79 SimpleRandom<Scalar>
rng(0);
98 const Complex root1 = root_part1 + root_part2;
99 const Complex root2 = root_part1 - root_part2;
103 for (
int k = 0; k <
m_n; k++)
105 const Complex rhs1 =
Complex(v_real[k], v_imag[k]) / (root1 - shift);
106 const Complex rhs2 =
Complex(v_real[k], v_imag[k]) / (root2 - shift);
108 err1 += norm(OPv - rhs1);
109 err2 += norm(OPv - rhs2);
112 const Complex lambdaj = (err1 < err2) ? root1 : root2;
159 #endif // SPECTRA_GEN_EIGS_COMPLEX_SHIFT_SOLVER_H