From 8f3e33581ecd69eea782d4103985a808ed41dabd Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Wed, 7 Oct 2009 14:25:53 +0200 Subject: extend the sparse matrix assembly benchmark --- bench/BenchSparseUtil.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'bench/BenchSparseUtil.h') diff --git a/bench/BenchSparseUtil.h b/bench/BenchSparseUtil.h index f4b67cb8d..f8dc8bdf4 100644 --- a/bench/BenchSparseUtil.h +++ b/bench/BenchSparseUtil.h @@ -27,23 +27,23 @@ typedef SparseMatrix EigenSparseMatrix; void fillMatrix(float density, int rows, int cols, EigenSparseMatrix& dst) { - dst.startFill(rows*cols*density); + dst.reserve(rows*cols*density); for(int j = 0; j < cols; j++) { for(int i = 0; i < rows; i++) { Scalar v = (ei_random(0,1) < density) ? ei_random() : 0; if (v!=0) - dst.fillrand(i,j) = v; + dst.insert(i,j) = v; } } - dst.endFill(); + dst.finalize(); } void fillMatrix2(int nnzPerCol, int rows, int cols, EigenSparseMatrix& dst) { std::cout << "alloc " << nnzPerCol*cols << "\n"; - dst.startFill(nnzPerCol*cols); + dst.reserve(nnzPerCol*cols); for(int j = 0; j < cols; j++) { std::set aux; @@ -54,10 +54,10 @@ void fillMatrix2(int nnzPerCol, int rows, int cols, EigenSparseMatrix& dst) k = ei_random(0,rows-1); aux.insert(k); - dst.fillrand(k,j) = ei_random(); + dst.insert(k,j) = ei_random(); } } - dst.endFill(); + dst.finalize(); } void eiToDense(const EigenSparseMatrix& src, DenseMatrix& dst) -- cgit v1.2.3