Please, help us to better know about our user community by answering the following short survey: https://forms.gle/wpyrxWi18ox9Z5ae9 Eigen  3.3.9 Eigen::SelfAdjointView< _MatrixType, UpLo > Class Template Reference

## Detailed Description

### template<typename _MatrixType, unsigned int UpLo> class Eigen::SelfAdjointView< _MatrixType, UpLo >

Expression of a selfadjoint matrix from a triangular part of a dense matrix.

Parameters
 MatrixType the type of the dense matrix storing the coefficients TriangularPart can be either Lower or Upper

This class is an expression of a sefladjoint matrix from a triangular part of a matrix with given dense storage of the coefficients. It is the return type of MatrixBase::selfadjointView() and most of the time this is the only way that it is used.

See also
class TriangularBase, MatrixBase::selfadjointView() Inheritance diagram for Eigen::SelfAdjointView< _MatrixType, UpLo >:

## Public Types

typedef Matrix< RealScalar, internal::traits< MatrixType >::ColsAtCompileTime, 1 > EigenvaluesReturnType

typedef NumTraits< Scalar >::Real RealScalar

typedef internal::traits< SelfAdjointView >::Scalar Scalar
The type of coefficients in this matrix. Public Types inherited from Eigen::EigenBase< SelfAdjointView< _MatrixType, UpLo > >
typedef Eigen::Index Index
The interface type of indices. More...

## Public Member Functions

const AdjointReturnType adjoint () const

Scalar coeff (Index row, Index col) const

ScalarcoeffRef (Index row, Index col)

const ConjugateReturnType conjugate () const

MatrixType::ConstDiagonalReturnType diagonal () const

EigenvaluesReturnType eigenvalues () const
Computes the eigenvalues of a matrix. More...

const LDLT< PlainObject, UpLo > ldlt () const

const LLT< PlainObject, UpLo > llt () const

template<typename OtherDerived >
const Product< SelfAdjointView, OtherDerived > operator* (const MatrixBase< OtherDerived > &rhs) const

RealScalar operatorNorm () const
Computes the L2 operator norm. More...

template<typename DerivedU , typename DerivedV >
SelfAdjointViewrankUpdate (const MatrixBase< DerivedU > &u, const MatrixBase< DerivedV > &v, const Scalar &alpha=Scalar(1))

template<typename DerivedU >
SelfAdjointViewrankUpdate (const MatrixBase< DerivedU > &u, const Scalar &alpha=Scalar(1))

TransposeReturnType transpose ()

const ConstTransposeReturnType transpose () const

template<unsigned int TriMode>
internal::conditional<(TriMode &(Upper|Lower))==(UpLo &(Upper|Lower)), TriangularView< MatrixType, TriMode >, TriangularView< typename MatrixType::AdjointReturnType, TriMode > >::type triangularView () const Public Member Functions inherited from Eigen::TriangularBase< SelfAdjointView< _MatrixType, UpLo > >
void copyCoeff (Index row, Index col, Other &other)

void evalTo (MatrixBase< DenseDerived > &other) const

void evalToLazy (MatrixBase< DenseDerived > &other) const Public Member Functions inherited from Eigen::EigenBase< SelfAdjointView< _MatrixType, UpLo > >
Index cols () const

SelfAdjointView< _MatrixType, UpLo > & derived ()

const SelfAdjointView< _MatrixType, UpLo > & derived () const

Index rows () const

Index size () const

## ◆ EigenvaluesReturnType

template<typename _MatrixType , unsigned int UpLo>
 typedef Matrix::ColsAtCompileTime, 1> Eigen::SelfAdjointView< _MatrixType, UpLo >::EigenvaluesReturnType

Return type of eigenvalues()

## ◆ RealScalar

template<typename _MatrixType , unsigned int UpLo>
 typedef NumTraits::Real Eigen::SelfAdjointView< _MatrixType, UpLo >::RealScalar

Real part of Scalar

## ◆ adjoint()

