Boost logo

Ublas :

From: Sourabh (sourabh_at_[hidden])
Date: 2007-03-14 06:33:46


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 ?

Reference: Please look at the following program:

int main (int argc, char* argv[])
{
    unsigned int numpaths = atoi (argv[1]);
    unsigned int gatesperpath = atoi (argv[2]);
    std::vector<compressed_matrix<double> > Vector;

    PrintMemoryUsage ();
    Vector.resize (numpaths);

    PrintMemoryUsage ();
    for (unsigned i = 0; i < numpaths; ++i) {
        Vector[i].resize (gatesperpath +1, gatesperpath+1, false);
    }
    PrintMemoryUsage ();
    for (unsigned i = 0; i < numpaths; ++i) {
         for (unsigned j = 0; j < gatesperpath; ++j) {
            Vector[i](j+1, j) = 0.2;
         }
    }
    PrintMemoryUsage ();
}

-- 
-- Sourabh