Boost logo

Ublas :

From: Gunter Winkler (guwi17_at_[hidden])
Date: 2007-03-14 07:17:24


On Wednesday 14 March 2007 11:33, Sourabh wrote:
> Hi,
> When I use a square compressed matrix of size 100 * 100 where the number
> of nonzero entries are 100, what will be the memory taken by that matrix ?

m rows, n cols:
(m+1) size_t for index1_data_
(nnz_capacity) size_t for index2_data_
(nnz_capacity) double for value_data_
plus some additional integers ( sizeof(A) ) for management

If you construct the matrix with A(m,n,nnz) then nnz_capacity is initialized
with nnz. Otherwise the capacity is increased (=doubled) dynamically when the
number of nonzeroes reaches the current capacity.

mfg
Gunter