7 #ifndef GEN_EIGS_COMPLEX_SHIFT_SOLVER_H
8 #define GEN_EIGS_COMPLEX_SHIFT_SOLVER_H
37 template <
typename Scalar = double,
39 typename OpType = DenseGenComplexShiftSolve<double> >
77 SimpleRandom<Scalar>
rng(0);
96 const Complex root1 = root_part1 + root_part2;
97 const Complex root2 = root_part1 - root_part2;
101 for (
int k = 0; k < this->
m_n; k++)
103 const Complex rhs1 =
Complex(v_real[k], v_imag[k]) / (root1 - shift);
104 const Complex rhs2 =
Complex(v_real[k], v_imag[k]) / (root2 - shift);
106 err1 += norm(OPv - rhs1);
107 err2 += norm(OPv - rhs2);
110 const Complex lambdaj = (err1 < err2) ? root1 : root2;
157 #endif // GEN_EIGS_COMPLEX_SHIFT_SOLVER_H