11#ifndef EIGEN_MATRIXBASEEIGENVALUES_H
12#define EIGEN_MATRIXBASEEIGENVALUES_H
15#include "./InternalHeaderCheck.h"
21template <
typename Derived,
bool IsComplex>
22struct 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();
31template <
typename Derived>
32struct 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();
62template <
typename Derived>
64 return internal::eigenvalues_selector<Derived, NumTraits<Scalar>::IsComplex>::run(derived());
81template <
typename MatrixType,
unsigned int UpLo>
84 PlainObject thisAsMatrix(*
this);
110template <
typename Derived>
113 typename Derived::PlainObject m_eval(derived());
116 return sqrt((m_eval * m_eval.adjoint()).eval().template selfadjointView<Lower>().eigenvalues().maxCoeff());
134template <
typename MatrixType,
unsigned int UpLo>
137 return eigenvalues().cwiseAbs().maxCoeff();
Base class for all dense matrices, vectors, and expressions.
Definition MatrixBase.h:52
The matrix class, also used for vectors and row-vectors.
Definition Matrix.h:186
Computes eigenvalues and eigenvectors of selfadjoint matrices.
Definition SelfAdjointEigenSolver.h:82
const RealVectorType & eigenvalues() const
Returns the eigenvalues of given matrix.
Definition SelfAdjointEigenSolver.h:300
Expression of a selfadjoint matrix from a triangular part of a dense matrix.
Definition SelfAdjointView.h:51
NumTraits< Scalar >::Real RealScalar
Definition SelfAdjointView.h:228
Namespace containing all symbols from the Eigen library.
Definition Core:137