11 #ifndef EIGEN_MATRIXBASEEIGENVALUES_H 12 #define EIGEN_MATRIXBASEEIGENVALUES_H 15 #include "./InternalHeaderCheck.h" 21 template <
typename Derived,
bool IsComplex>
22 struct eigenvalues_selector {
24 static inline typename MatrixBase<Derived>::EigenvaluesReturnType
const run(
const MatrixBase<Derived>& m) {
25 typedef typename Derived::PlainObject PlainObject;
26 PlainObject m_eval(m);
27 return ComplexEigenSolver<PlainObject>(m_eval,
false).eigenvalues();
31 template <
typename Derived>
32 struct eigenvalues_selector<Derived, false> {
33 static inline typename MatrixBase<Derived>::EigenvaluesReturnType
const run(
const MatrixBase<Derived>& m) {
34 typedef typename Derived::PlainObject PlainObject;
35 PlainObject m_eval(m);
36 return EigenSolver<PlainObject>(m_eval,
false).eigenvalues();
62 template <
typename Derived>
64 return internal::eigenvalues_selector<Derived, NumTraits<Scalar>::IsComplex>::run(derived());
81 template <
typename MatrixType,
unsigned int UpLo>
84 PlainObject thisAsMatrix(*
this);
110 template <
typename Derived>
113 typename Derived::PlainObject m_eval(derived());
116 return sqrt((m_eval * m_eval.adjoint()).eval().template selfadjointView<Lower>().eigenvalues().maxCoeff());
134 template <
typename MatrixType,
unsigned int UpLo>
137 return eigenvalues().cwiseAbs().maxCoeff();
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_sqrt_op< typename Derived::Scalar >, const Derived > sqrt(const Eigen::ArrayBase< Derived > &x)
Computes eigenvalues and eigenvectors of selfadjoint matrices.
Definition: SelfAdjointEigenSolver.h:82
Namespace containing all symbols from the Eigen library.
Definition: B01_Experimental.dox:1
RealScalar operatorNorm() const
Computes the L2 operator norm.
Definition: MatrixBaseEigenvalues.h:136
NumTraits< Scalar >::Real RealScalar
Definition: SelfAdjointView.h:228
RealScalar operatorNorm() const
Computes the L2 operator norm.
Definition: MatrixBaseEigenvalues.h:111
EigenvaluesReturnType eigenvalues() const
Computes the eigenvalues of a matrix.
Definition: MatrixBaseEigenvalues.h:83
The matrix class, also used for vectors and row-vectors.
Definition: Matrix.h:186
EigenvaluesReturnType eigenvalues() const
Computes the eigenvalues of a matrix.
Definition: MatrixBaseEigenvalues.h:63
Base class for all dense matrices, vectors, and expressions.
Definition: MatrixBase.h:52