Skip to content

Commit

Permalink
Merge pull request #246 from mldiego/master
Browse files Browse the repository at this point in the history
Fix lpsolver when matrices empty
  • Loading branch information
mldiego authored Oct 8, 2024
2 parents c04352a + 6e2e966 commit 5e604b9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions code/nnv/engine/utils/lpsolver.m
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@
Aeq = gather(Aeq); Beq = gather(Beq); ub = gather(ub);
end

if isempty(A)
A = zeros(length(b), 'like', b);
end

if isempty(f)
f = zeros(length(b),1, 'like', b);
end

dataType = class(f);

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

0 comments on commit 5e604b9

Please sign in to comment.