Navigation

Operators and Keywords

Function List:

C++ API

lsqnonneg.m File Reference


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

Function Documentation

if ( anyw > 0  ) 

if ( useqr   ) 

if ( isempty(x)   ) 

return endif if ( nargin >=2 &&nargin<=4 &&ismatrix(c)&&ismatrix(d)&&isstruct(options)  ) 

p ( idx   ) 

w (  ) 

while (  ) 

if (isempty (idx)) x( x (  ) 

xx (  ) 


Variable Documentation

alpha = min (sf)

else break

continue

function[x, resnorm, residual, exitflag, output, lambda]

Initial value:

 lsqnonneg (c, d, x = [], options = struct ())

  if (nargin == 1 && ischar (c) && strcmp (c, 'defaults'))
    x = optimset ("MaxIter", 1e5)

endif endif idx = find (xtmp < 0)

endif iter = 0

endif m = rows (c)

max_iter = optimget (options, "MaxIter", 1e5)

n = columns (c)

p = find (x > 0).'

else pidx = p(idx)

r = qr (c(:,p), 0)

sf = x(pidx)./(x(pidx) - xtmp(idx))

endif useqr = m >= n

endif endif endwhile w = c'*(d - c*x)

else x = max (x, 0)

if(useqr xtmp = c(:,p) \ d

xx = zeros (n, 1)