Skip to content

Commit a49b0c2

Browse files
committed
Force integer variables to closest integer values when fix_integer is true.
1 parent ae8a367 commit a49b0c2

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

lib/miqps_master.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,7 @@
249249
end
250250
j = (vtype == 'B' | vtype == 'I')';
251251
if isfield(opt, 'fix_integer') && opt.fix_integer
252+
x0(j) = round(x0(j));
252253
if fix_integer_presolve
253254
x = x0;
254255
Axj = A(:,j) * x(j);
@@ -257,7 +258,7 @@
257258
HH = [];
258259
else
259260
HH = H(~j, ~j);
260-
cc = cc + (H(~j,j)+H(j,~j)') * x(j)
261+
cc = cc + (H(~j,j)+H(j,~j)') * x(j);
261262
end
262263
[x(~j), f, eflag, output, lambda] = ...
263264
qps_master(HH, cc, A(:, ~j), l-Axj, u-Axj, ...

0 commit comments

Comments
 (0)