7 #ifndef SPECTRA_SYM_GEIGS_SOLVER_H
8 #define SPECTRA_SYM_GEIGS_SOLVER_H
10 #include "SymEigsBase.h"
11 #include "Util/GEigsMode.h"
12 #include "MatOp/internal/SymGEigsCholeskyOp.h"
13 #include "MatOp/internal/SymGEigsRegInvOp.h"
44 template <
typename OpType,
typename BOpType, GEigsMode Mode>
148 template <
typename OpType,
typename BOpType>
150 public SymEigsBase<SymGEigsCholeskyOp<OpType, BOpType>, IdentityBOp>
153 using Scalar =
typename OpType::Scalar;
154 using Index = Eigen::Index;
155 using Matrix = Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic>;
156 using Vector = Eigen::Matrix<Scalar, Eigen::Dynamic, 1>;
158 using ModeMatOp = SymGEigsCholeskyOp<OpType, BOpType>;
161 const BOpType& m_Bop;
189 Base(ModeMatOp(op, Bop), IdentityBOp(), nev, ncv),
195 Matrix eigenvectors(Index nvec)
const override
197 Matrix res = Base::eigenvectors(nvec);
198 Vector tmp(res.rows());
199 const Index nconv = res.cols();
200 for (Index i = 0; i < nconv; i++)
202 m_Bop.upper_triangular_solve(&res(0, i), tmp.data());
203 res.col(i).noalias() = tmp;
209 Matrix eigenvectors()
const override
250 template <
typename OpType,
typename BOpType>
252 public SymEigsBase<SymGEigsRegInvOp<OpType, BOpType>, BOpType>
255 using Index = Eigen::Index;
257 using ModeMatOp = SymGEigsRegInvOp<OpType, BOpType>;
284 Base(ModeMatOp(op, Bop), Bop, nev, ncv)
virtual Matrix eigenvectors() const
SymGEigsSolver(OpType &op, BOpType &Bop, Index nev, Index ncv)
SymGEigsSolver(OpType &op, BOpType &Bop, Index nev, Index ncv)
@ RegularInverse
Regular inverse mode for generalized eigenvalue solver.
@ Cholesky
Using Cholesky decomposition to solve generalized eigenvalues.