I am confused on how the boost::compressed_matrix works. Suppose I declare the compressed_matrix like this:
boost::numeric::ublas::compressed_matrix<double> T(1000, 1000, 3*1000);
This allocates space for 3*1000 elements in a 1000x1000 matrix. Now how do I give it the locations which are the non-zero elements? When and how are the non-zero elements set? Is it each time I assign an element in the matrix, e.g. B(4,4)=4, it would mark that element as non-zero?
I would really appreciate if you could help me learn this using an example if possible. Some insight into the internal implementation would be great. I want to make sure I don't write programs that are sub-optimal by guess work.
thank you!