diff --git a/src/SAGE/SAGE.jl b/src/SAGE/SAGE.jl index f220ec1..d8e73d6 100644 --- a/src/SAGE/SAGE.jl +++ b/src/SAGE/SAGE.jl @@ -73,6 +73,9 @@ function JuMP.build_constraint( set::Union{Signomials,Polynomials}; kws..., ) + for (key, _) in kws + _error("unsupported keyword argument `$key`.") + end coefs = PolyJuMP.non_constant_coefficients(p) monos = MP.monomials(p) cone = JuMP.moi_set(set, monos) diff --git a/test/sage.jl b/test/sage.jl index 31b233a..a73e716 100644 --- a/test/sage.jl +++ b/test/sage.jl @@ -75,6 +75,17 @@ function test_motzkin(x, y, T, solver) return end +# See https://github.com/jump-dev/PolyJuMP.jl/issues/102#issuecomment-1888004697 +function test_domain(x, y, T, solver) + p = x^3 - x^2 + 2x * y - y^2 + y^3 + S = @set x >= 0 && y >= 0 && x + y >= 1 + model = Model(solver) + setpolymodule!(model, PolyJuMP.SAGE) + @variable(model, α) + @objective(model, Max, α) + @test_throws ErrorException @constraint(model, c3, p >= α, domain = S) +end + import ECOS const SOLVERS = [optimizer_with_attributes(ECOS.Optimizer, MOI.Silent() => true)]