Skip to content

Commit 5e604b9

Browse files
authored
Merge pull request #246 from mldiego/master
Fix lpsolver when matrices empty
2 parents c04352a + 6e2e966 commit 5e604b9

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

code/nnv/engine/utils/lpsolver.m

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,14 @@
2525
Aeq = gather(Aeq); Beq = gather(Beq); ub = gather(ub);
2626
end
2727

28+
if isempty(A)
29+
A = zeros(length(b), 'like', b);
30+
end
31+
32+
if isempty(f)
33+
f = zeros(length(b),1, 'like', b);
34+
end
35+
2836
dataType = class(f);
2937

3038
if strcmp(dataType, "single") || isa(A, "single") % ensure variables are all of type double

0 commit comments

Comments
 (0)