Closed
Description
This has come up a few times.
It occurs in GasModels.jl, where they want signpower(x, p) = sign(x) * abs(x)^p
, and a variant appeared in https://discourse.julialang.org/t/nonlinear-optimization-with-many-constraints-autodifferentiation-which-julia-solution/110678
We could either define Base.sign(x::AbstractJuMPScalar) = op_ifelse(op_strictly_greater_than(x, 0), 1, -1)
, or we could add direct support to JuMP and MOI.
Metadata
Metadata
Assignees
Labels
No labels