DGtal  1.0.0
DGtal::EigenDecomposition< TN, TComponent, TMatrix > Class Template Reference

Aim: This class provides methods to compute the eigen decomposition of a matrix. Its objective is to replace a specialized matrix library when none are available. More...

#include <DGtal/math/linalg/EigenDecomposition.h>

## Public Types

typedef TComponent Component
the type of each coefficient, i.e. scalar More...

typedef Component Quantity
the type of scalar (i.e. Component) More...

typedef PointVector< N, ComponentRowVector
the type for row vectors (1xN) More...

typedef PointVector< M, ComponentColumnVector
the type for column vectors (Nx1) More...

typedef ColumnVector Vector
an alias for column vectors (Nx1) More...

typedef TMatrix Matrix
the type for matrices (NxN) More...

## Static Public Member Functions

static void tridiagonalize (Matrix &V, Vector &d, Vector &e)
Reduces a real symmetric matrix to a symmetric tridiagonal matrix using and accumulating orthogonal similarity transformations. More...

static void decomposeQL (Matrix &V, Vector &d, Vector e)
finds the eigenvalues and eigenvectors of a symmetric tridiagonal matrix by the QL method. The eigenvectors of a full symmetric matric can also be found if tridiagonalize() has been used to reduce this full matrix to tridiagonal form. More...

static void getEigenDecomposition (const Matrix &matrix, Matrix &eigenVectors, Vector &eigenValues)
Compute both eigen vectors and eigen values from an input matrix. More...

## Static Public Attributes

static const DGtal::Dimension M = TN

static const DGtal::Dimension N = TN

static const DGtal::Dimension dimension = TN
Usual static constant for dimension. More...

static const DGtal::Dimension dimensionMinusOne = TN - 1
Static constant for dimension - 1. More...

## Private Member Functions

BOOST_CONCEPT_ASSERT ((concepts::CEuclideanRing< TComponent >))

BOOST_STATIC_ASSERT (TN > 0)

## Detailed Description

### template<DGtal::Dimension TN, typename TComponent, typename TMatrix = SimpleMatrix<TComponent, TN, TN>> class DGtal::EigenDecomposition< TN, TComponent, TMatrix >

Aim: This class provides methods to compute the eigen decomposition of a matrix. Its objective is to replace a specialized matrix library when none are available.

Description of template class 'EigenDecomposition'

This class provides static services and is not really supposed to be instantiated.

Note
This is derived from the Algol procedures tred2 and tql2 by Bowdler, Martin, Reinsch and Wilkinson, Handbook for Auto. Comp., Vol.ii-Linear Algebra, and the corresponding Fortran subroutine in EISPACK.
Template Parameters
 TN the size TN of the matrix TN x TN. TComponent the type of each component of the matrix. For now, should be some double or float type. TMatrix a model of CMatrix, for instance SimpleMatrix.
Examples
examples/tutorial-examples/polyhedralizer.cpp, geometry/volumes/dvcm-2d.cpp, and tutorial-examples/polyhedralizer.cpp.

Definition at line 86 of file EigenDecomposition.h.

## ◆ ColumnVector

template<DGtal::Dimension TN, typename TComponent , typename TMatrix = SimpleMatrix<TComponent, TN, TN>>
 typedef PointVector DGtal::EigenDecomposition< TN, TComponent, TMatrix >::ColumnVector

the type for column vectors (Nx1)

Definition at line 99 of file EigenDecomposition.h.

## ◆ Component

template<DGtal::Dimension TN, typename TComponent , typename TMatrix = SimpleMatrix<TComponent, TN, TN>>
 typedef TComponent DGtal::EigenDecomposition< TN, TComponent, TMatrix >::Component

the type of each coefficient, i.e. scalar

Definition at line 94 of file EigenDecomposition.h.

## ◆ Matrix

template<DGtal::Dimension TN, typename TComponent , typename TMatrix = SimpleMatrix<TComponent, TN, TN>>
 typedef TMatrix DGtal::EigenDecomposition< TN, TComponent, TMatrix >::Matrix

the type for matrices (NxN)

Definition at line 101 of file EigenDecomposition.h.

## ◆ Quantity

template<DGtal::Dimension TN, typename TComponent , typename TMatrix = SimpleMatrix<TComponent, TN, TN>>
 typedef Component DGtal::EigenDecomposition< TN, TComponent, TMatrix >::Quantity

the type of scalar (i.e. Component)

Definition at line 97 of file EigenDecomposition.h.

## ◆ RowVector

template<DGtal::Dimension TN, typename TComponent , typename TMatrix = SimpleMatrix<TComponent, TN, TN>>
 typedef PointVector DGtal::EigenDecomposition< TN, TComponent, TMatrix >::RowVector

the type for row vectors (1xN)

Definition at line 98 of file EigenDecomposition.h.

## ◆ Vector

template<DGtal::Dimension TN, typename TComponent , typename TMatrix = SimpleMatrix<TComponent, TN, TN>>
 typedef ColumnVector DGtal::EigenDecomposition< TN, TComponent, TMatrix >::Vector

an alias for column vectors (Nx1)

Definition at line 100 of file EigenDecomposition.h.

## ◆ BOOST_CONCEPT_ASSERT()

