7 #ifndef SPECTRA_SYM_EIGS_SHIFT_SOLVER_H
8 #define SPECTRA_SYM_EIGS_SHIFT_SOLVER_H
12 #include "SymEigsBase.h"
13 #include "Util/SelectionRule.h"
14 #include "MatOp/DenseSymShiftSolve.h"
148 template <
typename OpType = DenseSymShiftSolve<
double>>
152 using Scalar =
typename OpType::Scalar;
153 using Index = Eigen::Index;
154 using Array = Eigen::Array<Scalar, Eigen::Dynamic, 1>;
158 using Base::m_ritz_val;
160 const Scalar m_sigma;
163 void sort_ritzpair(
SortRule sort_rule)
override
167 m_ritz_val.head(m_nev).array() = Scalar(1) / m_ritz_val.head(m_nev).array() + m_sigma;
168 Base::sort_ritzpair(sort_rule);
191 Base(op, IdentityBOp(), nev, ncv),
194 op.set_shift(m_sigma);
SymEigsShiftSolver(OpType &op, Index nev, Index ncv, const Scalar &sigma)