I am interested in getting the values of my constraints evaluated at a particular spot in the design space. Here is an example to explain what I am trying to do:
using JuMP
m = Model()
@variable(m, x, start = 0.0)
@variable(m, y, start = 0.0)
@NLobjective(m, Min, (1-x)^2 + 100(y-x^2)^2)
N=@NLconstraint(m, x^2 + y == 10)
solve(m)
I know that I can look at the infeasibility of the dual problem using:
getdual(N)
But, I would like to do something like
julia> getvalue(N)
ERROR: MethodError: no method matching getvalue(::JuMP.ConstraintRef{JuMP.Model,JuMP.GenericRangeConstraint{JuMP.NonlinearExprData}})
Closest candidates are:
getvalue(::JuMP.NonlinearExpression) at /home/febbo/.julia/v0.5/JuMP/src/nlp.jl:1323
getvalue(::JuMP.NonlinearParameter) at /home/febbo/.julia/v0.5/JuMP/src/nlp.jl:41
getvalue(::JuMP.GenericQuadExpr{Float64,JuMP.Variable}) at /home/febbo/.julia/v0.5/JuMP/src/quadexpr.jl:92
...
So, I want to look at the values of the constraints in my actual problem, not the dual problem.
Is there a way to do this without turning my constraints into @NLexpressions?