oILAB
Loading...
Searching...
No Matches
oILAB::SmithDecomposition< N > Class Template Reference

#include <SmithDecomposition.h>

Public Member Functions

 SmithDecomposition (const MatrixNi &A)
 
const MatrixNimatrixU () const
 
const MatrixNimatrixD () const
 
const MatrixNimatrixV () const
 
const MatrixNimatrixX () const
 
const MatrixNimatrixY () const
 

Private Types

typedef long long int IntValueType
 
typedef Eigen::Matrix< IntValueType, N, N > MatrixNi
 

Private Member Functions

void row_signChange (const int &ID)
 
void col_signChange (const int &ID)
 
void row_swap (const int &i, const int &j)
 
void col_swap (const int &i, const int &j)
 
void row_add_multiply (const int &i, const int &j, const IntValueType &n)
 
void col_add_multiply (const int &i, const int &j, const IntValueType &n)
 
bool reduceFirstRow ()
 
bool reduceFirstCol ()
 

Static Private Member Functions

static IntValueType gcd (const IntValueType &a, const IntValueType &b)
 
template<typename Derived >
static IntValueType gcd (const Eigen::MatrixBase< Derived > &v)
 
static std::pair< int, int > findNonZero (const MatrixNi &A)
 
static std::pair< int, int > findNonDivisible (const MatrixNi &A)
 

Private Attributes

MatrixNi D
 
MatrixNi U
 
MatrixNi V
 
MatrixNi X
 
MatrixNi Y
 

Detailed Description

template<int N>
class oILAB::SmithDecomposition< N >

Class template which computes the Smith normal (or canonical) form of a square matrix of integers A.

The decomposition is: A=X*D*Y where X and Y are unimodular integers matrices D is a diagonal ingeter matrix such that D(k,k) divides D(k+1,k+1) The class also computes the matrices U and V such that D=U*A*V where U=inv(X) and V=inv(Y) are also unimodular integer matrices.

Definition at line 26 of file SmithDecomposition.h.

Member Typedef Documentation

◆ IntValueType

template<int N>
typedef long long int oILAB::SmithDecomposition< N >::IntValueType
private

Definition at line 27 of file SmithDecomposition.h.

◆ MatrixNi

template<int N>
typedef Eigen::Matrix<IntValueType, N, N> oILAB::SmithDecomposition< N >::MatrixNi
private

Definition at line 28 of file SmithDecomposition.h.

Constructor & Destructor Documentation

◆ SmithDecomposition()

template<int N>
oILAB::SmithDecomposition< N >::SmithDecomposition ( const MatrixNi A)
inline

The algorithm follows section 2 in GEORGE HAVAS AND BOHDAN S. MAJEWSKI, Integer Matrix Diagonalization, J. Symbolic Computation (1997) 24, 399–408.

Definition at line 198 of file SmithDecomposition.h.

Member Function Documentation

◆ col_add_multiply()

template<int N>
void oILAB::SmithDecomposition< N >::col_add_multiply ( const int &  i,
const int &  j,
const IntValueType n 
)
inlineprivate

Definition at line 136 of file SmithDecomposition.h.

◆ col_signChange()

template<int N>
void oILAB::SmithDecomposition< N >::col_signChange ( const int &  ID)
inlineprivate

Definition at line 82 of file SmithDecomposition.h.

◆ col_swap()

template<int N>
void oILAB::SmithDecomposition< N >::col_swap ( const int &  i,
const int &  j 
)
inlineprivate

Definition at line 107 of file SmithDecomposition.h.

◆ findNonDivisible()

template<int N>
static std::pair< int, int > oILAB::SmithDecomposition< N >::findNonDivisible ( const MatrixNi A)
inlinestaticprivate

Definition at line 58 of file SmithDecomposition.h.

◆ findNonZero()

template<int N>
static std::pair< int, int > oILAB::SmithDecomposition< N >::findNonZero ( const MatrixNi A)
inlinestaticprivate

Definition at line 46 of file SmithDecomposition.h.

◆ gcd() [1/2]

template<int N>
template<typename Derived >
static IntValueType oILAB::SmithDecomposition< N >::gcd ( const Eigen::MatrixBase< Derived > &  v)
inlinestaticprivate

Definition at line 37 of file SmithDecomposition.h.

◆ gcd() [2/2]

template<int N>
static IntValueType oILAB::SmithDecomposition< N >::gcd ( const IntValueType a,
const IntValueType b 
)
inlinestaticprivate

Definition at line 31 of file SmithDecomposition.h.

◆ matrixD()

template<int N>
const MatrixNi & oILAB::SmithDecomposition< N >::matrixD ( ) const
inline

Definition at line 290 of file SmithDecomposition.h.

◆ matrixU()

template<int N>
const MatrixNi & oILAB::SmithDecomposition< N >::matrixU ( ) const
inline

Definition at line 287 of file SmithDecomposition.h.

◆ matrixV()

template<int N>
const MatrixNi & oILAB::SmithDecomposition< N >::matrixV ( ) const
inline

Definition at line 293 of file SmithDecomposition.h.

◆ matrixX()

template<int N>
const MatrixNi & oILAB::SmithDecomposition< N >::matrixX ( ) const
inline

Definition at line 296 of file SmithDecomposition.h.

◆ matrixY()

template<int N>
const MatrixNi & oILAB::SmithDecomposition< N >::matrixY ( ) const
inline

Definition at line 299 of file SmithDecomposition.h.

◆ reduceFirstCol()

template<int N>
bool oILAB::SmithDecomposition< N >::reduceFirstCol ( )
inlineprivate

Definition at line 171 of file SmithDecomposition.h.

◆ reduceFirstRow()

template<int N>
bool oILAB::SmithDecomposition< N >::reduceFirstRow ( )
inlineprivate

Definition at line 151 of file SmithDecomposition.h.

◆ row_add_multiply()

template<int N>
void oILAB::SmithDecomposition< N >::row_add_multiply ( const int &  i,
const int &  j,
const IntValueType n 
)
inlineprivate

Definition at line 121 of file SmithDecomposition.h.

◆ row_signChange()

template<int N>
void oILAB::SmithDecomposition< N >::row_signChange ( const int &  ID)
inlineprivate

Definition at line 71 of file SmithDecomposition.h.

◆ row_swap()

template<int N>
void oILAB::SmithDecomposition< N >::row_swap ( const int &  i,
const int &  j 
)
inlineprivate

Definition at line 93 of file SmithDecomposition.h.

Field Documentation

◆ D

template<int N>
MatrixNi oILAB::SmithDecomposition< N >::D
private

Definition at line 190 of file SmithDecomposition.h.

◆ U

template<int N>
MatrixNi oILAB::SmithDecomposition< N >::U
private

Definition at line 191 of file SmithDecomposition.h.

◆ V

template<int N>
MatrixNi oILAB::SmithDecomposition< N >::V
private

Definition at line 192 of file SmithDecomposition.h.

◆ X

template<int N>
MatrixNi oILAB::SmithDecomposition< N >::X
private

Definition at line 193 of file SmithDecomposition.h.

◆ Y

template<int N>
MatrixNi oILAB::SmithDecomposition< N >::Y
private

Definition at line 194 of file SmithDecomposition.h.


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