Path: news.mathworks.com!not-for-mail
From: "Tim Davis" <davis@cise.ufl.edu>
Newsgroups: comp.soft-sys.matlab
Subject: Re: nonnegative Ax=b lsq for large, sparse A.
Date: Wed, 1 Jul 2009 22:31:01 +0000 (UTC)
Organization: University of Florida
Lines: 27
Message-ID: <h2go35$kl1$1@fred.mathworks.com>
References: <h22iil$a5s$1@fred.mathworks.com> <h22k59$om8$1@fred.mathworks.com> <h22ot5$bca$1@fred.mathworks.com> <h22q2l$sdn$1@fred.mathworks.com> <h22tdi$em2$1@fred.mathworks.com>
Reply-To: "Tim Davis" <davis@cise.ufl.edu>
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 1246487461 21153 172.30.248.37 (1 Jul 2009 22:31:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 1 Jul 2009 22:31:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 45902
Xref: news.mathworks.com comp.soft-sys.matlab:552225


"Thomas Clark" <t.clark@remove.spamcantab.net> wrote in message <h22tdi$em2$1@fred.mathworks.com>...
> @Tim,
> 
> Thanks very much, you're more than welcome to add it to your collection - if you like, I can submit it via the online interface.
> I've resubmitted the matrix in text file form (A and b) at the same link, the .mat file must have become corrupted.
> www2.eng.cam.ac.uk/~thc29/lsqnonneg_sparse/
> 
> @Matt,
> 
> Unfortunately, the hessian is not diagonally concentrated, so I'm trying the solution out without a preconditioner. 
> 
> However, I am getting some very good results. This is standing up extremely well against an alternative (iterative) approach to the same overall problem... It's also  reasonably quick even without preconditioning. I'm on the way, and will invest more time testing this rigorously.
> 
> Thanks, both of you :)
> 
> Tom Clark


I've downloaded the matrix (A.txt and b.txt).  Both x=A\b and x=spqr_solve(A,b) ran out of memory on my 32-bit, 4GB RAM, 3.2GHz Pentium 4 computer with MATLAB R2009a.  And of course they woudn't give the right solution anyway even if they did work.  I then tried  lsqlin (A,b, [],[],[],[], lb) ; where lb is an all-zeros vector.  It finished in 88 seconds, and returns an x with norm(A*x-b) of about 29.97, and min(x) is about 1e-15.

I tried lsqnonneg(A,b), after waiting maybe 10 minutes, it's is still running.  It would go faster if the backslash inside is replaced with spqr_solve.  Maybe I'll give that a try.

Once you figure out a solution using Matt's method, could you post, here, a function

x = mysolver(A,b) ;

that solves your system?  And maybe a flag saying whether or not to do preconditioning?  Then I can post that along with the matrix, in my collection, and then if someone looks at the problem there they might find yet a better method.  In any case, it's nice to include a proper solution method with a matrix in my collection.