Hi Ralf,Hello Umut,
some guesses (not checked with your code!!)
There are two values for the number of nonzeros in ublas
m.nnz() and m.nnz_capacity().
1. m.nnz_capacity() gives you the size of the array m.value_data().
2. m.nnz() gives you the size of the actually used number of nonzeros.