Browse Source

note about removing diagonal of sparse matrix

Former-commit-id: 9990af95525814d0a140e3c098fb5ffaf8a8f5f9
Alec Jacobson 8 năm trước cách đây
mục cha
commit
0183c5ef17
1 tập tin đã thay đổi với 6 bổ sung0 xóa
  1. 6 0
      matlab-to-eigen.html

+ 6 - 0
matlab-to-eigen.html

@@ -279,6 +279,12 @@ bool a = A.array().any();
         <td></td>
         <td></td>
       </tr>
       </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 -->
       <!-- Insert rows for each command pair -->
 
 
       <!-- Leave this here for copy and pasting
       <!-- Leave this here for copy and pasting