diff options
author | 2012-03-29 14:29:55 +0200 | |
---|---|---|
committer | 2012-03-29 14:29:55 +0200 | |
commit | ada9e791450618d1d608db11fcdd97adde824cbe (patch) | |
tree | 949c616490f970bb814d90d2a9464708c4cb9769 /unsupported/Eigen/src/SparseExtra/MarketIO.h | |
parent | caecaf9c9e1745202420ceb3ef5c5b4b935d8995 (diff) |
add a benchmark routine for all sparse linear solvers in Eigen
Diffstat (limited to 'unsupported/Eigen/src/SparseExtra/MarketIO.h')
-rw-r--r-- | unsupported/Eigen/src/SparseExtra/MarketIO.h | 11 |
1 files changed, 7 insertions, 4 deletions
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 { |