Navigation

Operators and Keywords

Function List:

C++ API

: x = lsqnonneg (c, d)
: x = lsqnonneg (c, d, x0)
: x = lsqnonneg (c, d, x0, options)
: [x, resnorm] = lsqnonneg (…)
: [x, resnorm, residual] = lsqnonneg (…)
: [x, resnorm, residual, exitflag] = lsqnonneg (…)
: [x, resnorm, residual, exitflag, output] = lsqnonneg (…)
: [x, resnorm, residual, exitflag, output, lambda] = lsqnonneg (…)

Minimize norm (c*x - d) subject to x >= 0.

c and d must be real.

x0 is an optional initial guess for x.

Currently, lsqnonneg recognizes these options: "MaxIter", "TolX". For a description of these options, see ‘optimset’.

Outputs:

  • resnorm

    The squared 2-norm of the residual: norm (c*x-d)^2

  • residual

    The residual: d-c*x

  • exitflag

    An indicator of convergence. 0 indicates that the iteration count was exceeded, and therefore convergence was not reached; >0 indicates that the algorithm converged. (The algorithm is stable and will converge given enough iterations.)

  • output

    A structure with two fields:

    • "algorithm": The algorithm used ("nnls")
    • "iterations": The number of iterations taken.
  • lambda

    Not implemented.

See also: optimset, pqpnonneg, lscov.

Package: octave