Learn R Programming

quhomology (version 1.1.1)

smith: Smith Normal Form of a matrix.

Description

This calculates the Smith Normal Form of a Matrix.

Usage

smith(S)

Arguments

S

A matrix of which one wants to calculate the Smith Normal Form.

Value

A matrix.

Details

This calculates the Smith Normal Form of a Matrix based on repeated calculation of the Hermite Normal Form of the matrix and its transpose.

See Also

check_more_push, push_down, hermiteNF

Examples

Run this code
# NOT RUN {
test_mat <- matrix(c(2,4,4, -6,6,12, 10,-4,-16), nrow=3, ncol=3, byrow=TRUE)
smith(test_mat)
#######
#output:

#  2    0    0
#  0    6    0
#  0    0   12
# }

Run the code above in your browser using DataLab