Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust to flint 3 #1475

Merged
merged 7 commits into from
May 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "Hecke"
uuid = "3e1990a7-5d81-5526-99ce-9ba3ff248f21"
version = "0.31.4"
version = "0.31.5"

[deps]
AbstractAlgebra = "c3fe647b-3220-5bb0-a1ea-a7954cac585d"
Expand Down Expand Up @@ -37,7 +37,7 @@ LazyArtifacts = "1.6"
Libdl = "1.6"
LinearAlgebra = "1.6"
Markdown = "1.6"
Nemo = "^0.44.0"
Nemo = "^0.45.0"
Pkg = "1.6"
Polymake = "0.10, 0.11"
Printf = "1.6"
Expand Down
2 changes: 1 addition & 1 deletion src/AlgAss/radical.jl
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ function _lift!(A::zzModMatrix, B::fpMatrix, Mtemp)
end

function _lift!(A::zzModMatrix, B::FpMatrix, Mtemp::ZZMatrix)
ccall((:fmpz_mod_mat_get_fmpz_mat, libflint), Cvoid, (Ref{ZZMatrix}, Ref{FpMatrix}), Mtemp, B)
ccall((:fmpz_mod_mat_get_fmpz_mat, libflint), Cvoid, (Ref{ZZMatrix}, Ref{FpMatrix}, Ref{Nemo.fmpz_mod_ctx_struct}), Mtemp, B, base_ring(B).ninv)
ccall((:fmpz_mat_get_nmod_mat, libflint), Cvoid, (Ref{zzModMatrix}, Ref{ZZMatrix}), A, Mtemp)
return A
end
7 changes: 5 additions & 2 deletions src/Hecke.jl
Original file line number Diff line number Diff line change
Expand Up @@ -391,8 +391,11 @@ _get_attributes(G::Map{<:Any, <:Any, HeckeMap, <:Any}) = _get_attributes(G.heade
_get_attributes!(G::Map{<:Any, <:Any, HeckeMap, <:Any}) = _get_attributes!(G.header)
_is_attribute_storing_type(::Type{Map{<:Any, <:Any, HeckeMap, <:Any}}) = true

import Nemo: libflint, libantic, libarb #to be able to reference libraries by full path
#to avoid calling the "wrong" copy
import Nemo: libflint #to be able to reference libraries by full path
#to avoid calling the "wrong" copy

const libantic = libflint
const libarb = libflint

################################################################################
#
Expand Down
2 changes: 1 addition & 1 deletion src/Misc/Arb.jl
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ function abs_upper_bound(::Type{ZZRingElem}, x::ArbFieldElem)
ccall((:arb_get_abs_ubound_arf, libarb), Nothing,
(Ref{arf_struct}, Ref{ArbFieldElem}, Int), tarf, x, 64)

if ccall((:arf_is_nan, Nemo.libarb), Bool, (Ref{arf_struct}, ), tarf)
if ccall((:arf_is_nan, libarb), Bool, (Ref{arf_struct}, ), tarf)
throw(Base.InexactError(:abs_upper_bound, x, ZZRingElem))
end

Expand Down
2 changes: 1 addition & 1 deletion src/Misc/FiniteField.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ function _reduce(a::fqPolyRepFieldElem)
if a.length < 2*degree(A)
ccall((:fq_nmod_reduce, libflint), Nothing, (Ref{fqPolyRepFieldElem}, Ref{fqPolyRepField}), a, A)
else
ccall((:nmod_poly_rem, libflint), Nothing, (Ref{fqPolyRepFieldElem}, Ref{fqPolyRepFieldElem}, Ref{Nothing}, Ref{Nothing}), a, a, pointer_from_objref(A)+6*sizeof(Int) + 2*sizeof(Ptr{Nothing}), pointer_from_objref(A)+sizeof(ZZRingElem))
ccall((:nmod_poly_rem, libflint), Nothing, (Ref{fqPolyRepFieldElem}, Ref{fqPolyRepFieldElem}, Ref{Nothing}, Ref{Nothing}), a, a, pointer_from_objref(A)+6*sizeof(Int) + sizeof(Ptr{Nothing}), pointer_from_objref(A)+sizeof(ZZRingElem))
end
end

Expand Down
2 changes: 1 addition & 1 deletion src/Misc/Matrix.jl
Original file line number Diff line number Diff line change
Expand Up @@ -982,7 +982,7 @@ function invmod(M::ZZMatrix, d::ZZRingElem)
for i = 1:nrows(M)
S[i, i+nrows(M)] = 1
end
ccall((:fmpz_mod_mat_howell_form, libflint), Nothing, (Ref{ZZModMatrix}, ), S)
ccall((:fmpz_mod_mat_howell_form, libflint), Nothing, (Ref{ZZModMatrix}, Ref{Nemo.fmpz_mod_ctx_struct}), S, R.ninv)
iM = S[1:nrows(M), nrows(M)+1:ncols(S)]
#@assert iM*MR == identity_matrix(R, nrows(M))
return lift(iM)
Expand Down
2 changes: 1 addition & 1 deletion src/Misc/Poly.jl
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ end

function _inv_compose_mod(z::ZZModPolyRingElem)
r = reverse(z)
ccall((:fmpz_mod_poly_inv_series_newton, libflint), Nothing,
ccall((:fmpz_mod_poly_inv_series, libflint), Nothing,
(Ref{ZZModPolyRingElem}, Ref{ZZModPolyRingElem}, Int, Ref{fmpz_mod_ctx_struct}), r, r, length(r), z.parent.base_ring.ninv)
return r
end
Expand Down
6 changes: 2 additions & 4 deletions src/ModAlgAss/MeatAxe.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1176,11 +1176,9 @@ function powermod(f::Zmodn_poly, e::ZZRingElem, g::Zmodn_poly)
if fits(Int, e)
return powermod(f, Int(e), g)
else
_e = BigInt()
z = parent(f)()
ccall((:fmpz_get_mpz, libflint), Nothing, (Ref{BigInt}, Ref{ZZRingElem}), _e, e)
ccall((:nmod_poly_powmod_mpz_binexp, libflint), Nothing,
(Ref{Zmodn_poly}, Ref{Zmodn_poly}, Ref{BigInt}, Ref{Zmodn_poly}),
ccall((:nmod_poly_powmod_fmpz_binexp, libflint), Nothing,
(Ref{Zmodn_poly}, Ref{Zmodn_poly}, Ref{ZZRingElem}, Ref{Zmodn_poly}),
z, f, e, g)
return z
end
Expand Down
Loading