Skip to content

Commit 0d96d87

Browse files
committed
Fixes
1 parent b3c8f6b commit 0d96d87

File tree

2 files changed

+8
-16
lines changed

2 files changed

+8
-16
lines changed

src/monomial_vector.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,8 @@ function MonomialVector(
213213
mindegree = minimum(degs),
214214
maxdegree = maximum(degs),
215215
)) do z
216-
filter(Monomial(vars, z))
216+
mono = Monomial(vars, z)
217+
MP.degree(mono) in degs && filter(mono)
217218
end
218219
return MonomialVector(vars, collect(Z))
219220
end

test/comp.jl

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -76,24 +76,15 @@ end
7676
_test_monomials([x, y], 3, [x^3, x^2 * y, x * y^2, y^3])
7777
end
7878

79-
@testset "Reverse{LexOrder}" begin
80-
@polyvar x y monomial_order = Reverse{LexOrder}
81-
_test_less(y^2, y)
82-
_test_less(y, x^0)
79+
@testset "Graded{Reverse{LexOrder}}" begin
80+
@polyvar x y monomial_order = Graded{Reverse{LexOrder}}
81+
_test_less(y, y^2)
82+
_test_less(x^0, y)
8383
_test_less(x, y^2)
8484
_test_less(x^2, x * y^2)
8585
_test_monomials([x, y], 3, [x^3, x^2 * y, x * y^2, y^3])
86-
end
87-
88-
@testset "Reverse{InverseLexOrder}" begin
89-
@polyvar x y monomial_order = Reverse{InverseLexOrder}
90-
_test_less(y^2, y)
91-
_test_less(y, x^0)
92-
_test_less(y^2, x)
93-
_test_less(x * y^2, x^2)
94-
_test_monomials([x, y], 3, [y^3, y^2 * x, y * x^2, x^3])
95-
_test_monomials([x, y], 1:2, [y^2, x * y, y, x^2, x])
96-
_test_monomials([x, y], [0, 1, 3], [y^3, x*y^2, x^2*y, y, x^3, x, 1])
86+
_test_monomials([x, y], 1:2, [x, y, x^2, x * y, y^2])
87+
_test_monomials([x, y], [0, 1, 3], [1, x, y, x^3, x^2 * y, x * y^2, y^3])
9788
end
9889

9990
@testset "Graded{Reverse{InverseLexOrder}}" begin

0 commit comments

Comments
 (0)