diff options
author | Gael Guennebaud <g.gael@free.fr> | 2015-02-09 11:14:36 +0100 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2015-02-09 11:14:36 +0100 |
commit | d4ec48575e94ec469ef9fbf005a0a6e67571f528 (patch) | |
tree | 38bb3fb2566cd1ff16dce32e0235d0d08a8bd9a7 /test/sparse_ref.cpp | |
parent | 554aa9b31de06cf1d4464b1fe8e5a956091641ba (diff) |
Make Block<SparseMatrix> inherit SparseCompressedBase in the case of an inner-panels and fix valuePtr() innerIndexPtr()
Diffstat (limited to 'test/sparse_ref.cpp')
-rw-r--r-- | test/sparse_ref.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
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<std::complex<float> > ca = VectorXcf::Random(10).sparseView(); // SparseVector<float> a = VectorXf::Random(10).sparseView(); - SparseMatrix<float> A = MatrixXf::Random(10,10).sparseView(); - SparseMatrix<float,RowMajor> B = MatrixXf::Random(10,10).sparseView(); + SparseMatrix<float> A = MatrixXf::Random(10,10).sparseView(0.5,1); + SparseMatrix<float,RowMajor> B = MatrixXf::Random(10,10).sparseView(0.5,1); const SparseMatrix<float>& Ac(A); Block<SparseMatrix<float> > Ab(A,0,1, 3,3); const Block<SparseMatrix<float> > 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) } |