Skip to content

Commit ae8a367

Browse files
committed
Handle empty H in new implementation of fix_integer.
1 parent 42baaf8 commit ae8a367

1 file changed

Lines changed: 13 additions & 3 deletions

File tree

lib/miqps_master.m

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -252,10 +252,20 @@
252252
if fix_integer_presolve
253253
x = x0;
254254
Axj = A(:,j) * x(j);
255+
cc = c(~j);
256+
if isempty(H)
257+
HH = [];
258+
else
259+
HH = H(~j, ~j);
260+
cc = cc + (H(~j,j)+H(j,~j)') * x(j)
261+
end
255262
[x(~j), f, eflag, output, lambda] = ...
256-
qps_master(H(~j, ~j), c(~j) + (H(~j,j)+H(j,~j)') * x(j), ...
257-
A(:, ~j), l-Axj, u-Axj, xmin(~j), xmax(~j), x(~j), opt);
258-
f = f + (x(j)' * H(j,j) + c(j)') * x(j);
263+
qps_master(HH, cc, A(:, ~j), l-Axj, u-Axj, ...
264+
xmin(~j), xmax(~j), x(~j), opt);
265+
f = f + c(j)' * x(j);
266+
if ~isempty(H)
267+
f = f + x(j)' * H(j,j) * x(j);
268+
end
259269
mu_lower = zeros(size(x));
260270
mu_upper = zeros(size(x));
261271
mu_lower(~j) = lambda.lower;

0 commit comments

Comments
 (0)