template<DGtal::Dimension TN, typename TComponent , typename TMatrix = SimpleMatrix<TComponent, TN, TN>>
 DGtal::EigenDecomposition< TN, TComponent, TMatrix >::BOOST_CONCEPT_ASSERT ( (concepts::CEuclideanRing< TComponent >) )
private

## ◆ BOOST_STATIC_ASSERT()

template<DGtal::Dimension TN, typename TComponent , typename TMatrix = SimpleMatrix<TComponent, TN, TN>>
 DGtal::EigenDecomposition< TN, TComponent, TMatrix >::BOOST_STATIC_ASSERT ( TN , 0 )
private

## ◆ decomposeQL()

template<DGtal::Dimension TN, typename TComponent , typename TMatrix = SimpleMatrix<TComponent, TN, TN>>
 static void DGtal::EigenDecomposition< TN, TComponent, TMatrix >::decomposeQL ( Matrix & V, Vector & d, Vector e )
static

finds the eigenvalues and eigenvectors of a symmetric tridiagonal matrix by the QL method. The eigenvectors of a full symmetric matric can also be found if tridiagonalize() has been used to reduce this full matrix to tridiagonal form.

This is derived from the Algol procedures tred2 and tql2 by Bowdler, Martin, Reinsch and Wilkinson, Handbook for Auto. Comp., Vol.ii-Linear Algebra, and the corresponding Fortran subroutine in EISPACK.

Parameters
 [in] e contains the subdiagonal elements of the input matrix in its last n-1 positions. e(0) is arbitrary. [in,out] d input: the diagonal elements of the input matrix / output: orthonormal eigenvalues in ascending order. [in,out] V input: transformation matrix produced in the reduction by tridiagonalize(), if performed. If the eigenvectors of the tridiagonal matrix are desired, V must contain the identity matrix / output: orthonormal eigenvectors of the symmetric tridiagonal (or full) transformation matrix.
Todo:
Sorting the eigenvalues is done by selection sort. This could be improved for big values of TN.

## ◆ getEigenDecomposition()

template<DGtal::Dimension TN, typename TComponent , typename TMatrix = SimpleMatrix<TComponent, TN, TN>>
 static void DGtal::EigenDecomposition< TN, TComponent, TMatrix >::getEigenDecomposition ( const Matrix & matrix, Matrix & eigenVectors, Vector & eigenValues )
static

Compute both eigen vectors and eigen values from an input matrix.

This is derived from the Algol procedures tred2 and tql2 by Bowdler, Martin, Reinsch and Wilkinson, Handbook for Auto. Comp., Vol.ii-Linear Algebra, and the corresponding Fortran subroutine in EISPACK.

Parameters
 [in] matrix 3D matrix whose eigen values/vectors are computed (size = dimension * dimension). [out] eigenVectors matrix of eigenvectors (size = dimension * dimension). Eigenvectors are put in column. [out] eigenValues vector of eigenvalues (size = dimension), sorted in ascending order (smallest to highest).

## ◆ tridiagonalize()

template<DGtal::Dimension TN, typename TComponent , typename TMatrix = SimpleMatrix<TComponent, TN, TN>>
 static void DGtal::EigenDecomposition< TN, TComponent, TMatrix >::tridiagonalize ( Matrix & V, Vector & d, Vector & e )
static

Reduces a real symmetric matrix to a symmetric tridiagonal matrix using and accumulating orthogonal similarity transformations.

This is derived from the Algol procedures tred2 and tql2 by Bowdler, Martin, Reinsch and Wilkinson, Handbook for Auto. Comp., Vol.ii-Linear Algebra, and the corresponding Fortran subroutine in EISPACK.

Parameters
 [in,out] V input: symmetric matrix / output: the orthogonal transformation matrix produced in the reduction. [out] d contains the diagonal elements of the tridiagonal matrix. [out] e contains the subdiagonal elements of the tridiagonal matrix in its last n-1 positions. e is set to 0.

## ◆ dimension

template<DGtal::Dimension TN, typename TComponent , typename TMatrix = SimpleMatrix<TComponent, TN, TN>>
 const DGtal::Dimension DGtal::EigenDecomposition< TN, TComponent, TMatrix >::dimension = TN
static

Usual static constant for dimension.

Definition at line 107 of file EigenDecomposition.h.

## ◆ dimensionMinusOne

template<DGtal::Dimension TN, typename TComponent , typename TMatrix = SimpleMatrix<TComponent, TN, TN>>
 const DGtal::Dimension DGtal::EigenDecomposition< TN, TComponent, TMatrix >::dimensionMinusOne = TN - 1
static

Static constant for dimension - 1.

Definition at line 109 of file EigenDecomposition.h.

## ◆ M

template<DGtal::Dimension TN, typename TComponent , typename TMatrix = SimpleMatrix<TComponent, TN, TN>>
 const DGtal::Dimension DGtal::EigenDecomposition< TN, TComponent, TMatrix >::M = TN
static

Definition at line 95 of file EigenDecomposition.h.

## ◆ N

template<DGtal::Dimension TN, typename TComponent , typename TMatrix = SimpleMatrix<TComponent, TN, TN>>
 const DGtal::Dimension DGtal::EigenDecomposition< TN, TComponent, TMatrix >::N = TN
static

Definition at line 96 of file EigenDecomposition.h.

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