Functions | |
return endif | if (!(nargin >=2 &&nargin<=4 &&ismatrix(c)&&ismatrix(d)&&isstruct(options))) print_usage() |
if (isempty(x)) x | |
if (useqr)[q | |
while (iter< max_iter) while(iter< max_iter) iter++ | |
if(isempty(idx)) x( | x (p) |
xx (p) | |
p (idx) | |
w (p) | |
if (!any(w > 0)) if(useqr) useqr | |
Variables | |
function [x, resnorm, residual, exitflag, output, lambda] | |
endif | m = rows (c) |
n = columns (c) | |
else | x = max (x, 0) |
endif | useqr = m >= n |
max_iter = optimget (options, "MaxIter", 1e5) | |
p = find (x > 0).' | |
r = qr (c(:,p), 0) | |
endif | iter = 0 |
else | xtmp = c(:,p) \ d |
endif | idx = find (xtmp < 0) |
break | |
else | pidx = p(idx) |
sf = x(pidx)./(x(pidx) - xtmp(idx)) | |
alpha = min (sf) | |
xx = zeros (n, 1) | |
endif endif endwhile | w = c'*(d - c*x) |
continue |
if | ( | ! | anyw > 0 | ) |
if | ( | useqr | ) |
if | ( | isempty(x) | ) |
return endif if | ( | ! | nargin >=2 &&nargin<=4 &&ismatrix(c)&&ismatrix(d)&&isstruct(options) | ) |
p | ( | idx | ) |
w | ( | p | ) |
while | ( | ) |
if (isempty (idx)) x( x | ( | p | ) |
xx | ( | p | ) |
else break |
continue |
endif m = rows (c) |
n = columns (c) |
p = find (x > 0).' |
r = qr (c(:,p), 0) |
else x = max (x, 0) |
xx = zeros (n, 1) |