From 22792c696f71af7c38c7ba064f4ed87e1ac8a409 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Sat, 17 Jan 2009 16:24:49 +0000 Subject: add ublas vector of vector in sparse setter bench --- bench/sparse_setter.cpp | 42 +++++++++++++++++++++++++++++++++++++----- 1 file changed, 37 insertions(+), 5 deletions(-) (limited to 'bench/sparse_setter.cpp') diff --git a/bench/sparse_setter.cpp b/bench/sparse_setter.cpp index 90112954f..3781bb8fc 100644 --- a/bench/sparse_setter.cpp +++ b/bench/sparse_setter.cpp @@ -4,19 +4,22 @@ // -DNOGMM -DNOMTL -DCSPARSE // -I /home/gael/Coding/LinearAlgebra/CSparse/Include/ /home/gael/Coding/LinearAlgebra/CSparse/Lib/libcsparse.a #ifndef SIZE -#define SIZE 300000 +#define SIZE 1000000 #endif #ifndef NBPERROW -#define NBPERROW 12 +#define NBPERROW 24 #endif #ifndef REPEAT #define REPEAT 1 #endif +#ifndef NOGOOGLE #define EIGEN_GOOGLEHASH_SUPPORT #include +#endif + #include "BenchSparseUtil.h" @@ -37,6 +40,7 @@ EIGEN_DONT_INLINE Scalar* setrand_eigen_google_sparse(const Coordinates& coords, EIGEN_DONT_INLINE Scalar* setrand_ublas_mapped(const Coordinates& coords, const Values& vals); EIGEN_DONT_INLINE Scalar* setrand_ublas_coord(const Coordinates& coords, const Values& vals); EIGEN_DONT_INLINE Scalar* setrand_ublas_compressed(const Coordinates& coords, const Values& vals); +EIGEN_DONT_INLINE Scalar* setrand_ublas_genvec(const Coordinates& coords, const Values& vals); EIGEN_DONT_INLINE Scalar* setrand_mtl(const Coordinates& coords, const Values& vals); int main(int argc, char *argv[]) @@ -74,8 +78,9 @@ int main(int argc, char *argv[]) for (int k=0; k mat(aux); return 0;// &mat(coords[0].x(), coords[0].y()); } -EIGEN_DONT_INLINE Scalar* setrand_ublas_coord(const Coordinates& coords, const Values& vals) +/*EIGEN_DONT_INLINE Scalar* setrand_ublas_coord(const Coordinates& coords, const Values& vals) { using namespace boost; using namespace boost::numeric; @@ -215,6 +232,21 @@ EIGEN_DONT_INLINE Scalar* setrand_ublas_compressed(const Coordinates& coords, co mat(coords[i].x(), coords[i].y()) = vals[i]; } return 0;//&mat(coords[0].x(), coords[0].y()); +}*/ +EIGEN_DONT_INLINE Scalar* setrand_ublas_genvec(const Coordinates& coords, const Values& vals) +{ + using namespace boost; + using namespace boost::numeric; + using namespace boost::numeric::ublas; + +// ublas::vector > foo; + generalized_vector_of_vector > > aux(SIZE,SIZE); + for (int i=0; i mat(aux); + return 0;//&mat(coords[0].x(), coords[0].y()); } #endif -- cgit v1.2.3