From e068926b893da3951a6444d65a99c2cae940eb6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Legat?= Date: Fri, 13 Jun 2025 23:02:08 +0200 Subject: [PATCH 1/3] Define monomial constructor --- src/gcd.jl | 10 ++-------- src/term.jl | 11 +++++++++++ 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/gcd.jl b/src/gcd.jl index 793b69e1..4d7f16ab 100644 --- a/src/gcd.jl +++ b/src/gcd.jl @@ -261,14 +261,8 @@ function deflation(p::AbstractPolynomialLike) shift_defl = shift_deflation.(p, variables(p)) shift = getindex.(shift_defl, 1) defl = getindex.(shift_defl, 2) - s = prod( - variables(p) .^ shift; - init = constant_monomial(p), - )::monomial_type(p) - d = prod( - variables(p) .^ defl; - init = constant_monomial(p), - )::monomial_type(p) + s = monomial(variables(p), shift) + d = monomial(variables(p), defl) return s, d end diff --git a/src/term.jl b/src/term.jl index cfaf6797..f9cf0866 100644 --- a/src/term.jl +++ b/src/term.jl @@ -151,6 +151,17 @@ Returns the monomial of the term `t`. ### Examples Calling `monomial` on ``4x^2y`` should return ``x^2y``. + + monomial(variables, exponents) + +Returns the monomial corresponding to `prod(variables .^ exponents)` + +### Examples + +In order to create `x^2 * y`, + +* with DynamicPolynomials, use `monomial([x, y], [2, 1])`, +* with TypedPolynomials, use `monomial((x, y), (2, 1))`. """ function monomial end monomial(t::AbstractTerm) = t.monomial # by convention, the field should be `monomial`. From 259786edc21d33a50ff5112d10ded738baa07239 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Legat?= Date: Mon, 1 Sep 2025 14:27:24 +0200 Subject: [PATCH 2/3] Bump TP to v0.4.2 --- test/Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Project.toml b/test/Project.toml index d7b2ae57..23e5f42f 100644 --- a/test/Project.toml +++ b/test/Project.toml @@ -11,4 +11,4 @@ TypedPolynomials = "afbbf031-7a57-5f58-a1b9-b774a0fad08d" [compat] DynamicPolynomials = "0.6" -TypedPolynomials = "0.4" +TypedPolynomials = "0.4.2" From bcbaf67a52292fb6641b210c20aa53d9ad100354 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Legat?= Date: Mon, 1 Sep 2025 14:39:23 +0200 Subject: [PATCH 3/3] Drop Julia v1.6 --- .github/workflows/ci.yml | 3 --- Project.toml | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1bcff881..9bd20c94 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,9 +17,6 @@ jobs: - version: '1' os: ubuntu-latest arch: x64 - - version: '1.6' - os: ubuntu-latest - arch: x64 - version: '1.10' os: ubuntu-latest arch: x64 diff --git a/Project.toml b/Project.toml index b0013de1..22bbeef5 100644 --- a/Project.toml +++ b/Project.toml @@ -14,4 +14,4 @@ MutableArithmetics = "d8a4904e-b15c-11e9-3269-09a3773c0cb0" ChainRulesCore = "1" DataStructures = "0.19" MutableArithmetics = "0.3, 1" -julia = "1.6" +julia = "1.10"