[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: elements of a sparse matrix
From: |
Søren Hauberg |
Subject: |
Re: elements of a sparse matrix |
Date: |
Mon, 27 Dec 2010 17:42:50 +0100 |
man, 27 12 2010 kl. 18:32 +0200, skrev Jaana Tommiska:
> I wrote these lines
> B=sprand(20000,10000,0.01);
> A=B'*B;
> A(10000,10000)
> or
> A(10000*10000)
>
> I am interested if the matrix A is too big to fit in the memory?
So, the 'B' matrix will contain roughly
20000 * 10000 *0.01 = 2 million
non-zero elements. That will roughly require 16 MB when using double
precision, so that shouldn't be a problem.
The 'A' matrix will *not* be sparse, so it will contain
10000 * 10000 = 100 million
elements. Each requires 8 bytes, so that's 800 megabytes of data. If you
can have that in memory or depends on your machine, but it is a big
matrix if you ask me.
Søren