Functions | |
endif | if (all(size(c) > 1)||iscomplex(c)||ischar(c)) error("C must be a real vector") |
if (isempty(a)) error("A cannot be an empty matrix") | |
if (!isreal(a)||nxa!=nx) error("A must be a real valued %d by %d matrix" | |
endif | if (isempty(b)) error("B cannot be an empty vector") |
endif | if (!isreal(b)||length(b)!=nc) error("B must be a real valued %d by 1 vector" |
endif | if (nargin > 3) if(isempty(lb)) lb |
elseif (!isreal(lb)||all(size(lb) > 1)||length(lb)!=nx) error("LB must be a real valued %d by 1 column vector" | |
endif | if (nargin > 4) if(isempty(ub)) ub |
elseif (!isreal(ub)||all(size(ub) > 1)||length(ub)!=nx) error("UB must be a real valued %d by 1 column vector" | |
endif | if (nargin > 5) if(isempty(ctype)) ctype |
elseif (!ischar(ctype)||all(size(ctype) > 1)||length(ctype)!=nc) error("CTYPE must be a char valued vector of length %d" | |
elseif (!all(ctype=="F"|ctype=="U"|ctype=="S"|ctype=="L"|ctype=="D")) error("CTYPE must contain only F | |
endif | if (nargin > 6) if(isempty(vartype)) vartype |
elseif (!ischar(vartype)||all(size(vartype) > 1)||length(vartype)!=nx) error("VARTYPE must be a char valued vector of length %d" | |
elseif (!all(vartype=="C"|vartype=="I")) error("VARTYPE must contain only C or I") | |
endif | if (nargin > 7) if(isempty(sense)) sense |
elseif (ischar(sense)||all(size(sense) > 1)||!isreal(sense)) error("SENSE must be an integer value") | |
elseif (sense >=0) sense | |
endif | if (nargin > 8) if(!isstruct(param)) error("PARAM must be a structure") |
Variables | |
function [xopt, fmin, status, extra] | |
return | |
endif | nx = length (c) |
c = c(:) | |
endif [nc, nxa] = size(a) | |
nc | |
endif else | lb = zeros (nx, 1) |
endif else | ub = repmat (Inf, nx, 1) |
U | |
S | |
L | |
or | D |
endif else | ctype = repmat ("S", nc, 1) |
endif else | vartype = repmat ("C", nx, 1) |
else | sense = -1 |
endif else | param = struct () |
elseif | ( | sense >= | 0 | ) |
elseif | ( | ! | allvartype=="C"|vartype=="I" | ) |
elseif | ( | ! | allctype=="F"|ctype=="U"|ctype=="S"|ctype=="L"|ctype=="D" | ) |
endif if | ( | isempty(b) | ) |
if | ( | !isreal(a)||nxa! | = nx |
) |
if | ( | isempty(a) | ) |
c = c(:) |
or D |
nx = length (c) |
return |
S |
U |