From c596a2c33753a03d533c193cb64b0b7d4101743c Mon Sep 17 00:00:00 2001 From: Xinliang Date: Fri, 29 May 2020 17:16:13 +0200 Subject: [PATCH] Hessian formulation for WORHP, fixes #107 --- src/core/createLocalSolvers.m | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/createLocalSolvers.m b/src/core/createLocalSolvers.m index 579dd06..aca36f4 100644 --- a/src/core/createLocalSolvers.m +++ b/src/core/createLocalSolvers.m @@ -40,8 +40,8 @@ rhoCas,... opts); pars = struct('lam_g0', [], 'lam_x0', []); - solve_nlp = @(x, z, rho, lambda, Sigma, pars)build_nlp_with_casadi(funs.ffi{i}, funs.ggi{i}, funs.hhi{i}, sProb.AA{i}, lambda, rho, z, Sigma, x, sProb.llbx{i}, sProb.uubx{i}, sens.JJac{i}, sens.gg{i}, sens.HH{i}); - +% solve_nlp = @(x, z, rho, lambda, Sigma, pars)build_nlp_with_casadi(funs.ffi{i}, funs.ggi{i}, funs.hhi{i}, sProb.AA{i}, lambda, rho, z, Sigma, x, sProb.llbx{i}, sProb.uubx{i}, sens.JJac{i}, sens.gg{i}, sens.HH{i}); + solve_nlp = @(x, z, rho, lambda, Sigma, pars)build_nlp_with_casadi(x, z, rho, lambda, Sigma, pars, nlp_reference, sProb.llbx{i}, sProb.uubx{i}, gBounds.llb{i}, gBounds.uub{i}); elseif strcmp(solver, 'worhp') pars = []; funs = sProb.locFuns; @@ -120,7 +120,7 @@ grad = @(x)build_grad(x, dfdx(x), lambda, A, rho, z, Sigma); % unconstrained problem and Hessian is computed by hand Hess = @(x, mu, scale)(scale * Hessian(x,lambda) + scale * rho*Sigma); - [xopt, multiplier] = worhp_interface(cost,grad,[],[],Hess,x0',[],lbx',ubx',[],[]); + [xopt, multiplier] = worhp_interface(cost,grad,Hess,x0',lbx',ubx); res.x = xopt; res.lam_g = []; res.lam_x = multiplier;