How much space is allocated by boost compressed_matrix? Is it true that it only allocates space for non-zero elements? If this is true, I don't understand why the following code gives bad_alloc error.
namespace bubla = boost::numeric::ublas;
typedef double value_type;
typedef bubla::compressed_matrix<value_type> SparseMatrix;
unsigned int m = 10000*10000;
SparseMatrix D(m,m,3*m), X;
It should only allocate space for 3*m=3*10000*10000 elements right?
Could you please help clarify? What data structure in boost I could use to only allocate space for the non-zero elements. Secondly, how do I set values for the non-zero elements?
Many thanks.