mirror of
https://gitlab.com/libeigen/eigen.git
synced 2024-12-21 07:19:46 +08:00
SparseQR is really for rows>=columns, so let's only check such cases
This commit is contained in:
parent
735f1fda39
commit
f5328be65a
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user