Path: news.mathworks.com!not-for-mail
From: "John D'Errico" <woodchips@rochester.rr.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: nonnegative Ax=b lsq for large, sparse A.
Date: Fri, 26 Jun 2009 13:58:01 +0000 (UTC)
Organization: John D'Errico (1-3LEW5R)
Lines: 35
Message-ID: <h22k59$om8$1@fred.mathworks.com>
References: <h22iil$a5s$1@fred.mathworks.com>
Reply-To: "John D'Errico" <woodchips@rochester.rr.com>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1246024681 25288 172.30.248.37 (26 Jun 2009 13:58:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 26 Jun 2009 13:58:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 869215
Xref: news.mathworks.com comp.soft-sys.matlab:550887


"Thomas Clark" <t.clark@remove.spamcantab.net> wrote in message <h22iil$a5s$1@fred.mathworks.com>...
> Hello all,
> 
> I have a large, sparse, rectangular (overdetermined) matrix A.
> 
> I'm solving Ax = b, where all elements of A, x and b are nonnegative.
> 
> I thought at first that lsqnonneg would be my ideal function, however, I hadn't realised that it is not useful for large sparse matrices (creates a full matrix the same size as A).
> 
> Does anyone know of an alternative for lsqnonneg which may be used with a large, sparse coefficients matrix?
> 
> A sample of the problem (.mat file containing A and b) can be found in:
> http://www2.eng.cam.ac.uk/~thc29/lsqnonneg_sparse/
> 
> Tim Davis, if you happen across this, you may enjoy the sparsity pattern (it's for a tomographic reconstruction of a particle field in fluid flow).
> 
> Thanks all, and kind regards
> 
> Tom Clark

lsqlin does accept sparse bound constrained problems.

A = sprand(2000,1000,.005);
b = rand(2000,1);
lb = zeros(1000,1);

tic,x = A\b;toc
Elapsed time is 27.267806 seconds.

tic,x = lsqlin(A,b,[],[],[],[],lb,[],[],opts);toc
Optimization terminated: relative function value changing by less
 than sqrt(OPTIONS.TolFun), and rate of progress is slow.
Elapsed time is 2.186524 seconds.

John