[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Is A\b using a sparse solver if A is sparse?
From: |
LUK ShunTim |
Subject: |
Re: Is A\b using a sparse solver if A is sparse? |
Date: |
Thu, 02 Feb 2006 11:54:17 +0800 |
User-agent: |
Debian Thunderbird 1.0.7 (X11/20051017) |
David Bateman wrote:
> LUK ShunTim wrote:
>
>> Hello,
>>
>> If A is sparse, will A\b automatically use the sparse variant of the
>> linear equation solver?
>>
>> Regards,
>> ST
>> --
>>
> Yes.. In fact in 2.9.x it uses a polymorphic solver that has a selection
> tree
>
[snipped]
Thanks very much.
I got this rather strange result on octave 2.1.72 + octave-forge in
debian/sid.
<diary>
octave:2> A=sprand(2500,2500,0.03);
octave:3> b=eye(2500,1);
octave:4> r=A*b;
octave:8> fullA=full(A);
octave:9> tic;A\r;toc
ans = 19.277
octave:10> tic;A\r;toc
ans = 19.073
octave:11> tic;A\r;toc
ans = 19.340
octave:12> tic;fullA\r;toc
ans = 5.2551
octave:13> tic;fullA\r;toc
ans = 5.0916
octave:14> tic;fullA\r;toc
ans = 5.1038
</diary>
The full version appears to be *faster* than the sparse version (!),
which seems to be counter-intuitive. What have I missed?
Regards,
ST
--
-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.
Octave's home on the web: http://www.octave.org
How to fund new projects: http://www.octave.org/funding.html
Subscription information: http://www.octave.org/archive.html
-------------------------------------------------------------
Re: Is A\b using a sparse solver if A is sparse?, David Bateman, 2006/02/02