From ada9e791450618d1d608db11fcdd97adde824cbe Mon Sep 17 00:00:00 2001 From: Desire NUENTSA Date: Thu, 29 Mar 2012 14:29:55 +0200 Subject: add a benchmark routine for all sparse linear solvers in Eigen --- unsupported/Eigen/src/SparseExtra/MarketIO.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'unsupported/Eigen/src/SparseExtra/MarketIO.h') diff --git a/unsupported/Eigen/src/SparseExtra/MarketIO.h b/unsupported/Eigen/src/SparseExtra/MarketIO.h index 4e2d5dc4e..3b103914a 100644 --- a/unsupported/Eigen/src/SparseExtra/MarketIO.h +++ b/unsupported/Eigen/src/SparseExtra/MarketIO.h @@ -166,10 +166,13 @@ bool loadMarket(SparseMatrixType& mat, const std::string& filename) if(!readsizes) { line >> M >> N >> NNZ; - readsizes = true; - std::cout << "sizes: " << M << "," << N << "," << NNZ << "\n"; - mat.resize(M,N); - mat.reserve(NNZ); + if(M > 0 && N > 0 && NNZ > 0) + { + readsizes = true; + std::cout << "sizes: " << M << "," << N << "," << NNZ << "\n"; + mat.resize(M,N); + mat.reserve(NNZ); + } } else { -- cgit v1.2.3