You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The type of the returned variable may depend on the type of the domain. For instance with SumOfSquares, it is MatPolynomial{JuMP.VariableRef} for a domain FullSpace while with a domain is will be Polynomial{AffExpr}.
If the domain is not in NonNegPoly then JuMP.variable_type will not be possible to implement because it should only depend on the type of positional arguments (see https://github.com/JuliaOpt/JuMP.jl/blob/64c5834412cb22dc7047e3edaf5bdc62d0303d3d/src/macros.jl#L1086).
However, using the domain keyword is more consistent with the @constraint macro.
We could return a Polynomial{AffExpr} in the case the domain is a FullSpace too (we just need to call polynomial on the MatPolynomial before returning it) so that the value of variable_type does not depend on the type of the domain.
@variable(m, p, NonNegPoly(X))
perhaps also
@variable(m, p, NonNegPoly(X), domain=D)
? (or maybe domain could be a second argument to NonNegPoly)The text was updated successfully, but these errors were encountered: