我正在使用Julia(v0.6.4)和JuMP(v0.18.2)解决IPOPT的问题。我想检查哪些约束在问题解决方案中起作用,并且该问题确实可行。
我用来执行此操作的代码是:
#model is a JuMP model
d=JuMP.NLPEvaluator(model)
n = MathProgBase.numconstr(model) #number of constraints
MathProgBase.initialize(d,[:Grad, :Jac, :ExprGraph]) #call first
g = zeros(n,1)
x = MathProgBase.getsolution(model.internalModel) #variable values
MathProgBase.eval_g(d,g,x) #evaluate g(x), store in g
我正在努力寻找说明NLPEvaluator值含义的文档。我得到的结果是:
JuMP.NLPEvaluator(最小化问题:* 191个线性约束 * 240个非线性约束* 232个变量
Solver是Ipopt,[10,1] = 1.0 [26,1] = 1.0 [30,
1] = 1.0 [31,1] = 1.0 [86,1] = 1.0 [90,1] = 1.0 [91,1] = 1.0 [146,1] = 1.0 [150,1] = 1.0 [151,1] = 1.0 [10,2] = -1.0⋮[68,227] = 1.0
[69,227] = 1.0 [128,228] = 1.0 [129,228] = 1.0 [188, 229] = 1.0 [189,229] = 1.0 [70,230] = 1.0 [71,230] = 1.0 [130,231] = 1.0 [131,231] = 1.0 [190,232] = 1.0 [191,232] = 1.0,#undef,true,#undef,#undef,#undef,#undef,#undef, #undef,#undef,#undef,#undef,#undef,[0.0、0.0、0.0,-1.0、1.0, 0.0,0.0,0.0,-402.868,-158.491…38.0627,7.9091e6,7.88152e6,7.8625e6,7.89457e6,7.86694e6,7.84789e6,7.9286e6,7.90109e6,7.88212e6],Float64 [],false,false, #undef,#undef,#undef,#undef,#undef,#undef,#undef,#undef,#undef,4、0.0、0.0、0.0、0.0、0.0)
我理解第一部分说明线性和非线性约束以及变量的数量。我也知道约束分为线性,二次和非线性。
我不理解的是#undef,false,true以及所有其他方括号和数字在结果的底部表示什么。
任何澄清或链接到资源将不胜感激!