From 7e029d1d6ec0eba495a31c72a328ee8160338e44 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Mon, 29 Aug 2016 12:06:37 +0200 Subject: bug #1271: add SparseMatrix::coeffs() methods returning a 1D view of the non zero coefficients. --- test/sparse_basic.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'test/sparse_basic.cpp') diff --git a/test/sparse_basic.cpp b/test/sparse_basic.cpp index 10309b3a9..7b5f3eb38 100644 --- a/test/sparse_basic.cpp +++ b/test/sparse_basic.cpp @@ -207,6 +207,16 @@ template void sparse_basic(const SparseMatrixType& re VERIFY_IS_APPROX((m1 = m1.transpose()), (refM1 = refM1.transpose().eval())); VERIFY_IS_APPROX((m1 = -m1.transpose()), (refM1 = -refM1.transpose().eval())); VERIFY_IS_APPROX((m1 += -m1), (refM1 += -refM1)); + + if(m1.isCompressed()) + { + VERIFY_IS_APPROX(m1.coeffs().sum(), m1.sum()); + m1.coeffs() += s1; + for(Index j = 0; j