Skip to content

Commit 6e2e966

Browse files
committed
Fix lpsolver when matrices empty
1 parent c04352a commit 6e2e966

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)