Skip to content

Replace ring_to_mat dictionary by example_rings vector #2076

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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: 3 additions & 1 deletion test/arb/ComplexMat-test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,14 @@ end
@test t isa ComplexMatrix
@test size(t) == (2, 3)

for (R, M) in ring_to_mat
for R in example_rings
t = similar(s, R)
@test size(t) == size(s)
@test t isa dense_matrix_type(R)

t = similar(s, R, 2, 3)
@test size(t) == (2, 3)
@test t isa dense_matrix_type(R)
end
end

Expand Down
4 changes: 3 additions & 1 deletion test/arb/RealMat-test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,14 @@ end
@test t isa RealMatrix
@test size(t) == (2, 3)

for (R, M) in ring_to_mat
for R in example_rings
t = similar(s, R)
@test size(t) == size(s)
@test t isa dense_matrix_type(R)

t = similar(s, R, 2, 3)
@test size(t) == (2, 3)
@test t isa dense_matrix_type(R)
end
end

Expand Down
4 changes: 3 additions & 1 deletion test/arb/acb_mat-test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,14 @@ end
@test t isa AcbMatrix
@test size(t) == (2, 3)

for (R, M) in ring_to_mat
for R in example_rings
t = similar(s, R)
@test size(t) == size(s)
@test t isa dense_matrix_type(R)

t = similar(s, R, 2, 3)
@test size(t) == (2, 3)
@test t isa dense_matrix_type(R)
end
end

Expand Down
4 changes: 3 additions & 1 deletion test/arb/arb_mat-test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,14 @@ end
@test t isa ArbMatrix
@test size(t) == (2, 3)

for (R, M) in ring_to_mat
for R in example_rings
t = similar(s, R)
@test size(t) == size(s)
@test t isa dense_matrix_type(R)

t = similar(s, R, 2, 3)
@test size(t) == (2, 3)
@test t isa dense_matrix_type(R)
end
end

Expand Down
4 changes: 3 additions & 1 deletion test/flint/fmpq_mat-test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,14 @@ end
@test t isa QQMatrix
@test size(t) == (2, 3)

for (R, M) in ring_to_mat
for R in example_rings
t = similar(s, R)
@test size(t) == size(s)
@test t isa dense_matrix_type(R)

t = similar(s, R, 2, 3)
@test size(t) == (2, 3)
@test t isa dense_matrix_type(R)
end
end

Expand Down
4 changes: 3 additions & 1 deletion test/flint/fmpz_mat-test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,17 @@ end
@test size(t) == (2, 3)
@test iszero(t)

for (R, M) in ring_to_mat
for R in example_rings
t = sim_zero(s, R)
@test size(t) == size(s)
@test t isa dense_matrix_type(R)
if sim_zero == zero
@test iszero(t)
end

t = sim_zero(s, R, 2, 3)
@test size(t) == (2, 3)
@test t isa dense_matrix_type(R)
if sim_zero == zero
@test iszero(t)
end
Expand Down
4 changes: 3 additions & 1 deletion test/flint/fmpz_mod_mat-test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,14 @@ end
@test t isa ZZModMatrix
@test size(t) == (2, 3)

for (R, M) in ring_to_mat
for R in example_rings
t = similar(s, R)
@test size(t) == size(s)
@test t isa dense_matrix_type(R)

t = similar(s, R, 2, 3)
@test size(t) == (2, 3)
@test t isa dense_matrix_type(R)
end
end

Expand Down
4 changes: 3 additions & 1 deletion test/flint/fq_default_mat-test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -198,12 +198,14 @@ end
@test t isa FqMatrix
@test size(t) == (2, 3)

for (R, M) in ring_to_mat
for R in example_rings
t = similar(s, R)
@test size(t) == size(s)
@test t isa dense_matrix_type(R)

t = similar(s, R, 2, 3)
@test size(t) == (2, 3)
@test t isa dense_matrix_type(R)
end
end

