Browse Source

note about removing diagonal of sparse matrix

Former-commit-id: 9990af95525814d0a140e3c098fb5ffaf8a8f5f9
Alec Jacobson 8 years ago
parent
commit
0183c5ef17
1 changed files with 6 additions and 0 deletions
  1. 6 0
      matlab-to-eigen.html

+ 6 - 0
matlab-to-eigen.html

@@ -279,6 +279,12 @@ bool a = A.array().any();
         <td></td>
       </tr>
 
+      <tr class=d0>
+        <td><pre><code>A = A - diag(diag(A));</code></pre></td>
+        <td><pre><code>A.prune([](const int r, const int c, const Scalar)-&gt;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