help-octave
[Top][All Lists]
Advanced

[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: Dmitri A. Sergatskov
Subject: Re: Is A\b using a sparse solver if A is sparse?
Date: Wed, 01 Feb 2006 22:50:20 -0700
User-agent: Mozilla Thunderbird 1.0.7-1.4.1 (X11/20051007)

LUK ShunTim wrote:
...
octave2.9:11> tic;A\r;toc
ans = 12.117
octave2.9:12> tic;fullA\r;toc
ans = 6.6568

I just like to note a couple things:

-- The result of A\r is a full matrix
this remains the case even if
 b=speye (2500,1); r=A*b;
and hence r becomes also a sparse.
I am not sure if this conversion to a full
matrix is a bug or a feature.

-- On my computer the difference is about 20%
  not a factor of 2. Do you have and use ATLAS?

octave:1> A=sprand(2500,2500,0.03);
octave:2> b=speye (2500,1);
octave:3> r=A*b;
octave:4> tic;C=A\r;toc
ans = 5.0834
octave:5> fullA=full(A);
octave:6> tic;D=fullA\r;toc
ans = 4.0818
octave:7> whos C

*** local user variables:

  Prot Name        Size                     Bytes  Class
  ==== ====        ====                     =====  =====
   rwd C        2500x1                      20000  matrix

Total is 2500 elements using 20000 bytes

octave:8> CC=sparse (C);
octave:9> whos CC

*** local user variables:

  Prot Name        Size                     Bytes  Class
  ==== ====        ====                     =====  =====
   rwd CC       2500x1                      30008  sparse matrix

Total is 2500 elements using 30008 bytes

(The sparse version is large than the full, perhaps the conversion to
full does make sense.)

Sincerely,

Dmitri.



-------------------------------------------------------------
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
-------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]