-
Notifications
You must be signed in to change notification settings - Fork 79
Description
In AA we have in src/Matrix.jl:5059:
function hnf_kb!(H, U, with_trafo::Bool = false, start_element::Int = 1)
Actually with https://github.com/Nemocas/AbstractAlgebra.jl/pull/2256 it will become
function hnf_kb!(H::MatrixElem{T}, U::MatrixElem{T}, with_trafo::Bool = false, start_element::Int = 1) where {T <: RingElement}
In Hecke, we have in src/LocalField/Matrix.jl:95:
function AbstractAlgebra.hnf_kb!(H::MatrixElem{T}, U::MatrixElem{T}, with_trafo::Bool = false, start_element::Int = 1) where T <: Hecke.LocalFieldValuationRingElem
Looking at the code, this is almost identical to the code in AA. The differences are:
- a bunch irrelevant ones (commented out debug code, addition of
AbstractAlgebra.prefixes, the restriction ofTtoLocalFieldValuationRingElem) - a switch from
gcdxto the undocumentedgcdxx - insertion of
pivot_max = col1of anif with_trafoblock
I am mostly concerned about point 3. As I see it, most likely this is either a bug in the Hecke version of the code (e.g. accidental leftover from some debugging); or it is a fix for an issue, but then shouldn't it also be in AA?
The fact that 3 happens only inside an if with_trafo makes me consider the "it's a bug" version as more likely (it is also indented incorrectly, further supporting this).
Regarding point 2, using gcdxx seems indeed superior to the code in AA (which uses gcdx plus some divisions)? So it'd be nice to use it in AA as well. Then we could delete the copy of hnf_kb! in Hecke. But that would require adding a bunch of "missing" gcdxx methods (resp. adding one general "fallback" method which calls gcdx ? and then as many as we can that are optimized)