diff options
author | Gael Guennebaud <g.gael@free.fr> | 2013-06-14 10:52:19 +0200 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2013-06-14 10:52:19 +0200 |
commit | 5f178e54e9341c2c1d558b7755c71d59277c02a4 (patch) | |
tree | ea0d30001e153f8610cb7c56f9b4fe8696188213 /test/sparse_basic.cpp | |
parent | d5fa5001a7c6ba3ea29c5a4f18aebb8c1ec71dd6 (diff) |
Extend sparse-block unit test to explicitly cover bug #584
Diffstat (limited to 'test/sparse_basic.cpp')
-rw-r--r-- | test/sparse_basic.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/sparse_basic.cpp b/test/sparse_basic.cpp index f2f14b2c7..e300f2537 100644 --- a/test/sparse_basic.cpp +++ b/test/sparse_basic.cpp @@ -308,6 +308,17 @@ template<typename SparseMatrixType> void sparse_basic(const SparseMatrixType& re else VERIFY_IS_APPROX(m2.block(0,j0,rows,n0)+m2.block(0,j1,rows,n0), refMat2.block(0,j0,rows,n0)+refMat2.block(0,j1,rows,n0)); + + int i = internal::random<int>(0,m2.outerSize()-1); + if(SparseMatrixType::IsRowMajor) { + m2.innerVector(i) = m2.innerVector(i) * s1; + refMat2.row(i) = refMat2.row(i) * s1; + VERIFY_IS_APPROX(m2,refMat2); + } else { + m2.innerVector(i) = m2.innerVector(i) * s1; + refMat2.col(i) = refMat2.col(i) * s1; + VERIFY_IS_APPROX(m2,refMat2); + } } // test prune |