From b9fbf3978c13d0e64bbc1c01e6e36737cb608ae6 Mon Sep 17 00:00:00 2001 From: Tommy Hofmann Date: Fri, 26 Apr 2024 18:49:29 +0200 Subject: [PATCH] dasd --- src/AlgAss/radical.jl | 2 +- src/Misc/FiniteField.jl | 8 ++++---- src/ModAlgAss/MeatAxe.jl | 6 ++---- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/AlgAss/radical.jl b/src/AlgAss/radical.jl index 4dcca99381..44650736e8 100644 --- a/src/AlgAss/radical.jl +++ b/src/AlgAss/radical.jl @@ -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}, Ref{Nemo.fmpz_mod_ctx_struct}), Mtemp, B, base_ring(B).inv) + 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 diff --git a/src/Misc/FiniteField.jl b/src/Misc/FiniteField.jl index e006f6aa31..ee7e57ee3d 100644 --- a/src/Misc/FiniteField.jl +++ b/src/Misc/FiniteField.jl @@ -1,11 +1,11 @@ function _reduce(a::fqPolyRepFieldElem) A = parent(a) - #if a.length < 2*degree(A) + 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)) - #end + else + 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 function _reduce(a::FqPolyRepFieldElem) diff --git a/src/ModAlgAss/MeatAxe.jl b/src/ModAlgAss/MeatAxe.jl index af5987699c..90b7ac790b 100644 --- a/src/ModAlgAss/MeatAxe.jl +++ b/src/ModAlgAss/MeatAxe.jl @@ -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