oILAB
Loading...
Searching...
No Matches
gbLAB::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 gbLAB::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 28 of file SmithDecomposition.h.

Member Typedef Documentation

◆ IntValueType

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

Definition at line 30 of file SmithDecomposition.h.

◆ MatrixNi

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

Definition at line 31 of file SmithDecomposition.h.

Constructor & Destructor Documentation

◆ SmithDecomposition()

template<int N>
gbLAB::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 219 of file SmithDecomposition.h.

Member Function Documentation

◆ col_add_multiply()

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

Definition at line 147 of file SmithDecomposition.h.

◆ col_signChange()

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

Definition at line 95 of file SmithDecomposition.h.

◆ col_swap()

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

Definition at line 120 of file SmithDecomposition.h.

◆ findNonDivisible()

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

Definition at line 68 of file SmithDecomposition.h.

◆ findNonZero()

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

Definition at line 52 of file SmithDecomposition.h.

◆ gcd() [1/2]

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

Definition at line 41 of file SmithDecomposition.h.

◆ gcd() [2/2]

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

Definition at line 34 of file SmithDecomposition.h.

◆ matrixD()

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

Definition at line 319 of file SmithDecomposition.h.

◆ matrixU()

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

Definition at line 313 of file SmithDecomposition.h.

◆ matrixV()

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

Definition at line 325 of file SmithDecomposition.h.

◆ matrixX()

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

Definition at line 331 of file SmithDecomposition.h.

◆ matrixY()

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

Definition at line 337 of file SmithDecomposition.h.

◆ reduceFirstCol()

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

Definition at line 185 of file SmithDecomposition.h.

◆ reduceFirstRow()

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

Definition at line 160 of file SmithDecomposition.h.

◆ row_add_multiply()

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

Definition at line 134 of file SmithDecomposition.h.

◆ row_signChange()

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

Definition at line 84 of file SmithDecomposition.h.

◆ row_swap()

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

Definition at line 106 of file SmithDecomposition.h.

Field Documentation

◆ D

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

Definition at line 209 of file SmithDecomposition.h.

◆ U

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

Definition at line 210 of file SmithDecomposition.h.

◆ V

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

Definition at line 211 of file SmithDecomposition.h.

◆ X

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

Definition at line 212 of file SmithDecomposition.h.

◆ Y

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

Definition at line 213 of file SmithDecomposition.h.


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