Skip to content

Commit

Permalink
Fix lpsolver when matrices empty
Browse files Browse the repository at this point in the history
  • Loading branch information
mldiego committed Oct 8, 2024
1 parent c04352a commit 6e2e966
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 6e2e966

Please sign in to comment.