Skip to content

hnfc fails on a 3x3 matrix, with det == 10: AssertionError: U is not unimodular. #25

@glwhart

Description

@glwhart

I've made good use of NormalForms.jl since the SNF bug I exposed was fixed. Thanks. I was surprised to run into this error in the hnfc function on a 3x3 matrix.

julia> A = [-7 -2 10; -1 0 0; 0 -1 0]
3×3 Matrix{Int64}:
 -7  -2  10
 -1   0   0
  0  -1   0

julia> hnfc(A)
ERROR: AssertionError: U is not unimodular.
Stacktrace:
 [1] ColumnHermite(H::Matrix{Int64}, U::Matrix{Int64}, info::Int64)
   @ NormalForms ~/.julia/packages/NormalForms/oFF45/src/hermite.jl:63
 [2] hnfc! (repeats 2 times)
   @ ~/.julia/packages/NormalForms/oFF45/src/hermite.jl:162 [inlined]
 [3] hnfc(M::Matrix{Int64})
   @ NormalForms ~/.julia/packages/NormalForms/oFF45/src/hermite.jl:173
 [4] top-level scope
   @ REPL[74]:1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions