[SciPy-user] [Sparse matrix library] csr_matrix and

Nathan Bell wnbell at gmail.com
Mon Apr 28 12:30:42 EDT 2008


On Mon, Apr 28, 2008 at 10:57 AM, Dinesh B Vadhia
<dineshbvadhia at hotmail.com> wrote:
>
>
> Okay, I see what is going on.  Uhmmm!  If I replace int8 with int16 or int32
> then this will increase the size of A in memory which will defeat the
> purpose of the original exercise to minimize the size of A (as they are very
> large).  Unless there is a way to coerce the calculation A.sum(0) into a
> int16 then looks like I'll have to evaluate A.sum(0) in brute force fashion
> at the time of A's creation, save it and read it into the program at
> execution.

It's the difference between roughly 5 bytes per nonzero and 6 bytes
per nonzero.  The column index for each nonzero is a 4 byte integer,
so there's little difference in the total memory cost (4+1 vs. 4+2).

-- 
Nathan Bell wnbell at gmail.com
http://graphics.cs.uiuc.edu/~wnbell/



More information about the SciPy-User mailing list