Skip to content

Commit

Permalink
Merge pull request #1364 from Nemocas/th/1363
Browse files Browse the repository at this point in the history
Fix #1363
  • Loading branch information
tthsqe12 authored Dec 15, 2022
2 parents 3edc061 + 7a73437 commit 3cee149
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/flint/fq_nmod_mpoly.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1102,10 +1102,10 @@ function (R::FqNmodMPolyRing)(a::Vector{fq_nmod}, b::Vector{Vector{T}}) where {T
end

# Create poly with given array of coefficients and array of exponent vectors (sorting is performed)
function (R::FqNmodMPolyRing)(a::Vector{Any}, b::Vector{Vector{T}}) where T
function (R::FqNmodMPolyRing)(a::Vector{<:Any}, b::Vector{Vector{T}}) where T
n = nvars(R)
length(a) != length(b) && error("Coefficient and exponent vector must have the same length")
newa = map(R, a)
newa = map(base_ring(R), a)
newb = map(x -> map(FlintZZ, x), b)
newaa = convert(Vector{fq_nmod}, newa)
newbb = convert(Vector{Vector{fmpz}}, newb)
Expand Down
5 changes: 5 additions & 0 deletions test/flint/fq_nmod_mpoly-test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@
S, (x, y) = PolynomialRing(R, ["x", "y"])
M = MPolyBuildCtx(S)
@test_throws ErrorException push_term!(M, one(RR), zeros(Int, 2))

F, = FiniteField(2, 2, :z)
R, (x, ) = PolynomialRing(F, ["x",])
@test R([F(1)], [[BigInt(1)]]) == x
@test R([1], [[BigInt(1)]]) == x
end

@testset "fq_nmod_mpoly.printing" begin
Expand Down

0 comments on commit 3cee149

Please sign in to comment.