Safe Haskell | None |
---|
Algorithms.CL.SNF
Description
Code to convert a (non-square) matrix to Smith Normal Form.
- matrixFromList :: [[a]] -> SNFMatrix a
- structureConstantsFromMatrix :: (Show int, Integral int) => SNFMatrix int -> [int]
- classNumberFromMatrix :: (Show int, Integral int) => SNFMatrix int -> int
- testSNF :: IO ()
Documentation
matrixFromList :: [[a]] -> SNFMatrix aSource
Construct an SNFMatrix
from a list.
structureConstantsFromMatrix :: (Show int, Integral int) => SNFMatrix int -> [int]Source
Compute the structure constants from a matrix by re-expressing the matrix in Smith Normal Form and extracting the (nonzero) diagonal. Note that the structure constants are not sorted according to the definition of SNF. This is because for this algorithm we are interested in their product, so order does not matter.
classNumberFromMatrix :: (Show int, Integral int) => SNFMatrix int -> intSource
Compute the class number from a matrix by re-expressing the matrix in Smith Normal Form and taking the product of the nonzero entries on the diagonal.