Skip to content

Commit 005621b

Browse files
authored
Error for divides with noncommutative (#154)
1 parent 5be6070 commit 005621b

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/div.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
function MP.divides(m1::Monomial, m2::Monomial)
1+
function MP.divides(m1::Monomial{<:NonCommutative}, m2::Monomial{<:NonCommutative})
2+
error("Not implemented yet")
3+
end
4+
function MP.divides(m1::Monomial{<:Commutative}, m2::Monomial{<:Commutative})
25
e1 = exponents(m1)
36
v1 = variables(m1)
47
e2 = exponents(m2)

test/mono.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,4 +166,9 @@ import MultivariatePolynomials as MP
166166
@test filter(mono -> degree(mono) == 1, X) == monomial_vector([x, y])
167167
@test filter(mono -> degree(mono) == 0, X) == monomial_vector([x^0])
168168
end
169+
@testset "Noncommutative div" begin
170+
@ncpolyvar x y
171+
err = ErrorException("Not implemented yet")
172+
@test_throws err div(x, x * y)
173+
end
169174
end

0 commit comments

Comments
 (0)