template<typename _MatrixType , unsigned int UpLo>
 const AdjointReturnType Eigen::SelfAdjointView< _MatrixType, UpLo >::adjoint ( ) const
inline

## ◆ coeff()

template<typename _MatrixType , unsigned int UpLo>
 Scalar Eigen::SelfAdjointView< _MatrixType, UpLo >::coeff ( Index row, Index col ) const
inline
See also
MatrixBase::coeff()
Warning
the coordinates must fit into the referenced triangular part

## ◆ coeffRef()

template<typename _MatrixType , unsigned int UpLo>
 Scalar& Eigen::SelfAdjointView< _MatrixType, UpLo >::coeffRef ( Index row, Index col )
inline
See also
MatrixBase::coeffRef()
Warning
the coordinates must fit into the referenced triangular part

## ◆ conjugate()

template<typename _MatrixType , unsigned int UpLo>
 const ConjugateReturnType Eigen::SelfAdjointView< _MatrixType, UpLo >::conjugate ( ) const
inline
See also
MatrixBase::conjugate() const

## ◆ diagonal()

template<typename _MatrixType , unsigned int UpLo>
 MatrixType::ConstDiagonalReturnType Eigen::SelfAdjointView< _MatrixType, UpLo >::diagonal ( ) const
inline
Returns
a const expression of the main diagonal of the matrix *this

This method simply returns the diagonal of the nested expression, thus by-passing the SelfAdjointView decorator.

See also
MatrixBase::diagonal(), class Diagonal

## ◆ eigenvalues()

template<typename MatrixType , unsigned int UpLo>
 SelfAdjointView< MatrixType, UpLo >::EigenvaluesReturnType Eigen::SelfAdjointView< MatrixType, UpLo >::eigenvalues
inline

Computes the eigenvalues of a matrix.

Returns
Column vector containing the eigenvalues.

This is defined in the Eigenvalues module.

#include <Eigen/Eigenvalues>

This function computes the eigenvalues with the help of the SelfAdjointEigenSolver class. The eigenvalues are repeated according to their algebraic multiplicity, so there are as many eigenvalues as rows in the matrix.

Example:

MatrixXd ones = MatrixXd::Ones(3,3);
VectorXd eivals = ones.selfadjointView<Lower>().eigenvalues();
cout << "The eigenvalues of the 3x3 matrix of ones are:" << endl << eivals << endl;

Output:

The eigenvalues of the 3x3 matrix of ones are:
-3.09e-16
0
3

See also
SelfAdjointEigenSolver::eigenvalues(), MatrixBase::eigenvalues()

## ◆ ldlt()

template<typename MatrixType , unsigned int UpLo>
 const LDLT< typename SelfAdjointView< MatrixType, UpLo >::PlainObject, UpLo > Eigen::SelfAdjointView< MatrixType, UpLo >::ldlt
inline

This is defined in the Cholesky module.

#include <Eigen/Cholesky>
Returns
the Cholesky decomposition with full pivoting without square root of *this
See also
MatrixBase::ldlt()

## ◆ llt()

template<typename MatrixType , unsigned int UpLo>
 const LLT< typename SelfAdjointView< MatrixType, UpLo >::PlainObject, UpLo > Eigen::SelfAdjointView< MatrixType, UpLo >::llt
inline

This is defined in the Cholesky module.

#include <Eigen/Cholesky>
Returns
the LLT decomposition of *this
See also
SelfAdjointView::llt()

## ◆ operator*()

template<typename _MatrixType , unsigned int UpLo>
template<typename OtherDerived >
 const Product Eigen::SelfAdjointView< _MatrixType, UpLo >::operator* ( const MatrixBase< OtherDerived > & rhs ) const
inline

Efficient triangular matrix times vector/matrix product

## ◆ operatorNorm()

template<typename MatrixType , unsigned int UpLo>
 SelfAdjointView< MatrixType, UpLo >::RealScalar Eigen::SelfAdjointView< MatrixType, UpLo >::operatorNorm
inline

Computes the L2 operator norm.

Returns
Operator norm of the matrix.

This is defined in the Eigenvalues module.

