Go to the documentation of this file.
7 #ifndef SPECTRA_HERM_EIGS_BASE_H
8 #define SPECTRA_HERM_EIGS_BASE_H
43 template <
typename OpType,
typename BOpType>
96 std::vector<OpType> container;
97 container.emplace_back(std::move(rval));
115 const int nshift =
m_ncv - k;
117 std::sort(shifts.
data(), shifts.
data() + nshift,
187 if (nev_new == 1 &&
m_ncv >= 6)
189 else if (nev_new == 1 &&
m_ncv > 2)
192 if (nev_new >
m_ncv - 1)
206 std::vector<Index>
ind = argsort(selection, evals,
m_ncv);
227 throw std::invalid_argument(
"unsupported sorting rule");
261 if (nev < 1 || nev >
m_n - 1)
262 throw std::invalid_argument(
"nev must satisfy 1 <= nev <= n - 1, n is the size of matrix");
264 if (ncv <= nev || ncv >
m_n)
265 throw std::invalid_argument(
"ncv must satisfy nev < ncv <= n, n is the size of matrix");
269 HermEigsBase(OpType&& op,
const BOpType& Bop,
Index nev,
Index ncv) :
280 if (nev < 1 || nev >
m_n - 1)
281 throw std::invalid_argument(
"nev must satisfy 1 <= nev <= n - 1, n is the size of matrix");
283 if (ncv <= nev || ncv >
m_n)
284 throw std::invalid_argument(
"ncv must satisfy nev < ncv <= n, n is the size of matrix");
290 virtual ~HermEigsBase() {}
333 SimpleRandom<Scalar>
rng(0);
367 Index i, nconv = 0, nev_adj;
368 for (
i = 0;
i < maxit;
i++)
477 #endif // SPECTRA_HERM_EIGS_BASE_H
void factorize_from(Index from_k, Index to_m, Index &op_counter) override
RealScalar f_norm() const
static std::vector< OpType > create_op_container(OpType &&rval)
@ Successful
Computation was successful.
void init(const Scalar *init_resid)
Array< double, 1, 3 > e(1./3., 0.5, 2.)
void init(MapConstVec &v0, Index &op_counter)
const Matrix & matrix_H() const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void swap(DenseBase< OtherDerived > &other)
Index num_iterations() const
const Matrix & matrix_V() const
Index num_converged(const RealScalar &tol)
General-purpose arrays with easy API for coefficient-wise operations.
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)
virtual void sort_ritzpair(SortRule sort_rule)
const Vector & eigenvalues() const
Index num_operations() const
Index nev_adjusted(Index nconv)
typename Eigen::NumTraits< Scalar >::Real RealScalar
void retrieve_ritzpair(SortRule selection)
void apply_YQ(GenericMatrix Y) const
void compress_V(const Eigen::MatrixBase< Derived > &Q)
Jet< T, N > pow(const Jet< T, N > &f, double g)
A matrix or vector expression mapping an existing array of data.
virtual Matrix eigenvectors(Index nvec) const
void restart(Index k, SortRule selection)
const Matrix & eigenvectors() const
The quaternion class used to represent 3D orientations and rotations.
detail::enable_if_t<!detail::move_never< T >::value, T > move(object &&obj)
typename DenseSymShiftSolve< double > ::Scalar Scalar
void compute(ConstGenericMatrix &mat, const Scalar &shift=Scalar(0)) override
EIGEN_DEVICE_FUNC const EIGEN_STRONG_INLINE Scalar * data() const
ArnoldiOp< Scalar, OpType, BOpType > ArnoldiOpType
virtual Matrix eigenvectors() const
@ SmallestAlge
Select eigenvalues with smallest algebraic value. Only for symmetric eigen solvers.
EIGEN_DEVICE_FUNC Derived & setZero(Index size)
void compress_H(const TridiagQR< RealScalar > &decomp)
std::vector< OpType > m_op_container
RealVector eigenvalues() const
Index compute(SortRule selection=SortRule::LargestMagn, Index maxit=1000, RealScalar tol=1e-10, SortRule sorting=SortRule::LargestAlge)
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
gtsam
Author(s):
autogenerated on Fri Mar 28 2025 03:01:39