title: Is there any efficient way to dynamically change the compress_matrix in boost?
body: <p>I am using ublas::Compressed Matrix to work with UMFPACK, a sparse linear solver. Since I am doing a simulation, so every time the linear system is constructed slightly differently that might involve enlarging/shrinking the coefficient matrix and some sparse matrix multiplications. The scale of the linear system is around 25k.</p>
  
  <p>Even there is a binding patch for boost to work with UMFPACK, I still need to change the matrix from time to time, sometimes even figuring out the number of non-zero values would be time-consuming(ideally, I have to give the number of non-zero values when I initialize a matrix). Also, I use ublas::range to append columns/rows dynamically.</p>
  
  <p>So my question is: is there any efficient way to do this? Right now it's too slow for me. Transposing a matrix with dimension like 15k costs nearly 6s and appending about 12k rows is fast(because I guess it's a row-major matrix), but appending the same number of columns to the matrix can cost up to 20s(i guess for the same reason as above, so even I used a column-major matrix the total time required would be the same).</p>
  
  <p>Kinda getting desperate here. Any suggestion is welcome.</p>
  
  <p>Cheers.</p>