Skip to content

Commit

Permalink
Error for divides with noncommutative (#154)
Browse files Browse the repository at this point in the history
  • Loading branch information
blegat authored Feb 16, 2024
1 parent 5be6070 commit 005621b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/div.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
function MP.divides(m1::Monomial, m2::Monomial)
function MP.divides(m1::Monomial{<:NonCommutative}, m2::Monomial{<:NonCommutative})
error("Not implemented yet")
end
function MP.divides(m1::Monomial{<:Commutative}, m2::Monomial{<:Commutative})
e1 = exponents(m1)
v1 = variables(m1)
e2 = exponents(m2)
Expand Down
5 changes: 5 additions & 0 deletions test/mono.jl
Original file line number Diff line number Diff line change
Expand Up @@ -166,4 +166,9 @@ import MultivariatePolynomials as MP
@test filter(mono -> degree(mono) == 1, X) == monomial_vector([x, y])
@test filter(mono -> degree(mono) == 0, X) == monomial_vector([x^0])
end
@testset "Noncommutative div" begin
@ncpolyvar x y
err = ErrorException("Not implemented yet")
@test_throws err div(x, x * y)
end
end

0 comments on commit 005621b

Please sign in to comment.