Skip to content

Commit

Permalink
Hessian formulation for WORHP, fixes #107
Browse files Browse the repository at this point in the history
  • Loading branch information
Xinliang committed May 29, 2020
1 parent 0835b40 commit c596a2c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/core/createLocalSolvers.m
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit c596a2c

Please sign in to comment.