How to understand the error from Eigen

3.8k views Asked by At

I have a problem with Eigen as below:

LKSSP0.5psk: /usr/include/eigen3/Eigen/src/Core/Block.h:134: Eigen::Block::Block(XprType&, Eigen::Index, Eigen::Index) [with XprType = Eigen::Matrix; int BlockRows = 2; int BlockCols = 2; bool InnerPanel = false; Eigen::Index = long int]: Assertion `startRow >= 0 && BlockRows >= 1 && startRow + BlockRows <= xpr.rows() && startCol >= 0 && BlockCols >= 1 && startCol + BlockCols <= xpr.cols()' failed. Command terminated by signal 6 27650.16user 5.67system 1:17:34elapsed 594%CPU (0avgtext+0avgdata 525396maxresident)k 328inputs+77192outputs (1major+17571minor)pagefaults 0swaps

Can anyone help understanding what it means so I can solve the problem? Thanks.

1

There are 1 answers

2
KjMag On

The key word in this message is "assertion". The assertion has failed because basic matrix conditions are not met. Debug the code, find the line containing the assert and check the conditions.

This part:

Assertion `startRow >= 0 && BlockRows >= 1 && startRow + BlockRows <= xpr.rows() && startCol >= 0 && BlockCols >= 1 && startCol + BlockCols <= xpr.cols()' failed.

lists the conditions that have to be met in order for the program to go on (e.g. startRow >= 0), but you don't know which are actually not met unless you debug the code and check. In this case, you have specified a negative number of columns/rows, referred to the element outside the matrix boundaries or the value of the BlockRows variable is less than 1.