From 0f07f1798b8028c05cd183b8b98575e82ef4447d Mon Sep 17 00:00:00 2001 From: stephanmg Date: Thu, 16 Nov 2023 15:13:50 +0100 Subject: [PATCH 1/3] Changing DP.Polyvar -> DP.Variable as suggested --- examples/contraction/JuMP.jl | 4 ++-- examples/semidefinitepoly/JuMP.jl | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/contraction/JuMP.jl b/examples/contraction/JuMP.jl index 71bccefd3..5d78b28d6 100644 --- a/examples/contraction/JuMP.jl +++ b/examples/contraction/JuMP.jl @@ -105,7 +105,7 @@ function get_lagrange_polys(pts::Matrix{T}, deg::Int) where {T <: Real} end # returns the multivariate Chebyshev polynomials in x up to degree deg -function get_chebyshev_polys(x::Vector{DP.PolyVar{true}}, deg::Int) +function get_chebyshev_polys(x::Vector{DP.Variable{true}}, deg::Int) if deg > 8 @warn("get_chebyshev_polys is not numerically stable for large degree") end @@ -124,7 +124,7 @@ function get_chebyshev_polys(x::Vector{DP.PolyVar{true}}, deg::Int) return V end -function get_chebyshev_univ(monovec::Vector{DP.PolyVar{true}}, deg::Int) +function get_chebyshev_univ(monovec::Vector{DP.Variable{true}}, deg::Int) if deg > 8 @warn("get_chebyshev_univ is not numerically stable for large degree") end diff --git a/examples/semidefinitepoly/JuMP.jl b/examples/semidefinitepoly/JuMP.jl index 92bd1567c..ed8e8e202 100644 --- a/examples/semidefinitepoly/JuMP.jl +++ b/examples/semidefinitepoly/JuMP.jl @@ -15,7 +15,7 @@ import SumOfSquares import PolyJuMP struct SemidefinitePolyJuMP{T <: Real} <: ExampleInstanceJuMP{T} - x::Vector{<:DP.PolyVar} + x::Vector{<:DP.Variable} H::Matrix{<:DP.Polynomial} is_feas::Bool # whether model should be primal-dual feasible; only for testing use_wsosmatrix::Bool # use wsosinterppossemideftri cone, else PSD formulation @@ -23,7 +23,7 @@ struct SemidefinitePolyJuMP{T <: Real} <: ExampleInstanceJuMP{T} end function SemidefinitePolyJuMP{Float64}( - x::Vector{DP.PolyVar{true}}, + x::Vector{DP.Variable{true}}, poly::DP.Polynomial, args..., ) From 680fd905a912576c26f269141223d3d7d8f3d4fa Mon Sep 17 00:00:00 2001 From: stephanmg Date: Fri, 17 Nov 2023 08:04:12 +0100 Subject: [PATCH 2/3] Renaming MultivariateBases -> MB. --- examples/contraction/JuMP.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/contraction/JuMP.jl b/examples/contraction/JuMP.jl index 5d78b28d6..0f7ea4b99 100644 --- a/examples/contraction/JuMP.jl +++ b/examples/contraction/JuMP.jl @@ -44,7 +44,7 @@ function build(inst::ContractionJuMP{T}) where {T <: Float64} JuMP.@variable( model, polys[1:3], - PolyJuMP.Poly(PolyJuMP.MultivariateBases.FixedPolynomialBasis(lagrange_polys)) + PolyJuMP.Poly(PolyJuMP.MB.FixedPolynomialBasis(lagrange_polys)) ) M = [polys[1] polys[2]; polys[2] polys[3]] From 21086ce7d9cf60eb28da207c2c938ad93ef4baac Mon Sep 17 00:00:00 2001 From: stephanmg Date: Fri, 17 Nov 2023 08:08:13 +0100 Subject: [PATCH 3/3] addinequality! -> add_inequality! --- examples/convexityparameter/JuMP.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/convexityparameter/JuMP.jl b/examples/convexityparameter/JuMP.jl index ed0c2fbd4..456416e0c 100644 --- a/examples/convexityparameter/JuMP.jl +++ b/examples/convexityparameter/JuMP.jl @@ -74,7 +74,7 @@ bss() = SAS.BasicSemialgebraicSet{Float64, DynamicPolynomials.Polynomial{true, F function get_domain_inequalities(dom::PolyUtils.BoxDomain, x) box = bss() for (xi, ui, li) in zip(x, dom.u, dom.l) - SAS.addinequality!(box, (-xi + ui) * (xi - li)) + SAS.add_inequality!(box, (-xi + ui) * (xi - li)) end return box end