SparseQR is really for rows>=columns, so let's only check such cases

This commit is contained in:
Gael Guennebaud 2014-12-16 18:23:13 +01:00
parent 735f1fda39
commit f5328be65a

View File

@ -10,12 +10,11 @@
#include <Eigen/SparseQR> #include <Eigen/SparseQR>
template<typename MatrixType,typename DenseMat> template<typename MatrixType,typename DenseMat>
int generate_sparse_rectangular_problem(MatrixType& A, DenseMat& dA, int maxRows = 300, int maxCols = 150) int generate_sparse_rectangular_problem(MatrixType& A, DenseMat& dA, int maxRows = 300)
{ {
eigen_assert(maxRows >= maxCols);
typedef typename MatrixType::Scalar Scalar; typedef typename MatrixType::Scalar Scalar;
int rows = internal::random<int>(1,maxRows); int rows = internal::random<int>(1,maxRows);
int cols = internal::random<int>(1,maxCols); int cols = internal::random<int>(1,rows);
double density = (std::max)(8./(rows*cols), 0.01); double density = (std::max)(8./(rows*cols), 0.01);
A.resize(rows,cols); A.resize(rows,cols);