Go to the documentation of this file.
7 #ifndef SPECTRA_GEN_EIGS_BASE_H
8 #define SPECTRA_GEN_EIGS_BASE_H
37 template <
typename OpType,
typename BOpType>
176 if (nev_new == 1 &&
m_ncv >= 6)
178 else if (nev_new == 1 &&
m_ncv > 3)
181 if (nev_new >
m_ncv - 2)
203 std::vector<Index>
ind;
208 SortEigenvalue<Complex, SortRule::LargestMagn> sorting(evals.
data(),
m_ncv);
214 SortEigenvalue<Complex, SortRule::LargestReal> sorting(evals.
data(),
m_ncv);
220 SortEigenvalue<Complex, SortRule::LargestImag> sorting(evals.
data(),
m_ncv);
226 SortEigenvalue<Complex, SortRule::SmallestMagn> sorting(evals.
data(),
m_ncv);
232 SortEigenvalue<Complex, SortRule::SmallestReal> sorting(evals.
data(),
m_ncv);
238 SortEigenvalue<Complex, SortRule::SmallestImag> sorting(evals.
data(),
m_ncv);
243 throw std::invalid_argument(
"unsupported selection rule");
263 std::vector<Index>
ind;
303 throw std::invalid_argument(
"unsupported sorting rule");
335 if (nev < 1 || nev >
m_n - 2)
336 throw std::invalid_argument(
"nev must satisfy 1 <= nev <= n - 2, n is the size of matrix");
338 if (ncv < nev + 2 || ncv >
m_n)
339 throw std::invalid_argument(
"ncv must satisfy nev + 2 <= ncv <= n, n is the size of matrix");
345 virtual ~GenEigsBase() {}
388 SimpleRandom<Scalar>
rng(0);
424 Index i, nconv = 0, nev_adj;
425 for (
i = 0;
i < maxit;
i++)
532 #endif // SPECTRA_GEN_EIGS_BASE_H
RealScalar f_norm() const
@ LargestReal
Select eigenvalues with largest real part. Only for general eigen solvers.
ComplexMatrix eigenvectors(Index nvec) const
ComplexMatrix eigenvectors() const
@ Successful
Computation was successful.
Array< double, 1, 3 > e(1./3., 0.5, 2.)
virtual void sort_ritzpair(SortRule sort_rule)
void init(MapConstVec &v0, Index &op_counter)
const Matrix & matrix_H() const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void swap(DenseBase< OtherDerived > &other)
const Matrix & matrix_V() const
Index compute(SortRule selection=SortRule::LargestMagn, Index maxit=1000, Scalar tol=1e-10, SortRule sorting=SortRule::LargestMagn)
std::complex< Scalar > Complex
static bool is_conj(const Complex &v1, const Complex &v2)
void compute(ConstGenericMatrix &mat, const Scalar &s, const Scalar &t)
General-purpose arrays with easy API for coefficient-wise operations.
@ SmallestImag
Select eigenvalues with smallest imaginary part (in magnitude). Only for general eigen solvers.
cout<< "Here is the matrix m:"<< endl<< m<< endl;Matrix< ptrdiff_t, 3, 1 > res
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void resize(Index rows, Index cols)
const ComplexVector & eigenvalues() const
void apply_YQ(GenericMatrix Y) const
void restart(Index k, SortRule selection)
Index nev_adjusted(Index nconv)
ComplexMatrix eigenvectors()
virtual void compute(ConstGenericMatrix &mat, const Scalar &shift=Scalar(0))
void apply_YQ(GenericMatrix Y) const
@ SmallestReal
Select eigenvalues with smallest real part. Only for general eigen solvers.
Index num_iterations() const
typename DenseGenComplexShiftSolve< double > ::Scalar Scalar
void compress_V(const Eigen::MatrixBase< Derived > &Q)
Jet< T, N > pow(const Jet< T, N > &f, double g)
AnnoyingScalar conj(const AnnoyingScalar &x)
A matrix or vector expression mapping an existing array of data.
void compress_H(const DoubleShiftQR< Scalar > &decomp)
@ LargestImag
Select eigenvalues with largest imaginary part (in magnitude). Only for general eigen solvers.
The quaternion class used to represent 3D orientations and rotations.
Array< int, Dynamic, 1 > v
virtual void factorize_from(Index from_k, Index to_m, Index &op_counter)
EIGEN_DEVICE_FUNC const EIGEN_STRONG_INLINE Scalar * data() const
Index num_converged(const Scalar &tol)
EIGEN_DEVICE_FUNC Derived & setZero(Index size)
static bool is_complex(const Complex &v)
ArnoldiOp< Scalar, OpType, BOpType > ArnoldiOpType
ComplexVector eigenvalues() const
void retrieve_ritzpair(SortRule selection)
void init(const Scalar *init_resid)
Index num_operations() const
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
gtsam
Author(s):
autogenerated on Sun Feb 16 2025 04:01:23