Skip to content

Commit

Permalink
Avoid use of deprecated aliases (#1556)
Browse files Browse the repository at this point in the history
  • Loading branch information
fingolfin authored Oct 18, 2023
1 parent 110d3be commit 0a10840
Show file tree
Hide file tree
Showing 30 changed files with 105 additions and 105 deletions.
18 changes: 9 additions & 9 deletions src/HeckeMiscPoly.jl
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function (::ZZRing)(a::ZZModRingElem)
return a.data
end

function rem!(z::T, f::T, g::T) where {T<:PolyElem}
function rem!(z::T, f::T, g::T) where {T<:PolyRingElem}
z = rem(f, g)
return z
end
Expand Down Expand Up @@ -311,7 +311,7 @@ end
# This should avoid the full factorization for function fields
# (and/or finitely generated fields in general?!)

function factor_squarefree(f::PolyElem{<:FieldElement})
function factor_squarefree(f::PolyRingElem{<:FieldElement})
R = coefficient_ring(f)
if iszero(characteristic(R))
return _factor_squarefree_char_0(f)
Expand All @@ -333,7 +333,7 @@ end


# This is Musser's algorithm
function _factor_squarefree_char_0(f::PolyElem)
function _factor_squarefree_char_0(f::PolyRingElem)
@assert iszero(characteristic(base_ring(f)))
res = Dict{typeof(f),Int}()
if is_constant(f)
Expand Down Expand Up @@ -407,15 +407,15 @@ function mulhigh_n(a::ZZPolyRingElem, b::ZZPolyRingElem, n::Int)
ccall((:fmpz_poly_mulhigh_n, libflint), Nothing, (Ref{ZZPolyRingElem}, Ref{ZZPolyRingElem}, Ref{ZZPolyRingElem}, Cint), c, a, b, n)
return c
end
function mulhigh(a::PolyElem{T}, b::PolyElem{T}, n::Int) where {T}
function mulhigh(a::PolyRingElem{T}, b::PolyRingElem{T}, n::Int) where {T}
return mulhigh_n(a, b, degree(a) + degree(b) - n)
end

function (f::acb_poly)(x::acb)
return evaluate(f, x)
end

function mod(f::AbstractAlgebra.PolyElem{T}, g::AbstractAlgebra.PolyElem{T}) where {T<:RingElem}
function mod(f::AbstractAlgebra.PolyRingElem{T}, g::AbstractAlgebra.PolyRingElem{T}) where {T<:RingElem}
check_parent(f, g)
if length(g) == 0
throw(DivideError())
Expand All @@ -442,7 +442,7 @@ end
normalise(f::ZZPolyRingElem, ::Int) = degree(f) + 1
set_length!(f::ZZPolyRingElem, ::Int) = nothing

function Base.divrem(f::AbstractAlgebra.PolyElem{T}, g::AbstractAlgebra.PolyElem{T}) where {T<:RingElem}
function Base.divrem(f::AbstractAlgebra.PolyRingElem{T}, g::AbstractAlgebra.PolyRingElem{T}) where {T<:RingElem}
check_parent(f, g)
if length(g) == 0
throw(DivideError())
Expand Down Expand Up @@ -479,7 +479,7 @@ end
################################################################################

@doc raw"""
Base.rand(Rt::PolyRing{T}, n::Int) where T <: ResElem{ZZRingElem} -> PolyElem{T}
Base.rand(Rt::PolyRing{T}, n::Int) where T <: ResElem{ZZRingElem} -> PolyRingElem{T}
Find a random polynomial of degree=$n$.
"""
Expand All @@ -498,7 +498,7 @@ end
#
################################################################################

function is_squarefree(f::PolyElem{<:FieldElement})
function is_squarefree(f::PolyRingElem{<:FieldElement})
R = coefficient_ring(f)

if iszero(f) || degree(f) == 0
Expand All @@ -519,7 +519,7 @@ function is_squarefree(f::PolyElem{<:FieldElement})
end
end

function is_squarefree(f::PolyElem{<:RingElement})
function is_squarefree(f::PolyRingElem{<:RingElement})
if iszero(f)
return true
end
Expand Down
6 changes: 3 additions & 3 deletions src/HeckeMoreStuff.jl
Original file line number Diff line number Diff line change
Expand Up @@ -870,7 +870,7 @@ end
# in triplicate.... and probably cases missing...
export elem_to_mat_row!

function elem_to_mat_row!(M::MatElem, i::Int, a::ResElem{T}) where {T<:PolyElem}
function elem_to_mat_row!(M::MatElem, i::Int, a::ResElem{T}) where {T<:PolyRingElem}
z = zero(parent(M[1, 1]))
for j = 0:degree(a.data)
M[i, j+1] = coeff(a.data, j)
Expand Down Expand Up @@ -1037,7 +1037,7 @@ function mul!(res::QQMPolyRingElem, a::QQMPolyRingElem, c::ZZRingElem)
end

#@doc raw"""
# is_univariate(f::Generic.MPoly{T}) where T <: NumFieldElem -> Bool, PolyElem{T}
# is_univariate(f::Generic.MPoly{T}) where T <: NumFieldElem -> Bool, PolyRingElem{T}
#
#Tests if $f$ involves only one variable. If so, return a corresponding univariate polynomial.
#"""
Expand Down Expand Up @@ -1387,7 +1387,7 @@ function defining_polynomial(k::fpField)
return x - k(1)
end

function norm(f::PolyElem{padic})
function norm(f::PolyRingElem{padic})
return f
end

Expand Down
6 changes: 3 additions & 3 deletions src/flint/fmpz.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3005,7 +3005,7 @@ is_prime_power(::IntegerUnion)
function is_prime_power(q::ZZRingElem)
iszero(q) && return false
e, a = _maximal_integer_root(q)
return isprime(a)
return is_prime(a)
end

is_prime_power(q::Integer) = is_prime_power(ZZRingElem(q))
Expand All @@ -3021,12 +3021,12 @@ is_prime_power_with_data(::IntegerUnion)
function is_prime_power_with_data(q::ZZRingElem)
iszero(q) && return false, 1, q
e, a = _maximal_integer_root(q)
return isprime(a), e, a
return is_prime(a), e, a
end

function is_prime_power_with_data(q::Integer)
e, a = _maximal_integer_root(ZZRingElem(q))
return isprime(a), e, typeof(q)(a)
return is_prime(a), e, typeof(q)(a)
end

###############################################################################
Expand Down
6 changes: 3 additions & 3 deletions src/flint/fmpz_mod_abs_series.jl
Original file line number Diff line number Diff line change
Expand Up @@ -775,7 +775,7 @@ function sqrt_classical(a::FpAbsPowerSeriesRingElem; check::Bool=true)
a = shift_right(a, v)
c = coeff(a, 0)
if check
flag, s = issquare_with_sqrt(c)
flag, s = is_square_with_sqrt(c)
if !flag
return false, S()
end
Expand Down Expand Up @@ -808,12 +808,12 @@ function Base.sqrt(a::FpAbsPowerSeriesRingElem; check::Bool=true)
return s
end

function issquare(a::FpAbsPowerSeriesRingElem)
function is_square(a::FpAbsPowerSeriesRingElem)
flag, s = sqrt_classical(a; check=true)
return flag
end

function issquare_with_sqrt(a::FpAbsPowerSeriesRingElem)
function is_square_with_sqrt(a::FpAbsPowerSeriesRingElem)
return sqrt_classical(a; check=true)
end

Expand Down
6 changes: 3 additions & 3 deletions src/flint/fmpz_mod_rel_series.jl
Original file line number Diff line number Diff line change
Expand Up @@ -994,7 +994,7 @@ function sqrt_classical(a::FpRelPowerSeriesRingElem; check::Bool=true)
z.val = v2
c = coeff(a, v)
if check
flag, s = issquare_with_sqrt(c)
flag, s = is_square_with_sqrt(c)
if !flag
return false, S()
end
Expand Down Expand Up @@ -1027,11 +1027,11 @@ function Base.sqrt(a::FpRelPowerSeriesRingElem; check::Bool=true)
return q
end

function issquare(a::FpRelPowerSeriesRingElem)
function is_square(a::FpRelPowerSeriesRingElem)
flag, q = sqrt_classical(a; check=true)
return flag
end

function issquare_with_sqrt(a::FpRelPowerSeriesRingElem)
function is_square_with_sqrt(a::FpRelPowerSeriesRingElem)
return sqrt_classical(a; check=true)
end
8 changes: 4 additions & 4 deletions src/flint/fq_abs_series.jl
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ function sqrt_classical_char2(a::($etype); check::Bool=true)
end
for i = 0:prec - 1
if check
flag, c = issquare_with_sqrt(coeff(a, 2*i))
flag, c = is_square_with_sqrt(coeff(a, 2*i))
!flag && error("Not a square")
else
# degree of finite field could be > 1 so sqrt necessary here
Expand Down Expand Up @@ -535,7 +535,7 @@ function sqrt_classical(a::($etype); check::Bool=true)
a = shift_right(a, v)
c = coeff(a, 0)
if check
flag, s = issquare_with_sqrt(c)
flag, s = is_square_with_sqrt(c)
if !flag
return false, S()
end
Expand All @@ -562,12 +562,12 @@ function Base.sqrt(a::($etype); check::Bool=true)
return s
end

function issquare(a::($etype))
function is_square(a::($etype))
flag, s = sqrt_classical(a; check=true)
return flag
end

function issquare_with_sqrt(a::($etype))
function is_square_with_sqrt(a::($etype))
return sqrt_classical(a; check=true)
end

Expand Down
8 changes: 4 additions & 4 deletions src/flint/fq_default_abs_series.jl
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ function sqrt_classical_char2(a::FqAbsPowerSeriesRingElem; check::Bool=true)
end
for i = 0:prec - 1
if check
flag, c = issquare_with_sqrt(coeff(a, 2*i))
flag, c = is_square_with_sqrt(coeff(a, 2*i))
!flag && error("Not a square")
else
# degree of finite field could be > 1 so sqrt necessary here
Expand Down Expand Up @@ -519,7 +519,7 @@ function sqrt_classical(a::FqAbsPowerSeriesRingElem; check::Bool=true)
a = shift_right(a, v)
c = coeff(a, 0)
if check
flag, s = issquare_with_sqrt(c)
flag, s = is_square_with_sqrt(c)
if !flag
return false, S()
end
Expand Down Expand Up @@ -547,12 +547,12 @@ function Base.sqrt(a::FqAbsPowerSeriesRingElem; check::Bool=true)
return s
end

function issquare(a::FqAbsPowerSeriesRingElem)
function is_square(a::FqAbsPowerSeriesRingElem)
flag, s = sqrt_classical(a; check=true)
return flag
end

function issquare_with_sqrt(a::FqAbsPowerSeriesRingElem)
function is_square_with_sqrt(a::FqAbsPowerSeriesRingElem)
return sqrt_classical(a; check=true)
end

Expand Down
2 changes: 1 addition & 1 deletion src/flint/fq_default_extended.jl
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@ function NGFiniteField(a::IntegerUnion, s::VarName = :o; cached::Bool = true, ch
end

function NGFiniteField(f::FqPolyRingElem, s::VarName = :o; cached::Bool = true, check::Bool = true, absolute::Bool = false)
(check && !isirreducible(f)) && error("Defining polynomial must be irreducible")
(check && !is_irreducible(f)) && error("Defining polynomial must be irreducible")
# Should probably have its own cache
F = FqField(f, Symbol(s), cached, absolute)
return F, gen(F)
Expand Down
4 changes: 2 additions & 2 deletions src/flint/fq_default_poly.jl
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ function sqrt(x::FqPolyRingElem; check::Bool=true)
return s
end

function issquare(x::FqPolyRingElem)
function is_square(x::FqPolyRingElem)
if iszero(x)
return true
end
Expand All @@ -409,7 +409,7 @@ function issquare(x::FqPolyRingElem)
return flag
end

function issquare_with_sqrt(x::FqPolyRingElem)
function is_square_with_sqrt(x::FqPolyRingElem)
R = parent(x)
if iszero(x)
return true, zero(R)
Expand Down
8 changes: 4 additions & 4 deletions src/flint/fq_default_rel_series.jl
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ function sqrt_classical_char2(a::FqRelPowerSeriesRingElem; check::Bool=true)
end
for i = 0:prec - aval2 - 1
c = polcoeff(a, 2*i)
if check && !issquare(c)
if check && !is_square(c)
return false, S()
end
asqrt = setcoeff!(asqrt, i, sqrt(c; check=false))
Expand Down Expand Up @@ -585,7 +585,7 @@ function sqrt_classical(a::FqRelPowerSeriesRingElem; check::Bool=true)
z.val = v2
c = coeff(a, v)
if check
flag, s = issquare_with_sqrt(c)
flag, s = is_square_with_sqrt(c)
if !flag
return false, S()
end
Expand All @@ -611,12 +611,12 @@ function Base.sqrt(a::FqRelPowerSeriesRingElem; check::Bool=true)
return q
end

function issquare(a::FqRelPowerSeriesRingElem)
function is_square(a::FqRelPowerSeriesRingElem)
flag, q = sqrt_classical(a; check=true)
return flag
end

function issquare_with_sqrt(a::FqRelPowerSeriesRingElem)
function is_square_with_sqrt(a::FqRelPowerSeriesRingElem)
return sqrt_classical(a; check=true)
end

Expand Down
4 changes: 2 additions & 2 deletions src/flint/fq_nmod_poly.jl
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ function sqrt(x::fqPolyRepPolyRingElem; check::Bool=true)
return s
end

function issquare(x::fqPolyRepPolyRingElem)
function is_square(x::fqPolyRepPolyRingElem)
if iszero(x)
return true
end
Expand All @@ -415,7 +415,7 @@ function issquare(x::fqPolyRepPolyRingElem)
return flag
end

function issquare_with_sqrt(x::fqPolyRepPolyRingElem)
function is_square_with_sqrt(x::fqPolyRepPolyRingElem)
R = parent(x)
if iszero(x)
return true, zero(R)
Expand Down
4 changes: 2 additions & 2 deletions src/flint/fq_poly.jl
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ function sqrt(x::FqPolyRepPolyRingElem; check::Bool=true)
return s
end

function issquare(x::FqPolyRepPolyRingElem)
function is_square(x::FqPolyRepPolyRingElem)
if iszero(x)
return true
end
Expand All @@ -415,7 +415,7 @@ function issquare(x::FqPolyRepPolyRingElem)
return flag
end

function issquare_with_sqrt(x::FqPolyRepPolyRingElem)
function is_square_with_sqrt(x::FqPolyRepPolyRingElem)
R = parent(x)
if iszero(x)
return true, zero(R)
Expand Down
8 changes: 4 additions & 4 deletions src/flint/fq_rel_series.jl
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ function sqrt_classical_char2(a::($etype); check::Bool=true)
end
for i = 0:prec - aval2 - 1
c = polcoeff(a, 2*i)
if check && !issquare(c)
if check && !is_square(c)
return false, S()
end
asqrt = setcoeff!(asqrt, i, sqrt(c; check=false))
Expand Down Expand Up @@ -600,7 +600,7 @@ function sqrt_classical(a::($etype); check::Bool=true)
z.val = v2
c = coeff(a, v)
if check
flag, s = issquare_with_sqrt(c)
flag, s = is_square_with_sqrt(c)
if !flag
return false, S()
end
Expand All @@ -626,12 +626,12 @@ function Base.sqrt(a::($etype); check::Bool=true)
return q
end

function issquare(a::($etype))
function is_square(a::($etype))
flag, q = sqrt_classical(a; check=true)
return flag
end

function issquare_with_sqrt(a::($etype))
function is_square_with_sqrt(a::($etype))
return sqrt_classical(a; check=true)
end

Expand Down
4 changes: 2 additions & 2 deletions src/flint/gfp_fmpz_poly.jl
Original file line number Diff line number Diff line change
Expand Up @@ -325,15 +325,15 @@ function Base.sqrt(x::FpPolyRingElem; check::Bool=true)
return s
end

function issquare(x::FpPolyRingElem)
function is_square(x::FpPolyRingElem)
s = parent(x)()
flag = Bool(ccall((:fmpz_mod_poly_sqrt, libflint), Cint,
(Ref{FpPolyRingElem}, Ref{FpPolyRingElem}, Ref{fmpz_mod_ctx_struct}),
s, x, x.parent.base_ring.ninv))
return flag
end

function issquare_with_sqrt(x::FpPolyRingElem)
function is_square_with_sqrt(x::FpPolyRingElem)
s = parent(x)()
flag = Bool(ccall((:fmpz_mod_poly_sqrt, libflint), Cint,
(Ref{FpPolyRingElem}, Ref{FpPolyRingElem}, Ref{fmpz_mod_ctx_struct}),
Expand Down
Loading

0 comments on commit 0a10840

Please sign in to comment.