From d52d8e4a5336636567dd80a6da08c032c229c186 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Thu, 8 Sep 2011 13:43:32 +0200 Subject: [PATCH] reactivate the sorting in the experimental sparse-sparse product --- Eigen/src/Sparse/SparseSparseProduct.h | 50 +++++++++++++------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/Eigen/src/Sparse/SparseSparseProduct.h b/Eigen/src/Sparse/SparseSparseProduct.h index 19abcd1f8..b58c89561 100644 --- a/Eigen/src/Sparse/SparseSparseProduct.h +++ b/Eigen/src/Sparse/SparseSparseProduct.h @@ -47,8 +47,8 @@ static void sparse_product_impl2(const Lhs& lhs, const Rhs& rhs, ResultType& res float avgNnzPerRhsColumn = float(rhs.nonZeros())/float(cols); float ratioRes = (std::min)(ratioLhs * avgNnzPerRhsColumn, 1.f); -// int t200 = rows/(log2(200)*1.39); -// int t = (rows*100)/139; + int t200 = rows/(log2(200)*1.39); + int t = (rows*100)/139; res.resize(rows, cols); res.reserve(Index(ratioRes*rows*cols)); @@ -83,28 +83,28 @@ static void sparse_product_impl2(const Lhs& lhs, const Rhs& rhs, ResultType& res // otherwise => loop through the entire vector // In order to avoid to perform an expensive log2 when the // result is clearly very sparse we use a linear bound up to 200. -// if((nnz<200 && nnz1) std::sort(indices.data(),indices.data()+nnz); -// for(int k=0; k1) std::sort(indices.data(),indices.data()+nnz); + for(int k=0; k static void sparse_product_impl(const Lhs& lhs, const Rhs& rhs, ResultType& res) { -// return sparse_product_impl2(lhs,rhs,res); + // return sparse_product_impl2(lhs,rhs,res); typedef typename remove_all::type::Scalar Scalar; typedef typename remove_all::type::Index Index;