title: How do I multiply two sparse matrices in C?
body: <p>I have a sparse matrix D, and I want to multiply D_transpose and D to get L as follows:</p>
  
  <p>L = D'*D;</p>
  
  <p>I am using sparseBLAS to deal with sparse matrices, but the <a href="http://www.cerfacs.fr/algor/reports/2001/TR_PA_01_24.pdf" rel="nofollow">documentation</a> says there's nothing to multiply two sparse matrices. </p>
  
  <p>I am completely stuck and have no idea how to proceed. </p>
  
  <p>The dimensions of D are typically around 500,000 by 250,000. I cannot assign that much memory at all, so it just has to be done using sparse matrices. </p>
  
  <p>I did this using MATLAB, and I don't understand how MATLAB does it if it also uses sparseBLAS underneath the interface - or does it? If not, what does it use? I could use that too.</p>
  
  <p>Thank you for reading! </p>
  
  <p>EDIT: Solved. I needed the L matrix to multiply with a vector. So instead of first calculating L, I simply did D'*(D*x), thus avoiding the need for multiplication of two sparse matrices. I now only do sparse matrix and dense vector multiplicatin, which is supported by sparseBLAS. </p>