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...
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.
template<
DGtal::Dimension TN, typename TComponent , typename TMatrix = SimpleMatrix<TComponent, TN, TN>>
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.
template<
DGtal::Dimension TN, typename TComponent , typename TMatrix = SimpleMatrix<TComponent, TN, TN>>
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). |
Referenced by DGtal::functors::TensorVotingFeatureExtraction< TSurfel, TEmbedder >::eval(), LSF(), DGtal::CorrectedNormalCurrentComputer< TRealPoint, TRealVector >::principalCurvatures(), and DGtal::NormalCycleComputer< TRealPoint, TRealVector >::principalCurvatures().
template<
DGtal::Dimension TN, typename TComponent , typename TMatrix = SimpleMatrix<TComponent, TN, TN>>
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[0] is set to 0. |