From d4ec48575e94ec469ef9fbf005a0a6e67571f528 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Mon, 9 Feb 2015 11:14:36 +0100 Subject: Make Block inherit SparseCompressedBase in the case of an inner-panels and fix valuePtr() innerIndexPtr() --- test/sparse_ref.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'test/sparse_ref.cpp') diff --git a/test/sparse_ref.cpp b/test/sparse_ref.cpp index 27700f827..e7380ba21 100644 --- a/test/sparse_ref.cpp +++ b/test/sparse_ref.cpp @@ -51,8 +51,8 @@ void call_ref() { // SparseVector > ca = VectorXcf::Random(10).sparseView(); // SparseVector a = VectorXf::Random(10).sparseView(); - SparseMatrix A = MatrixXf::Random(10,10).sparseView(); - SparseMatrix B = MatrixXf::Random(10,10).sparseView(); + SparseMatrix A = MatrixXf::Random(10,10).sparseView(0.5,1); + SparseMatrix B = MatrixXf::Random(10,10).sparseView(0.5,1); const SparseMatrix& Ac(A); Block > Ab(A,0,1, 3,3); const Block > Abc(A,0,1,3,3); @@ -82,7 +82,9 @@ void call_ref() // VERIFY_EVALUATION_COUNT( call_ref_1(Arc, Arc), 0); // does not compile on purpose VERIFY_EVALUATION_COUNT( call_ref_2(Arc, Arc), 0); - VERIFY_EVALUATION_COUNT( call_ref_2(A.middleCols(1,3), A.middleCols(1,3)), 1); // should be 0 + VERIFY_EVALUATION_COUNT( call_ref_2(A.middleCols(1,3), A.middleCols(1,3)), 0); + + VERIFY_EVALUATION_COUNT( call_ref_2(A.col(2), A.col(2)), 0); VERIFY_EVALUATION_COUNT( call_ref_2(A.block(1,1,3,3), A.block(1,1,3,3)), 1); // should be 0 (allocate starts/nnz only) } -- cgit v1.2.3