From 47d7d7f07f4c884ba9bff60a82ccd1afd31f9fa6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Legat?= Date: Mon, 9 Nov 2026 21:26:22 +0100 Subject: [PATCH] Build Chebyshev products with sparse_coefficients The products of univariate Chebyshev polynomials are not sorted, `SA.sparse_coefficients` canonicalizes them. --- Project.toml | 2 +- src/chebyshev.jl | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/Project.toml b/Project.toml index 4834f8a..aa696ff 100644 --- a/Project.toml +++ b/Project.toml @@ -22,5 +22,5 @@ JuMP = "1.15" MathOptInterface = "1" MultivariatePolynomials = "0.6" MutableArithmetics = "1.9" -StarAlgebras = "0.4" +StarAlgebras = "0.4.4" julia = "1.10" diff --git a/src/chebyshev.jl b/src/chebyshev.jl index b1e8b74..ad392f5 100644 --- a/src/chebyshev.jl +++ b/src/chebyshev.jl @@ -79,11 +79,8 @@ function (m::MStruct{B,V,E})( var_state_b = iterate(vars_b, state_b) end end - # FIXME is `canonical` needed ? - return MA.operate!( - SA.canonical, - SA.SparseCoefficients(exps, coefs, SA.comparable(m.basis)), - ) + # The products of the univariate polynomials are not sorted + return SA.sparse_coefficients(exps, coefs, SA.comparable(m.basis)) end function _add_mul_scalar_vector!(res, ::SubBasis, scalar, vector)