solves the linear least squares problem with nonnegative variables using the block principal pivoting algorithm in:
Portugal, Judice and Vicente, A comparison of block pivoting and interior point algorithms for linear least squares problems with nonnegative variables, Mathematics of Computation, 63(1994), pp. 625-643
It works nicely for my matrices of about 1024x20 and is significantly faster than 'lsqnonneg'.
For 100 (random) trials, A is 1024x20, b is 1024x1:
'blocknnls' = 0.686167 seconds
'lsqnonneg' = 5.869711 seconds
13 Aug 2005
Faster than lsqonneg for some sizes of problems.
Interestingly, my tests show it is slower than lsqnonneg
when the number of unknowns to estimate is small, say 2 or 3 and there are few rows in A. Thus, for size(A) ==
[5,2], lsqnonneg is 3x faster. For size(A) == [100,10],
blocknnls is 3x faster.
28 Apr 2006
The way the sets F and G are updated in each iteration is corrected.
The permutation of the set is now fixed to avoid different solutions every time the function is used with the same input data. If random required, just uncomment line.