SmithNormalForm-0.1.0.0: A lightweight Haskell implementation of Smith normal form over the integers.
Safe HaskellNone
LanguageHaskell2010

Data.Matrix.SmithNormalForm.Internal

Synopsis

Documentation

smithNF :: Integral a => Matrix a -> Matrix a Source #

Main method that returns the Smith normal form of a given matrix.

rectifyDiagonal :: Integral a => Matrix a -> [a] Source #

Given a diagonal matrix, outputs a list \([d_1,..,d_n]\) that satisfies \(d_k \mid d_{k+1}\) and represents the diagonal entries. Assumes input is a diagonal matrix (not checked).

diagonalize :: Integral a => Matrix a -> Matrix a Source #

Given a matrix, returns a diagonal matrix obtained by applying elementary row and column operations, but which does not necessarily satisfy the divisibility property

isDiagonalMatrix :: (Num a, Eq a) => Matrix a -> Bool Source #

Returns whether a matrix (not necessarily square) is diagonal

divides :: Integral a => a -> a -> Bool Source #

Returns whether a divides b := \(a \mid b\) and handles the special case of \(a=0\)