@@ -18,34 +18,34 @@ function JuMP.function_string(::MIME"text/plain", p::MP.AbstractPolynomialLike)
1818end
1919function JuMP. function_string (:: MIME"text/latex" , p:: MP.AbstractPolynomialLike )
2020 # `show` prints `$$` around what `_show` prints.
21- return sprint (MultivariatePolynomials . _show, MIME " text/latex" (), p)
21+ return sprint (MP . _show, MIME " text/latex" (), p)
2222end
2323
2424# ## Shapes for polynomial/moments primal-dual pair ###
2525
2626# Inspired from `JuMP.dual_shape` docstring example
27- struct PolynomialShape{MT<: AbstractMonomial ,MVT<: AbstractVector{MT} } < :
27+ struct PolynomialShape{MT<: MP. AbstractMonomial ,MVT<: AbstractVector{MT} } < :
2828 JuMP. AbstractShape
2929 monomials:: MVT
3030end
3131function JuMP. reshape_vector (x:: Vector , shape:: PolynomialShape )
32- return polynomial (x, shape. monomials)
32+ return MP . polynomial (x, shape. monomials)
3333end
34- struct MomentsShape{MT<: AbstractMonomial ,MVT<: AbstractVector{MT} } < :
34+ struct MomentsShape{MT<: MP. AbstractMonomial ,MVT<: AbstractVector{MT} } < :
3535 JuMP. AbstractShape
3636 monomials:: MVT
3737end
3838function JuMP. reshape_vector (x:: Vector , shape:: MomentsShape )
39- return measure (x, shape. monomials)
39+ return MM . measure (x, shape. monomials)
4040end
4141JuMP. dual_shape (shape:: PolynomialShape ) = MomentsShape (shape. monomials)
4242JuMP. dual_shape (shape:: MomentsShape ) = PolynomialShape (shape. monomials)
4343
4444JuMP. reshape_set (:: ZeroPolynomialSet , :: PolynomialShape ) = ZeroPoly ()
4545function JuMP. moi_set (
4646 :: ZeroPoly ,
47- monos:: AbstractVector{<:AbstractMonomial} ;
48- domain:: AbstractSemialgebraicSet = FullSpace (),
47+ monos:: AbstractVector{<:MP. AbstractMonomial} ;
48+ domain:: SS. AbstractSemialgebraicSet = SS . FullSpace (),
4949 basis = MB. MonomialBasis,
5050)
5151 return ZeroPolynomialSet (domain, basis, monos)
5656
5757Return the [`MomentsAttribute`](@ref) of `cref`.
5858"""
59- function MultivariateMoments . moments (cref:: JuMP.ConstraintRef )
59+ function MM . moments (cref:: JuMP.ConstraintRef )
6060 return MOI. get (cref. model, MomentsAttribute (), cref)
6161end
6262
@@ -79,14 +79,14 @@ bridges(S::Type{<:MOI.AbstractSet}) = bridges(MOI.VectorOfVariables, S)
7979
8080function bridges (
8181 F:: Type{<:MOI.AbstractVectorFunction} ,
82- :: Type{<:ZeroPolynomialSet{FullSpace}} ,
82+ :: Type{<:ZeroPolynomialSet{SS. FullSpace}} ,
8383)
8484 return [(Bridges. Constraint. ZeroPolynomialBridge, _coef_type (F))]
8585end
8686
8787function bridges (
8888 F:: Type{<:MOI.AbstractVectorFunction} ,
89- :: Type{<:ZeroPolynomialSet{<:AbstractAlgebraicSet}} ,
89+ :: Type{<:ZeroPolynomialSet{<:SS. AbstractAlgebraicSet}} ,
9090)
9191 return [(
9292 Bridges. Constraint. ZeroPolynomialInAlgebraicSetBridge,
@@ -183,19 +183,19 @@ function non_constant(a::AbstractVector{T}) where {T}
183183 # also take care of `collect`ing into a `Vector`
184184 return convert (Vector{non_constant_type (T)}, a)
185185end
186- non_constant_coefficients (p) = non_constant (coefficients (p))
186+ non_constant_coefficients (p) = non_constant (MP . coefficients (p))
187187
188188# # ZeroPoly
189189function JuMP. build_constraint (
190190 _error:: Function ,
191- p:: AbstractPolynomialLike ,
191+ p:: MP. AbstractPolynomialLike ,
192192 s:: ZeroPoly ;
193- domain:: AbstractSemialgebraicSet = FullSpace (),
193+ domain:: SS. AbstractSemialgebraicSet = SS . FullSpace (),
194194 kws... ,
195195)
196196 coefs = non_constant_coefficients (p)
197- monos = monomials (p)
198- if domain isa BasicSemialgebraicSet
197+ monos = MP . monomials (p)
198+ if domain isa SS . BasicSemialgebraicSet
199199 # p(x) = 0 for all x in a basic semialgebraic set. We replace it by
200200 # p(x) ≤ 0 and p(x) ≥ 0 for all x in the basic semialgebraic set.
201201 # We need to determine the cone two use for `NonNegPoly` which is stored
@@ -222,7 +222,7 @@ function JuMP.build_constraint(
222222end
223223function JuMP. build_constraint (
224224 _error:: Function ,
225- p:: AbstractPolynomialLike ,
225+ p:: MP. AbstractPolynomialLike ,
226226 s:: MOI.EqualTo ;
227227 kws... ,
228228)
@@ -258,7 +258,7 @@ function JuMP.add_constraint(
258258)
259259 cone = getdefault (model, NonNegPoly ())
260260 coefs = non_constant_coefficients (constraint. polynomial_or_matrix)
261- monos = monomials (constraint. polynomial_or_matrix)
261+ monos = MP . monomials (constraint. polynomial_or_matrix)
262262 set = PlusMinusSet (JuMP. moi_set (cone, monos; constraint. kws... ))
263263 new_constraint = JuMP. VectorConstraint (coefs, set, PolynomialShape (monos))
264264 bridgeable_con = bridgeable (
@@ -287,15 +287,15 @@ end
287287# `NonNegPoly`
288288function JuMP. build_constraint (
289289 _error:: Function ,
290- p:: AbstractPolynomialLike ,
290+ p:: MP. AbstractPolynomialLike ,
291291 s:: MOI.GreaterThan ;
292292 kws... ,
293293)
294294 return JuMP. build_constraint (_error, p - s. lower, NonNegPoly (); kws... )
295295end
296296function JuMP. build_constraint (
297297 _error:: Function ,
298- p:: AbstractPolynomialLike ,
298+ p:: MP. AbstractPolynomialLike ,
299299 s:: MOI.LessThan ;
300300 kws... ,
301301)
307307# need a more specific here to avoid ambiguity
308308function JuMP. build_constraint (
309309 _error:: Function ,
310- p:: AbstractMatrix{<:AbstractPolynomialLike} ,
310+ p:: AbstractMatrix{<:MP. AbstractPolynomialLike} ,
311311 s:: PSDCone ;
312312 kws... ,
313313)
317317# Needed for the syntax `@constraint(model, A >= B, PSDCone())`
318318function JuMP. build_constraint (
319319 _error:: Function ,
320- f:: AbstractMatrix{<:AbstractPolynomialLike} ,
320+ f:: AbstractMatrix{<:MP. AbstractPolynomialLike} ,
321321 s:: MOI.GreaterThan ,
322322 extra:: PSDCone ,
323323)
328328# Needed for the syntax `@constraint(model, A <= B, PSDCone())`
329329function JuMP. build_constraint (
330330 _error:: Function ,
331- f:: AbstractMatrix{<:AbstractPolynomialLike} ,
331+ f:: AbstractMatrix{<:MP. AbstractPolynomialLike} ,
332332 s:: MOI.LessThan ,
333333 extra:: PSDCone ,
334334)
0 commit comments