|
33 | 33 | X = monovec([y, x])
|
34 | 34 | @test X[1] == x
|
35 | 35 | @test X[2] == y
|
36 |
| - X = monomials([x, y], 2) |
37 |
| - @test variables(X)[1] == x |
38 |
| - @test variables(X)[2] == y |
39 |
| - @test variables(X)[3] == x |
40 |
| - @test collect(exponents(X[1])) == [2, 0, 0] |
41 |
| - @test collect(exponents(X[2])) == [1, 1, 0] |
42 |
| - @test collect(exponents(X[3])) == [0, 2, 0] |
43 |
| - @test collect(exponents(X[4])) == [0, 1, 1] |
| 36 | + # `variables` may return `[x, y, x, y]` if the polynomial has, e.g., the monomial `x * y * x * y`. |
| 37 | + X = monomials([y, x, y, x, y], 0:2) |
| 38 | + Y = monomials([x, y], 2) |
| 39 | + for M in [X, Y] |
| 40 | + @test variables(X)[1] == x |
| 41 | + @test variables(X)[2] == y |
| 42 | + @test variables(X)[3] == x |
| 43 | + @test collect(exponents(X[1])) == [2, 0, 0] |
| 44 | + @test collect(exponents(X[2])) == [1, 1, 0] |
| 45 | + @test collect(exponents(X[3])) == [0, 2, 0] |
| 46 | + @test collect(exponents(X[4])) == [0, 1, 1] |
| 47 | + end |
| 48 | + @test collect(exponents(X[5])) == [1, 0, 0] |
| 49 | + @test collect(exponents(X[6])) == [0, 1, 0] |
| 50 | + @test collect(exponents(X[7])) == [0, 0, 0] |
44 | 51 | X0 = [x^3, x^2*y, x*y^2, x*y*x, y^3, y^2*x, y*x^2, y*x*y]
|
45 | 52 | X1 = monomials([x, y], 3)
|
46 | 53 | X2 = monovec(X0)
|
|
0 commit comments