DGtal  1.3.beta
EigenDecomposition.h
1 
17 #pragma once
18 
40 #if defined(EigenDecomposition_RECURSES)
41 #error Recursive header files inclusion detected in EigenDecomposition.h
42 #else // defined(EigenDecomposition_RECURSES)
43 
44 #define EigenDecomposition_RECURSES
45 
46 #if !defined EigenDecomposition_h
47 
48 #define EigenDecomposition_h
49 
51 // Inclusions
52 #include <iostream>
53 #include "DGtal/base/Common.h"
54 #include "DGtal/kernel/PointVector.h"
55 #include "DGtal/math/linalg/SimpleMatrix.h"
57 
58 namespace DGtal
59 {
61  // template class EigenDecomposition
85  template <DGtal::Dimension TN, typename TComponent, typename TMatrix=SimpleMatrix<TComponent, TN, TN> >
87  {
88  // BOOST_CONCEPT_ASSERT(( CMatrix<TMatrix> ));
90  BOOST_STATIC_ASSERT(TN > 0 );
91 
92  // ----------------------- Public types -----------------------------------
93  public:
94  typedef TComponent Component;
95  static const DGtal::Dimension M = TN;
96  static const DGtal::Dimension N = TN;
97  typedef Component Quantity;
101  typedef TMatrix Matrix;
102 
103 
104  // ----------------------- Static constants ------------------------------
105  public:
107  static const DGtal::Dimension dimension = TN;
109  static const DGtal::Dimension dimensionMinusOne = TN - 1;
110 
111  // ----------------------- Static services ------------------------------
112  public:
113 
127  static void tridiagonalize( Matrix& V, Vector& d, Vector& e );
128 
151  static void decomposeQL( Matrix& V, Vector& d, Vector e );
152 
165  static void getEigenDecomposition( const Matrix& matrix, Matrix& eigenVectors, Vector& eigenValues );
166 
167 
168  // ------------------------- Protected Datas ------------------------------
169  private:
170  // ------------------------- Private Datas --------------------------------
171  private:
172 
173  // ------------------------- Hidden services ------------------------------
174  protected:
175 
176 
177  // ------------------------- Internals ------------------------------------
178  private:
179 
180  }; // end of class EigenDecomposition
181 
182 } // namespace DGtal
183 
184 
186 // Includes inline functions.
187 #include "DGtal/math/linalg/EigenDecomposition.ih"
188 
189 // //
191 
192 #endif // !defined EigenDecomposition_h
193 
194 #undef EigenDecomposition_RECURSES
195 #endif // else defined(EigenDecomposition_RECURSES)
DGtal::EigenDecomposition::BOOST_STATIC_ASSERT
BOOST_STATIC_ASSERT(TN > 0)
DGtal::EigenDecomposition::N
static const DGtal::Dimension N
Definition: EigenDecomposition.h:96
DGtal::EigenDecomposition::RowVector
PointVector< N, Component > RowVector
the type for row vectors (1xN)
Definition: EigenDecomposition.h:98
DGtal::EigenDecomposition::Vector
ColumnVector Vector
an alias for column vectors (Nx1)
Definition: EigenDecomposition.h:100
DGtal::EigenDecomposition::getEigenDecomposition
static void getEigenDecomposition(const Matrix &matrix, Matrix &eigenVectors, Vector &eigenValues)
Compute both eigen vectors and eigen values from an input matrix.
DGtal::EigenDecomposition
Aim: This class provides methods to compute the eigen decomposition of a matrix. Its objective is to ...
Definition: EigenDecomposition.h:86
DGtal::Dimension
DGtal::uint32_t Dimension
Definition: Common.h:137
DGtal::EigenDecomposition::Component
TComponent Component
the type of each coefficient, i.e. scalar
Definition: EigenDecomposition.h:94
DGtal::EigenDecomposition::decomposeQL
static void decomposeQL(Matrix &V, Vector &d, Vector e)
finds the eigenvalues and eigenvectors of a symmetric tridiagonal matrix by the QL method....
DGtal::EigenDecomposition::Matrix
TMatrix Matrix
the type for matrices (NxN)
Definition: EigenDecomposition.h:101
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
DGtal::EigenDecomposition::BOOST_CONCEPT_ASSERT
BOOST_CONCEPT_ASSERT((concepts::CEuclideanRing< TComponent >))
DGtal::concepts::CEuclideanRing
Aim: Defines the mathematical concept equivalent to a unitary commutative ring with a division operat...
Definition: CEuclideanRing.h:87
DGtal::EigenDecomposition::dimensionMinusOne
static const DGtal::Dimension dimensionMinusOne
Static constant for dimension - 1.
Definition: EigenDecomposition.h:109
DGtal::EigenDecomposition::Quantity
Component Quantity
the type of scalar (i.e. Component)
Definition: EigenDecomposition.h:97
DGtal::EigenDecomposition::M
static const DGtal::Dimension M
Definition: EigenDecomposition.h:95
DGtal::PointVector
Aim: Implements basic operations that will be used in Point and Vector classes.
Definition: PointVector.h:165
DGtal::EigenDecomposition::ColumnVector
PointVector< M, Component > ColumnVector
the type for column vectors (Nx1)
Definition: EigenDecomposition.h:99
DGtal::EigenDecomposition::tridiagonalize
static void tridiagonalize(Matrix &V, Vector &d, Vector &e)
Reduces a real symmetric matrix to a symmetric tridiagonal matrix using and accumulating orthogonal s...
DGtal::EigenDecomposition::dimension
static const DGtal::Dimension dimension
Usual static constant for dimension.
Definition: EigenDecomposition.h:107