106 for (
int nnzPerCol =
NNZPERCOL; nnzPerCol > 1; nnzPerCol /= 1.1) {
116 std::cout <<
"Eigen Dense\t" << nnzPerCol <<
"%\n";
125 std::cout <<
" a * b:\t" <<
timer.value() << endl;
131 std::cout <<
" a' * b:\t" <<
timer.value() << endl;
135 for (
int k = 0;
k <
REPEAT; ++
k) m3 =
m1.transpose() *
m2.transpose();
137 std::cout <<
" a' * b':\t" <<
timer.value() << endl;
143 std::cout <<
" a * b':\t" <<
timer.value() << endl;
149 std::cout <<
"Eigen sparse\t" << sm1.nonZeros() / (float(sm1.rows()) * float(sm1.cols())) * 100 <<
"% * "
150 << sm2.nonZeros() / (float(sm2.rows()) * float(sm2.cols())) * 100 <<
"%\n";
152 BENCH(sm3 = sm1 * sm2;)
153 std::cout <<
" a * b:\t" <<
timer.value() << endl;
220 std::cout <<
"CSparse \t" << nnzPerCol <<
"%\n";
222 eiToCSparse(sm1,
m1);
223 eiToCSparse(sm2,
m2);
226 m3 = cs_sorted_multiply(
m1,
m2);
228 std::cerr <<
"cs_multiply failed\n";
234 std::cout <<
" a * b:\t" <<
timer.value() << endl;
243 std::cout <<
"ublas\t" << nnzPerCol <<
"%\n";
249 std::cout <<
" a * b:\t" <<
timer.value() << endl;
256 std::cout <<
"GMM++ sparse\t" << nnzPerCol <<
"%\n";
263 std::cout <<
" a * b:\t" <<
timer.value() << endl;
287 std::cout <<
"MTL4\t" << nnzPerCol <<
"%\n";
293 std::cout <<
" a * b:\t" <<
timer.value() << endl;
void eiToGmm(const EigenSparseMatrix &src, GmmSparse &dst)
Definition: BenchSparseUtil.h:64
void eiToDense(const EigenSparseMatrix &src, DenseMatrix &dst)
Definition: BenchSparseUtil.h:54
gmm::col_matrix< gmm::wsvector< Scalar > > GmmDynSparse
Definition: BenchSparseUtil.h:63
mtl::compressed2D< Scalar, mtl::matrix::parameters< mtl::tag::col_major > > MtlSparse
Definition: BenchSparseUtil.h:74
#define DENSITY
Definition: BenchSparseUtil.h:15
void fillMatrix2(int nnzPerCol, int rows, int cols, EigenSparseMatrix &dst)
Definition: BenchSparseUtil.h:38
gmm::csc_matrix< Scalar > GmmSparse
Definition: BenchSparseUtil.h:62
boost::numeric::ublas::compressed_matrix< Scalar, boost::numeric::ublas::column_major > UBlasSparse
Definition: BenchSparseUtil.h:110
void eiToMtl(const EigenSparseMatrix &src, MtlSparse &dst)
Definition: BenchSparseUtil.h:76
void eiToUblas(const EigenSparseMatrix &src, UBlasSparse &dst)
Definition: BenchSparseUtil.h:112
int rows
Definition: Tutorial_commainit_02.cpp:1
int cols
Definition: Tutorial_commainit_02.cpp:1
#define NNZPERCOL
Definition: bench/sparse_product.cpp:15
#define BENCH(X)
Definition: bench/sparse_product.cpp:31
#define SIZE
Definition: bench/sparse_product.cpp:11
Definition: BenchTimer.h:55
char char char int int * k
Definition: level2_impl.h:374
double timer
Definition: oomph_metis_from_parmetis_3.1.1/struct.h:210
EIGEN_DONT_INLINE void prod(const Lhs &a, const Rhs &b, Res &c)
Definition: product_threshold.cpp:53