Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wildart/smithnormalform.jl
Smith normal form (SNF) decomposition
https://github.com/wildart/smithnormalform.jl
Last synced: 20 days ago
JSON representation
Smith normal form (SNF) decomposition
- Host: GitHub
- URL: https://github.com/wildart/smithnormalform.jl
- Owner: wildart
- License: other
- Created: 2017-05-24T21:47:45.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-01-02T17:20:40.000Z (almost 2 years ago)
- Last Synced: 2023-03-25T22:02:30.594Z (over 1 year ago)
- Language: Julia
- Homepage:
- Size: 31.3 KB
- Stars: 5
- Watchers: 3
- Forks: 4
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Smith Normal Form
[![Build Status](https://travis-ci.org/wildart/SmithNormalForm.jl.svg?branch=master)](https://travis-ci.org/wildart/SmithNormalForm.jl)
[![Coverage Status](https://coveralls.io/repos/wildart/SmithNormalForm.jl/badge.svg?branch=master&service=github)](https://coveralls.io/github/wildart/SmithNormalForm.jl?branch=master)The [Smith normal form](https://en.wikipedia.org/wiki/Smith_normal_form) decomposition over integer domain implementation in Julia.
## Installation
For Julia 1.1+, add [BoffinStuff](https://github.com/wildart/BoffinStuff.git) registry in the package manager, and proceed with the installation:
```
pkg> registry add https://github.com/wildart/BoffinStuff.git
pkg> add SmithNormalForm
```## Example
```julia
julia> using SmithNormalForm, LinearAlgebrajulia> M = [2 4 4; -6 6 12; 10 -4 -16]
3×3 Array{Int64,2}:
2 4 4
-6 6 12
10 -4 -16julia> F = smith(M)
Smith normal form:
[2 0 0; 0 6 0; 0 0 12]julia> F.S
3×3 Array{Int64,2}:
1 0 0
-3 1 0
5 -2 1julia> F.T
3×3 Array{Int64,2}:
1 2 2
0 3 4
0 1 1julia> diagm(F)
3×3 Array{Int64,2}:
2 0 0
0 6 0
0 0 12julia> F.S*diagm(F)*F.T
3×3 Array{Int64,2}:
2 4 4
-6 6 12
10 -4 -16
```