浏览代码

note about removing diagonal of sparse matrix

Former-commit-id: 9990af95525814d0a140e3c098fb5ffaf8a8f5f9
Alec Jacobson 8 年之前
父节点
当前提交
0183c5ef17
共有 1 个文件被更改,包括 6 次插入0 次删除
  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