The value(.)
function accepts a ConstraintRef
argument, so you can use it to print the value of a JuMP @constraint
after the optimization is done. But if you have a @NLconstraint
, whose type is e.g. NonlinearConstraintRef{ScalarShape}
, calling value()
on it gives an error:
ERROR: MethodError: no method matching value(::NonlinearConstraintRef{ScalarShape})
Closest candidates are:
value(::Number) at ~/.julia/packages/JuMP/Y4piv/src/variables.jl:1327
value(::Function, ::ConstraintRef{<:AbstractModel, <:MathOptInterface.ConstraintIndex}) at ~/.julia/packages/JuMP/Y4piv/src/constraints.jl:913
value(::Function, ::VariableRef) at ~/.julia/packages/JuMP/Y4piv/src/variables.jl:1040
...
How can you get this value?