Path: news.mathworks.com!not-for-mail
From: "Bruno Luong" <b.luong@fogale.findmycountry>
Newsgroups: comp.soft-sys.matlab
Subject: Re: sparse matrix multiplication and cgs()
Date: Mon, 1 Jun 2009 15:36:01 +0000 (UTC)
Organization: FOGALE nanotech
Lines: 13
Message-ID: <h00sh1$jej$1@fred.mathworks.com>
References: <17247123.13121.1243869597327.JavaMail.jakarta@nitrogen.mathforum.org>
Reply-To: "Bruno Luong" <b.luong@fogale.findmycountry>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1243870561 19923 172.30.248.35 (1 Jun 2009 15:36:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 1 Jun 2009 15:36:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 390839
Xref: news.mathworks.com comp.soft-sys.matlab:543974


GS <gshy2014@gamil.com> wrote in message <17247123.13121.1243869597327.JavaMail.jakarta@nitrogen.mathforum.org>...
> Hello, 
>    I solved Ax=b, A is large(of size 2e5), sparse(each row has no more than 26 nonzero), symmetric positive definite matrix. I did it in two ways, 
> 1) L=chol(A,'lower'); tic, x=L\(L'\b),toc;
> 2) tic,[x,flag,resrel,iter]=cgs(A,b,[],n,[],[],x0),toc;
> 
> L is dense, iter=6. So theoretical 2) should be must faster than 1). 

Why not using PCG, which is design for spd matrix? Not sure about the "theoretical" claim above: CGS/PCG convergence depends on the condition number of A. If cond(A)=A it will converge in no time (1 iteration is enough in fact).

Iterative methods are not always faster than direct method.

Bruno