smith: Smith Normal Form of a matrix.

Description Usage Arguments Details Value See Also Examples

View source: R/homology_calculation.R

Description

This calculates the Smith Normal Form of a Matrix.

Usage

1
smith(S)

Arguments

S

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

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.

Value

A matrix.

See Also

check_more_push, push_down, hermiteNF

Examples

1
2
3
4
5
6
7
8
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

Example output

     [,1] [,2] [,3]
[1,]    2    0    0
[2,]    0    6    0
[3,]    0    0   12

quhomology documentation built on May 1, 2019, 8:44 p.m.