| 13 | |
| 14 | template<typename MatrixType,typename DenseMat> |
| 15 | int generate_sparse_rectangular_problem(MatrixType& A, DenseMat& dA, int maxRows = 300, int maxCols = 300) |
| 16 | { |
| 17 | eigen_assert(maxRows >= maxCols); |
| 18 | typedef typename MatrixType::Scalar Scalar; |
| 19 | int rows = internal::random<int>(1,maxRows); |
| 20 | int cols = internal::random<int>(1,rows); |
| 21 | double density = (std::max)(8./(rows*cols), 0.01); |
| 22 | |
| 23 | A.resize(rows,cols); |
| 24 | dA.resize(rows,cols); |
| 25 | initSparse<Scalar>(density, dA, A,ForceNonZeroDiag); |
| 26 | A.makeCompressed(); |
| 27 | return rows; |
| 28 | } |
| 29 | |
| 30 | template<typename Scalar> void test_spqr_scalar() |
| 31 | { |