Linear
Linear::Eigendecomposition< T, N, Flags > Struct Template Reference

Struct for Eigendecomposition. More...

#include <Decomp.h>

Public Member Functions

template<size_t M2, size_t N2, unsigned int Flags2>
 Eigendecomposition (const Matrix< T, M2, N2, Flags2 > &A)
 Constructor. More...
 
template<size_t M2, size_t N2, unsigned int Flags2>
void Compute (const Matrix< T, M2, N2, Flags2 > &A)
 Computes the Eigendecomposition. More...
 

Public Attributes

SquareMatrix< T, N, Flags > Q
 
SquareMatrix< T, N, Flags > D
 
SquareMatrix< T, N, Flags > Qinv
 

Detailed Description

template<typename T, size_t N, unsigned int Flags = 0>
struct Linear::Eigendecomposition< T, N, Flags >

Struct for Eigendecomposition.

This struct finds NxN matrix Q and NxN matrix D such that \(A=QDQ^{-1}\), D is diagonal with entries equaling the eigenvalues of A and V's columns are the corresponding eigenvectors of A. Only diagonalizable matrices can be decomposed in this fashion.

Parameters
TType to store matrix entries as.
NNumber of rows/columns for L and D (both square). Dynamic is allowed for N.
FlagsFlags to pass to the matrices (default = row major).

Constructor & Destructor Documentation

◆ Eigendecomposition()

template<typename T , size_t N, unsigned int Flags = 0>
template<size_t M2, size_t N2, unsigned int Flags2>
Linear::Eigendecomposition< T, N, Flags >::Eigendecomposition ( const Matrix< T, M2, N2, Flags2 > &  A)
inline

Constructor.

Just calls Compute.

Parameters
AM2xN2 Matrix

Member Function Documentation

◆ Compute()

template<typename T , size_t N, unsigned int Flags = 0>
template<size_t M2, size_t N2, unsigned int Flags2>
void Linear::Eigendecomposition< T, N, Flags >::Compute ( const Matrix< T, M2, N2, Flags2 > &  A)
inline

Computes the Eigendecomposition.

If A is not square or Q != N, then an exception is thrown. If the matrix is not diagonalizable, an exception will be thrown.

Parameters
AM2xN2 Matrix

Member Data Documentation

◆ D

template<typename T , size_t N, unsigned int Flags = 0>
SquareMatrix<T,N,Flags> Linear::Eigendecomposition< T, N, Flags >::D

Diagonal matrix containing the eigenvalues of A

◆ Q

template<typename T , size_t N, unsigned int Flags = 0>
SquareMatrix<T,N,Flags> Linear::Eigendecomposition< T, N, Flags >::Q

Comprised of the eigenvectors of A

◆ Qinv

template<typename T , size_t N, unsigned int Flags = 0>
SquareMatrix<T,N,Flags> Linear::Eigendecomposition< T, N, Flags >::Qinv

Qinv=Inverse(Q)


The documentation for this struct was generated from the following file: