From 005621b454915428fa1a4c6ad72f90dc42b47f6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Legat?= Date: Fri, 16 Feb 2024 18:05:16 +0100 Subject: [PATCH] Error for divides with noncommutative (#154) --- src/div.jl | 5 ++++- test/mono.jl | 5 +++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/div.jl b/src/div.jl index 16e5ea9..51e2645 100644 --- a/src/div.jl +++ b/src/div.jl @@ -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) diff --git a/test/mono.jl b/test/mono.jl index 86aa59b..25b2361 100644 --- a/test/mono.jl +++ b/test/mono.jl @@ -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