Boost logo

Ublas :

Subject: [ublas] coordinate_matrix capacity minimum size
From: Neil Windelinckx (neil.windelinckx_at_[hidden])
Date: 2008-12-19 05:20:11


Hi,
I've been looking at using the coordinate_matrix to implement some
sparse matricies.
However, I see that the minimum capacity is set to the max( nnz, min(
size1, size2) ) this makes the use of this matrix for very large, and
very sparse matricies very impractical.
Eg. Creating a empty 1,000,000x1,000,000 double coordinate_matrix
instantly consumes the memory for two index arrays and one value array
all of size 1,000,000 (in excess of 15 MB!!)
This memory is used irrespective of the actual number of non zero
elements in the matrix.
This seems to be very inefficient to me, and very impractical. Is there
any particular reason as to why the capacity of the matrix has this
minimum size?
Cheers
Neil.