|
@@ -67,7 +67,12 @@
|
|
|
<td><pre><code>Acol_sum = sum(A,1)<br>Arow_sum = sum(A,2)<br>Adim_sum = sum(Asparse,dim)</code></pre></td>
|
|
|
<td><pre><code>Acol_sum = A.colwise().sum()<br>Arow_sum = A.rowwise().sum()<br>igl::sum(Asparse,dim,Adim_sum)</code></pre></td>
|
|
|
<td>Currently the igl version only supports sparse matrix input (and
|
|
|
- dim must be 1 or 2)</td>
|
|
|
+ dim must be 1 or 2).<br>
|
|
|
+ For sparse matrices, one could use
|
|
|
+ <code>A*Matrix<Atype,Dynamic,1>::Ones(A.cols(),1);</code> but this
|
|
|
+ will <b>not</b> work as expected for
|
|
|
+ <code>SparseMatrix<bool></code>.
|
|
|
+ </td>
|
|
|
</tr>
|
|
|
|
|
|
<tr class=d1>
|
|
@@ -285,6 +290,12 @@ bool a = A.array().any();
|
|
|
<td>Remove the diagonal from a sparse matrix.</td>
|
|
|
</tr>
|
|
|
|
|
|
+ <tr class=d1>
|
|
|
+ <td><pre><code>A = A - diag(diag(A));</code></pre></td>
|
|
|
+ <td><pre><code>A.prune([](const int r, const int c, const Scalar)->bool{return r!=c;});</code></pre></td>
|
|
|
+ <td>Remove the diagonal from a sparse matrix.</td>
|
|
|
+ </tr>
|
|
|
+
|
|
|
<!-- Insert rows for each command pair -->
|
|
|
|
|
|
<!-- Leave this here for copy and pasting
|