From c4c70669d165afefe0c68e7bb194ee81b9fba0b5 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Wed, 14 Jan 2009 14:24:10 +0000 Subject: Big rewrite in the Sparse module: SparseMatrixBase no longer inherits MatrixBase. That means a lot of features which were available for sparse matrices via the dense (and super slow) implemention are no longer available. All features which make sense for sparse matrices (aka can be implemented efficiently) will be implemented soon, but don't expect to see an API as rich as for the dense path. Other changes: * no block(), row(), col() anymore. * instead use .innerVector() to get a col or row vector of a matrix. * .segment(), start(), end() will be back soon, not sure for block() * faster cwise product --- test/sparse_vector.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'test/sparse_vector.cpp') diff --git a/test/sparse_vector.cpp b/test/sparse_vector.cpp index 0a25884ca..18ef74833 100644 --- a/test/sparse_vector.cpp +++ b/test/sparse_vector.cpp @@ -62,7 +62,8 @@ template void sparse_vector(int rows, int cols) for (typename SparseVectorType::InnerIterator it(v1); it; ++it,++j) { VERIFY(nonzerocoords[j]==it.index()); - VERIFY(it.value()==v1[it.index()]); + VERIFY(it.value()==v1.coeff(it.index())); + VERIFY(it.value()==refV1.coeff(it.index())); } } VERIFY_IS_APPROX(v1, refV1); @@ -76,7 +77,7 @@ template void sparse_vector(int rows, int cols) VERIFY_IS_APPROX(v1*s1-v2, refV1*s1-refV2); - std::cerr << v1.dot(v2) << " == " << refV1.dot(refV2) << "\n"; +// std::cerr << v1.dot(v2) << " == " << refV1.dot(refV2) << "\n"; VERIFY_IS_APPROX(v1.dot(v2), refV1.dot(refV2)); } @@ -85,7 +86,7 @@ void test_sparse_vector() { for(int i = 0; i < g_repeat; i++) { CALL_SUBTEST( sparse_vector(8, 8) ); -// CALL_SUBTEST( sparse_vector >(16, 16) ); + CALL_SUBTEST( sparse_vector >(16, 16) ); CALL_SUBTEST( sparse_vector(299, 535) ); } } -- cgit v1.2.3