7 #ifndef SPECTRA_GEN_EIGS_REAL_SHIFT_SOLVER_H
8 #define SPECTRA_GEN_EIGS_REAL_SHIFT_SOLVER_H
12 #include "GenEigsBase.h"
13 #include "Util/SelectionRule.h"
14 #include "MatOp/DenseGenRealShiftSolve.h"
32 template <
typename OpType = DenseGenRealShiftSolve<
double>>
36 using Scalar =
typename OpType::Scalar;
37 using Index = Eigen::Index;
38 using Complex = std::complex<Scalar>;
39 using ComplexArray = Eigen::Array<Complex, Eigen::Dynamic, 1>;
43 using Base::m_ritz_val;
48 void sort_ritzpair(
SortRule sort_rule)
override
52 m_ritz_val.head(m_nev) = Scalar(1) / m_ritz_val.head(m_nev).array() + m_sigma;
53 Base::sort_ritzpair(sort_rule);
76 Base(op, IdentityBOp(), nev, ncv),
79 op.set_shift(m_sigma);
GenEigsRealShiftSolver(OpType &op, Index nev, Index ncv, const Scalar &sigma)