title: How to symmetrize a sparse matrix in Eigen C++?
body: <p>I have a sparse matrix <code>A</code> in Eigen C++. Now I want to symmetrize it to another sparse matrix <code>Asym</code>:</p>
  
  <p>I was hoping that it would be as simple as:</p>
  
  <pre><code>Eigen::SparseMatrix&lt;FLOATDATA&gt; A;
  ...
  Eigen::SparseMatrix&lt;FLOATDATA&gt; Asym = 0.5*(A+A.transpose()); // error here
  </code></pre>
  
  <p>But due to obvious reasons, it gives the following assert failure error:</p>
  
  <pre><code>error: static assertion failed: THE_STORAGE_ORDER_OF_BOTH_SIDES_MUST_MATCH
  </code></pre>
  
  <p>My question is how to neatly do the above operation in Eigen C++?</p>