diff --git a/code/nnv/engine/utils/lpsolver.m b/code/nnv/engine/utils/lpsolver.m index 41c320658..c238c111c 100644 --- a/code/nnv/engine/utils/lpsolver.m +++ b/code/nnv/engine/utils/lpsolver.m @@ -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