Expand Down
4 changes: 3 additions & 1 deletion test/flint/fq_mat-test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -182,12 +182,14 @@ end
@test t isa FqPolyRepMatrix
@test size(t) == (2, 3)

for (R, M) in ring_to_mat
for R in example_rings
t = similar(s, R)
@test size(t) == size(s)
@test t isa dense_matrix_type(R)

t = similar(s, R, 2, 3)
@test size(t) == (2, 3)
@test t isa dense_matrix_type(R)
end
end

Expand Down
4 changes: 3 additions & 1 deletion test/flint/fq_nmod_mat-test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -182,12 +182,14 @@ end
@test t isa fqPolyRepMatrix
@test size(t) == (2, 3)

for (R, M) in ring_to_mat
for R in example_rings
t = similar(s, R)
@test size(t) == size(s)
@test t isa dense_matrix_type(R)

t = similar(s, R, 2, 3)
@test size(t) == (2, 3)
@test t isa dense_matrix_type(R)
end
end

Expand Down
4 changes: 3 additions & 1 deletion test/flint/gfp_fmpz_mat-test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -157,12 +157,14 @@ end
@test t isa FpMatrix
@test size(t) == (2, 3)

for (R, M) in ring_to_mat
for R in example_rings
t = similar(s, R)
@test size(t) == size(s)
@test t isa dense_matrix_type(R)

t = similar(s, R, 2, 3)
@test size(t) == (2, 3)
@test t isa dense_matrix_type(R)
end
end

Expand Down
4 changes: 3 additions & 1 deletion test/flint/gfp_mat-test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -186,12 +186,14 @@ end
@test t isa fpMatrix
@test size(t) == (2, 3)

for (R, M) in ring_to_mat
for R in example_rings
t = similar(s, R)
@test size(t) == size(s)
@test t isa dense_matrix_type(R)

t = similar(s, R, 2, 3)
@test size(t) == (2, 3)
@test t isa dense_matrix_type(R)
end
end

Expand Down
4 changes: 3 additions & 1 deletion test/flint/nmod_mat-test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -182,12 +182,14 @@ end
@test t isa zzModMatrix
@test size(t) == (2, 3)

for (R, M) in ring_to_mat
for R in example_rings
t = similar(s, R)
@test size(t) == size(s)
@test t isa dense_matrix_type(R)

t = similar(s, R, 2, 3)
@test size(t) == (2, 3)
@test t isa dense_matrix_type(R)
end
end

Expand Down
29 changes: 18 additions & 11 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,24 @@ end
@everywhere using Test
@everywhere using InteractiveUtils: @which
@everywhere import Nemo.AbstractAlgebra
@everywhere const ring_to_mat = Dict(ZZ => ZZMatrix,
QQ => QQMatrix,
residue_ring(ZZ, 9)[1] => zzModMatrix,
GF(5) => fpMatrix,
finite_field(3, 2, "b")[1] => fqPolyRepMatrix,
finite_field(ZZRingElem(3), 2, "b")[1] => FqPolyRepMatrix,
ArbField() => ArbMatrix,
AcbField() => AcbMatrix,
RealField() => RealMatrix,
ComplexField() => ComplexMatrix,
)
@everywhere const example_rings = [
ZZ, # ZZRing
QQ, # QQField
residue_ring(ZZ, 9)[1], # zzModRing
residue_ring(ZZ, ZZ(9))[1], # ZZModRing
Native.GF(5), # fpField
Native.GF(ZZ(5)), # FpField
Native.finite_field(3, 2, "b")[1], # fqPolyRepField
Native.finite_field(ZZRingElem(3), 2, "b")[1],# FqPolyRepField
GF(5), # FqField
GF(ZZ(5)), # FqField
finite_field(3, 2, "b")[1], # FqField
finite_field(ZZRingElem(3), 2, "b")[1], # FqField
ArbField(), # ArbField
AcbField(), # AcbField
RealField(), # RealField
ComplexField(), # ComplexField
]

@everywhere include("rand.jl")
include("Nemo-test.jl")
Loading