This forum has been archived. All content is frozen. Please use KDE Discuss instead.

SparseQR crashes for matrix with rows>cols

Tags: None
(comma "," separated)
ickby
Registered Member
Posts
1
Karma
0
Hello,

I'm trying to use SparseQR solver to get the rank of the matrix in question. However, it always crashes for my case with more rows than colums. Here a little test that crashes for rows>cols but works for cols>rows and square case:

Code: Select all
Eigen::SparseMatrix<double> A(4,5);
A.reserve(2);
typedef Eigen::Triplet<double> T;
std::vector<T> tripletList;
tripletList.push_back(T(1,2,1));
tripletList.push_back(T(3,4,2));

A.setFromTriplets(tripletList.begin(), tripletList.end());
std::cout<<A<<std::endl;
Eigen::SparseQR<Eigen::SparseMatrix<double>, Eigen::COLAMDOrdering<int> > solver;
solver.compute(A);


crash report:
Code: Select all
test: /usr/include/eigen3/Eigen/src/Core/Block.h:141: Eigen::Block<XprType, BlockRows, BlockCols, InnerPanel>::Block(XprType&, Eigen::Block<XprType, BlockRows, BlockCols, InnerPanel>::Index, Eigen::Block<XprType, BlockRows, BlockCols, InnerPanel>::Index, Eigen::Block<XprType, BlockRows, BlockCols, InnerPanel>::Index, Eigen::Block<XprType, BlockRows, BlockCols, InnerPanel>::Index) [with XprType = Eigen::Matrix<int, -1, 1>; int BlockRows = -1; int BlockCols = 1; bool InnerPanel = false; Eigen::Block<XprType, BlockRows, BlockCols, InnerPanel>::Index = long int]: Assertion `a_startRow >= 0 && blockRows >= 0 && a_startRow <= xpr.rows() - blockRows && a_startCol >= 0 && blockCols >= 0 && a_startCol <= xpr.cols() - blockCols' failed.


Is this a error on my side, a limitation or a bug? I'm using latest stable Eigen3.2.

EDIT: I just dedected that it works flawless in release compilation, the crash is only triggerd in debug (of course, it's a assertion). The rank gets computed correctly. Maybe an unnecessary test?

Regards,
Stefan
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
this should be fixed in the devel and 3.2 branch


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]