Registered Member
|
Hi there, I was badly bitten (and it took LOOONG before I got the idea to check it) by this code -- it creates elastic stiffness matrix, which is 6x6 with zeros everywhere except for the 3rd rank major submatrix (upper left corner) and the main diagonal.
I initialized with comma initializer, giving 4 3x3 blocks:
with this result:
hinting at wrong interpretation of the .asDiagonal() expression; I changed the last block initializer to
getting then the correct result
I would think it is a bug, but having been badly hurt, I think I would not be impartial now. Using Eigen 3.0.1. |
Moderator
|
well, the bug is that the bad version should not compile. Nevertheless, here it does fail at runtime with the following assertion:
Eigen/src/Core/CommaInitializer.h:106: Eigen::CommaInitializer<MatrixType>::~CommaInitializer() [with XprType = Eigen::Matrix<double, 6, 6>]: Assertion `(m_row+m_currentBlockRows) == m_xpr.rows() && m_col == m_xpr.cols() && "Too few coefficients passed to comma initializer (operator<<)"' failed. assuming you don't define NDEBUG |
Registered users: Bing [Bot], Google [Bot], q.ignora, watchstar