#include <Eigen/Eigenvalues>

This function computes the L2 operator norm of a self-adjoint matrix. For a self-adjoint matrix, the operator norm is the largest eigenvalue.

The current implementation uses the eigenvalues of the matrix, as computed by eigenvalues(), to compute the operator norm of the matrix.

Example:

MatrixXd ones = MatrixXd::Ones(3,3);
cout << "The operator norm of the 3x3 matrix of ones is "
<< ones.selfadjointView<Lower>().operatorNorm() << endl;

Output:

The operator norm of the 3x3 matrix of ones is 3

See also
eigenvalues(), MatrixBase::operatorNorm()

## ◆ rankUpdate() [1/2]

template<typename _MatrixType , unsigned int UpLo>
template<typename DerivedU , typename DerivedV >
 SelfAdjointView& Eigen::SelfAdjointView< _MatrixType, UpLo >::rankUpdate ( const MatrixBase< DerivedU > & u, const MatrixBase< DerivedV > & v, const Scalar & alpha = Scalar(1) )

Perform a symmetric rank 2 update of the selfadjoint matrix *this: $$this = this + \alpha u v^* + conj(\alpha) v u^*$$

Returns
a reference to *this

The vectors u and v must be column vectors, however they can be a adjoint expression without any overhead. Only the meaningful triangular part of the matrix is updated, the rest is left unchanged.

See also
rankUpdate(const MatrixBase<DerivedU>&, Scalar)

## ◆ rankUpdate() [2/2]

template<typename _MatrixType , unsigned int UpLo>
template<typename DerivedU >
 SelfAdjointView& Eigen::SelfAdjointView< _MatrixType, UpLo >::rankUpdate ( const MatrixBase< DerivedU > & u, const Scalar & alpha = Scalar(1) )

Perform a symmetric rank K update of the selfadjoint matrix *this: $$this = this + \alpha ( u u^* )$$ where u is a vector or matrix.

Returns
a reference to *this

Note that to perform $$this = this + \alpha ( u^* u )$$ you can simply call this function with u.adjoint().

See also
rankUpdate(const MatrixBase<DerivedU>&, const MatrixBase<DerivedV>&, Scalar)

## ◆ transpose() [1/2]

template<typename _MatrixType , unsigned int UpLo>
 TransposeReturnType Eigen::SelfAdjointView< _MatrixType, UpLo >::transpose ( )
inline

## ◆ transpose() [2/2]

template<typename _MatrixType , unsigned int UpLo>
 const ConstTransposeReturnType Eigen::SelfAdjointView< _MatrixType, UpLo >::transpose ( ) const
inline

## ◆ triangularView()

template<typename _MatrixType , unsigned int UpLo>
template<unsigned int TriMode>
 internal::conditional<(TriMode&(Upper|Lower))==(UpLo&(Upper|Lower)), TriangularView, TriangularView >::type Eigen::SelfAdjointView< _MatrixType, UpLo >::triangularView ( ) const
inline
Returns
an expression of a triangular view extracted from the current selfadjoint view of a given triangular part

The parameter TriMode can have the following values: Upper, StrictlyUpper, UnitUpper, Lower, StrictlyLower, UnitLower.

If TriMode references the same triangular part than *this, then this method simply return a TriangularView of the nested expression, otherwise, the nested expression is first transposed, thus returning a TriangularView<Transpose<MatrixType>> object.

See also
MatrixBase::triangularView(), class TriangularView

The documentation for this class was generated from the following files:
Eigen::SelfAdjointView::operatorNorm
RealScalar operatorNorm() const
Computes the L2 operator norm.
Definition: MatrixBaseEigenvalues.h:151
Eigen::DenseBase::Ones
static const ConstantReturnType Ones()
Definition: CwiseNullaryOp.h:597
Eigen::Lower
@ Lower
Definition: Constants.h:204
Eigen::SelfAdjointView::eigenvalues
EigenvaluesReturnType eigenvalues() const
Computes the eigenvalues of a matrix.
Definition: MatrixBaseEigenvalues.h:88