Skip to content

Commit

Permalink
ordering -> internal_ordering
Browse files Browse the repository at this point in the history
  • Loading branch information
joschmitt committed Feb 14, 2024
1 parent a0aa32c commit 7e014b5
Show file tree
Hide file tree
Showing 15 changed files with 184 additions and 184 deletions.
10 changes: 5 additions & 5 deletions src/flint/FlintTypes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6877,24 +6877,24 @@ const _fq_default_mpoly_union = Union{AbstractAlgebra.Generic.MPoly{FqPolyRepFie
base_ring::FqField
typ::Int # keep these in sync with @fq_default_mpoly_do_op

function FqMPolyRing(R::FqField, s::Vector{Symbol}, ordering::Symbol = :lex, cached::Bool = true)
return get_cached!(FqDefaultMPolyID, (R, s, ordering), cached) do
function FqMPolyRing(R::FqField, s::Vector{Symbol}, internal_ordering::Symbol = :lex, cached::Bool = true)
return get_cached!(FqDefaultMPolyID, (R, s, internal_ordering), cached) do
# in the following all constructors should use chached = false
m = modulus(R)
p = characteristic(R)
if fits(UInt, p)
Fq = Native.GF(UInt(p))
if isone(degree(m))
Fqx = polynomial_ring(Fq, s, cached = cached, ordering = ordering)[1]
Fqx = polynomial_ring(Fq, s, cached = cached, internal_ordering = internal_ordering)[1]
return new(Fqx, R, 3)
end
mm = polynomial_ring(Fq, "x")[1](lift(polynomial_ring(ZZ, "x")[1], m))
Fq = Native.FiniteField(mm, R.var, cached = cached, check = false)[1]
Fqx = polynomial_ring(Fq, s, cached = cached, ordering = ordering)[1]
Fqx = polynomial_ring(Fq, s, cached = cached, internal_ordering = internal_ordering)[1]
return new(Fqx, R, 2)
end
Fq = FqPolyRepField(m, Symbol(R.var), cached, check = false)
Fqx = AbstractAlgebra.Generic.polynomial_ring(Fq, s, cached = cached, ordering = ordering)[1]
Fqx = AbstractAlgebra.Generic.polynomial_ring(Fq, s, cached = cached, internal_ordering = internal_ordering)[1]
return new(Fqx, R, 1)
end::FqMPolyRing
end
Expand Down
2 changes: 1 addition & 1 deletion src/flint/fmpq_mpoly.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ number_of_variables(a::QQMPolyRing) = ccall((:fmpq_mpoly_ctx_nvars, libflint), I

base_ring(a::QQMPolyRing) = FlintQQ

function ordering(a::QQMPolyRing)
function internal_ordering(a::QQMPolyRing)
b = ccall((:fmpq_mpoly_ctx_ord, libflint), Cint, (Ref{QQMPolyRing}, ), a)
return flint_orderings[b + 1]
end
Expand Down
2 changes: 1 addition & 1 deletion src/flint/fmpz_mod_mpoly.jl
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ modulus(R::($rtype)) = modulus(base_ring(R))
modulus(f::($etype)) = modulus(base_ring(parent(f)))


function ordering(a::($rtype))
function internal_ordering(a::($rtype))
b = a.ord
# b = ccall((:fmpz_mod_mpoly_ctx_ord, libflint), Cint, (Ref{zzModMPolyRing}, ), a)
return flint_orderings[b + 1]
Expand Down
2 changes: 1 addition & 1 deletion src/flint/fmpz_mpoly.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ number_of_variables(a::ZZMPolyRing) = ccall((:fmpz_mpoly_ctx_nvars, libflint), I

base_ring(a::ZZMPolyRing) = FlintZZ

function ordering(a::ZZMPolyRing)
function internal_ordering(a::ZZMPolyRing)
b = ccall((:fmpz_mpoly_ctx_ord, libflint), Cint, (Ref{ZZMPolyRing}, ), a)
return flint_orderings[b + 1]
end
Expand Down
4 changes: 2 additions & 2 deletions src/flint/fq_default_mpoly.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ modulus(R::FqMPolyRing) = modulus(base_ring(R))

modulus(f::FqMPolyRingElem) = modulus(base_ring(parent(f)))

function ordering(a::FqMPolyRing)
return ordering(a.data)
function internal_ordering(a::FqMPolyRing)
return internal_ordering(a.data)
end

function gens(R::FqMPolyRing)
Expand Down
2 changes: 1 addition & 1 deletion src/flint/fq_nmod_mpoly.jl
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ number_of_variables(a::fqPolyRepMPolyRing) = a.nvars

base_ring(a::fqPolyRepMPolyRing) = a.base_ring

function ordering(a::fqPolyRepMPolyRing)
function internal_ordering(a::fqPolyRepMPolyRing)
b = a.ord
# b = ccall((:fq_nmod_mpoly_ctx_ord, libflint), Cint, (Ref{fqPolyRepMPolyRing}, ), a)
return flint_orderings[b + 1]
Expand Down
2 changes: 1 addition & 1 deletion src/flint/nmod_mpoly.jl
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ modulus(R::($rtype)) = modulus(base_ring(R))
modulus(f::($etype)) = modulus(base_ring(parent(f)))


function ordering(a::($rtype))
function internal_ordering(a::($rtype))
b = a.ord
# b = ccall((:nmod_mpoly_ctx_ord, libflint), Cint, (Ref{zzModMPolyRing}, ), a)
return flint_orderings[b + 1]
Expand Down
48 changes: 24 additions & 24 deletions test/flint/fmpq_mpoly-test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
var_names = ["x$j" for j in 1:num_vars]
ord = rand_ordering()

S, varlist = polynomial_ring(R, var_names, ordering = ord)
S, varlist = polynomial_ring(R, var_names, internal_ordering = ord)

SS, varlist = polynomial_ring(R, var_names, ordering = ord)
SS, varlist = polynomial_ring(R, var_names, internal_ordering = ord)

@test S === SS

SSS, varlist = polynomial_ring(R, var_names, ordering = ord, cached = false)
SSSS, varlist = polynomial_ring(R, var_names, ordering = ord, cached = false)
SSS, varlist = polynomial_ring(R, var_names, internal_ordering = ord, cached = false)
SSSS, varlist = polynomial_ring(R, var_names, internal_ordering = ord, cached = false)

@test !(SSS === SSSS)

Expand Down Expand Up @@ -112,7 +112,7 @@ end
var_names = ["x$j" for j in 1:num_vars]
ord = rand_ordering()

S, varlist = polynomial_ring(R, var_names, ordering = ord)
S, varlist = polynomial_ring(R, var_names, internal_ordering = ord)
g = gens(S)

@test characteristic(S) == 0
Expand Down Expand Up @@ -171,10 +171,10 @@ end
@test (i1 == i2) == (monomial(f, i1) == monomial(f, i2))
end

deg = is_degree(ordering(S))
rev = is_reverse(ordering(S))
deg = is_degree(internal_ordering(S))
rev = is_reverse(internal_ordering(S))

@test ord == ordering(S)
@test ord == internal_ordering(S)

@test isone(one(S))

Expand Down Expand Up @@ -238,7 +238,7 @@ end
R = FlintQQ

for ord in Nemo.flint_orderings
S, (x, y, z) = polynomial_ring(R, ["x", "y", "z"]; ordering=ord)
S, (x, y, z) = polynomial_ring(R, ["x", "y", "z"]; internal_ordering=ord)

f = -8*x^5*y^3*z^5+9*x^5*y^2*z^3-8*x^4*y^5*z^4-10*x^4*y^3*z^2+8*x^3*y^2*z-10*x*y^3*
z^4-4*x*y-10*x*z^2+8*y^2*z^5-9*y^2*z^3
Expand All @@ -260,7 +260,7 @@ end
var_names = ["x$j" for j in 1:num_vars]
ord = rand_ordering()

S, varlist = polynomial_ring(R, var_names, ordering = ord)
S, varlist = polynomial_ring(R, var_names, internal_ordering = ord)

for iter = 1:10
f = rand(S, 0:5, 0:100, -100:100)
Expand All @@ -277,7 +277,7 @@ end
var_names = ["x$j" for j in 1:num_vars]
ord = rand_ordering()

S, varlist = polynomial_ring(R, var_names, ordering = ord)
S, varlist = polynomial_ring(R, var_names, internal_ordering = ord)

for iter = 1:10
f = rand(S, 0:5, 0:100, -100:100)
Expand All @@ -300,7 +300,7 @@ end
var_names = ["x$j" for j in 1:num_vars]
ord = rand_ordering()

S, varlist = polynomial_ring(R, var_names, ordering = ord)
S, varlist = polynomial_ring(R, var_names, internal_ordering = ord)

for iter = 1:100
f = rand(S, 0:5, 0:100, -100:100)
Expand Down Expand Up @@ -340,7 +340,7 @@ end
var_names = ["x$j" for j in 1:num_vars]
ord = rand_ordering()

S, varlist = polynomial_ring(R, var_names, ordering = ord)
S, varlist = polynomial_ring(R, var_names, internal_ordering = ord)

for iter = 1:100
d = rand(-100:100)
Expand All @@ -366,7 +366,7 @@ end
var_names = ["x$j" for j in 1:num_vars]
ord = rand_ordering()

S, varlist = polynomial_ring(R, var_names, ordering = ord)
S, varlist = polynomial_ring(R, var_names, internal_ordering = ord)

for iter = 1:10
f = rand(S, 0:5, 0:100, -100:100)
Expand All @@ -393,7 +393,7 @@ end
var_names = ["x$j" for j in 1:num_vars]
ord = rand_ordering()

S, varlist = polynomial_ring(R, var_names, ordering = ord)
S, varlist = polynomial_ring(R, var_names, internal_ordering = ord)

for iter = 1:10
f = rand(S, 0:5, 0:100, -100:100)
Expand Down Expand Up @@ -422,7 +422,7 @@ end
var_names = ["x$j" for j in 1:num_vars]
ord = rand_ordering()

S, varlist = polynomial_ring(R, var_names, ordering = ord)
S, varlist = polynomial_ring(R, var_names, internal_ordering = ord)

for iter = 1:10
f = S(0)
Expand Down Expand Up @@ -458,7 +458,7 @@ end
var_names = ["x$j" for j in 1:num_vars]
ord = rand_ordering()

S, varlist = polynomial_ring(R, var_names, ordering = ord)
S, varlist = polynomial_ring(R, var_names, internal_ordering = ord)

for iter = 1:10
f = S(0)
Expand Down Expand Up @@ -505,7 +505,7 @@ end
var_names = ["x$j" for j in 1:num_vars]
ord = rand_ordering()

S, varlist = polynomial_ring(FlintQQ, var_names, ordering = ord)
S, varlist = polynomial_ring(FlintQQ, var_names, internal_ordering = ord)

for iter = 1:10
f = rand(S, 0:4, 0:5, -10:10)
Expand Down Expand Up @@ -550,7 +550,7 @@ end
var_names = ["x$j" for j in 1:num_vars]
ord = rand_ordering()

S, varlist = polynomial_ring(FlintQQ, var_names, ordering = ord)
S, varlist = polynomial_ring(FlintQQ, var_names, internal_ordering = ord)

for iter = 1:10
f = rand(S, 0:4, 0:5, -10:10)
Expand All @@ -576,7 +576,7 @@ end
var_names = ["x$j" for j in 1:num_vars]
ord = rand_ordering()

S, varlist = polynomial_ring(R, var_names, ordering = ord)
S, varlist = polynomial_ring(R, var_names, internal_ordering = ord)

for iter = 1:100
f = rand(S, 0:5, 0:100, -100:100)
Expand Down Expand Up @@ -659,7 +659,7 @@ end
var_names = ["x$j" for j in 1:num_vars]
ord = rand_ordering()

S, varlist = polynomial_ring(R, var_names, ordering = ord)
S, varlist = polynomial_ring(R, var_names, internal_ordering = ord)

for iter = 1:100
f = S()
Expand Down Expand Up @@ -697,7 +697,7 @@ end
var_names = ["x$j" for j in 1:num_vars]
ord = rand_ordering()

S, varlist = polynomial_ring(R, var_names, ordering = ord)
S, varlist = polynomial_ring(R, var_names, internal_ordering = ord)

for j in 1:100
f = rand(S, 0:5, 0:100, -100:100)
Expand All @@ -715,7 +715,7 @@ end
var_names = ["x$j" for j in 1:num_vars]
ord = rand_ordering()

R, vars_R = polynomial_ring(FlintQQ, var_names; ordering=ord)
R, vars_R = polynomial_ring(FlintQQ, var_names; internal_ordering=ord)

for iter in 1:10
f = R()
Expand Down Expand Up @@ -749,7 +749,7 @@ end
var_names = ["x$j" for j in 1:num_vars]
ord = rand_ordering()

R, vars_R = polynomial_ring(FlintQQ, var_names; ordering=ord)
R, vars_R = polynomial_ring(FlintQQ, var_names; internal_ordering=ord)

for iter in 1:10
f = R()
Expand Down
Loading

0 comments on commit 7e014b5

Please sign in to comment.