diff options
author | Gael Guennebaud <g.gael@free.fr> | 2015-10-26 18:20:00 +0100 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2015-10-26 18:20:00 +0100 |
commit | e6f8c5c325fca53b53436b6bd8d66749444216bb (patch) | |
tree | 2ae45f2b23242e6c92ce2d2e2cef3c9937840957 /test | |
parent | a5324a131f3816c8312e27a9dc928b8d56d8cf3b (diff) |
Add support to directly evaluate the product of two sparse matrices within a dense matrix.
Diffstat (limited to 'test')
-rw-r--r-- | test/sparse_product.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/sparse_product.cpp b/test/sparse_product.cpp index f1e5b8e4c..8c83f08d7 100644 --- a/test/sparse_product.cpp +++ b/test/sparse_product.cpp @@ -76,6 +76,17 @@ template<typename SparseMatrixType> void sparse_product() VERIFY_IS_APPROX(m4=(m2t.transpose()*m3t.transpose()).pruned(0), refMat4=refMat2t.transpose()*refMat3t.transpose()); VERIFY_IS_APPROX(m4=(m2*m3t.transpose()).pruned(0), refMat4=refMat2*refMat3t.transpose()); + // dense ?= sparse * sparse + VERIFY_IS_APPROX(dm4 =m2*m3, refMat4 =refMat2*refMat3); + VERIFY_IS_APPROX(dm4+=m2*m3, refMat4+=refMat2*refMat3); + VERIFY_IS_APPROX(dm4 =m2t.transpose()*m3, refMat4 =refMat2t.transpose()*refMat3); + VERIFY_IS_APPROX(dm4+=m2t.transpose()*m3, refMat4+=refMat2t.transpose()*refMat3); + VERIFY_IS_APPROX(dm4 =m2t.transpose()*m3t.transpose(), refMat4 =refMat2t.transpose()*refMat3t.transpose()); + VERIFY_IS_APPROX(dm4+=m2t.transpose()*m3t.transpose(), refMat4+=refMat2t.transpose()*refMat3t.transpose()); + VERIFY_IS_APPROX(dm4 =m2*m3t.transpose(), refMat4 =refMat2*refMat3t.transpose()); + VERIFY_IS_APPROX(dm4+=m2*m3t.transpose(), refMat4+=refMat2*refMat3t.transpose()); + VERIFY_IS_APPROX(dm4 = m2*m3*s1, refMat4 = refMat2*refMat3*s1); + // test aliasing m4 = m2; refMat4 = refMat2; VERIFY_IS_APPROX(m4=m4*m3, refMat4=refMat4*refMat3); |