Public API
This consists of all of the exported functions and objects available to the end user.
Factorizations
NormalForms.hnfc! — Functionhnfc!(M::AbstractMatrix{<:Integer}, R::RoundingMode = NegativeOffDiagonal)
-> ColumnHermite{eltype(M),typeof(M)}Calculates the column Hermite normal form of the integer matrix M in-place, returning a ColumnHermite describing the elements of the factorization.
NormalForms.hnfc — Functionhnfc(M::AbstractMatrix{T<:Integer}) -> ColumnHermite{T,typeof(M)}
-> ColumnHermite{eltype(M),typeof(M)}Calculates the column Hermite normal form of the integer matrix M in-place, returning a ColumnHermite describing the elements of the factorization. Unlike hnfc!(), this function creates a copy of the input matrix rather than modifying it in-place.
NormalForms.hnfr! — Functionhnfr!(M::AbstractMatrix{<:Integer}, R::RoundingMode = NegativeOffDiagonal)
-> RowHermite{eltype(M),typeof(M)}Calculates the row Hermite normal form of the integer matrix M in-place, returning a RowHermite describing the elements of the factorization.
NormalForms.hnfr — Functionhnfr(M::AbstractMatrix{<:Integer}, R::RoundingMode = NegativeOffDiagonal)
-> RowHermite{eltype(M),typeof(M)}Calculates the row Hermite normal form of the integer matrix M in-place, returning a RowHermite describing the elements of the factorization. Unlike hnfr!(), this function creates a copy of the input matrix rather than modifying it in-place.
NormalForms.snf! — Functionsnf(M::AbstractMatrix{<:Integer}) -> Smith{eltype(M),M}Calculates the Smith normal form of an integer matrix in-place.
NormalForms.snf — Functionsnf(M::AbstractMatrix{<:Integer}) -> Smith{eltype(M),M}Calculates the Smith normal form of an integer matrix, returning a copy of the original matrix.
Helper functions
NormalForms.isunimodular — Functionisunimodular(M::AbstractMatrix)Returns true if a matrix is unimodular. A unimodular matrix is a square integer matrix with A determinant equal to 1 or -1.
Factorization objects
NormalForms.AbstractHermite — TypeAbstractHermite{T<:Integer,M<:AbstractMatrix{T}} <: Factorization{T}Supertype for the result of Hermite normal form calculations.
NormalForms.RowHermite — TypeRowHermite{T<:Integer,M<:AbstractMatrix{T}}Describes the result of a decomposition of an integer matrix A into its row-style Hermite normal form H, which is upper triangular, and a unimodular matrix U, such that H == U*A, or equivalently, A = U\H.
NormalForms.ColumnHermite — TypeColumnHermite{T<:Integer,M<:AbstractMatrix{T}}Describes the result of a decomposition of an integer matrix A into its row-style Hermite normal form H, which is lower triangular, and a unimodular matrix U, such that H == A*U, or equivalently, A == H/U.
NormalForms.Smith — TypeSmith{T,M<:AbstractMatrix{T}} <: Factorization{T}Describes the result of the decomposition of an integer matrix A into its Smith normal form S, which is diagonal, and unimodular matrices U and V such that S == U*A*V, or equivalently, A == U\S/V.
Reduction modes
NormalForms.NegativeOffDiagonal — ConstantNegativeOffDiagonalAlias for RoundUp. In NormalForms.reduce_cols_off_diagonal!(), this makes all off-diagonal elements the smallest negative value possible.
NormalForms.PositiveOffDiagonal — ConstantPositiveOffDiagonalAlias for RoundDown. In NormalForms.reduce_cols_off_diagonal!(), this makes all off-diagonal elements the smallest positive value possible.