New user self-registration is currently disabled. Please email eigen-core-team @ lists.tuxfamily.org if you need an account.
Bug 980 - Crash when accessing sparse matrix row
Crash when accessing sparse matrix row
Status: RESOLVED FIXED
Product: Eigen
Classification: Unclassified
Component: Sparse
3.2
All All
: Normal Crash
Assigned To: Nobody
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2015-03-13 01:36 UTC by jazkkk
Modified: 2015-03-13 15:14 UTC (History)
2 users (show)



Attachments

Description jazkkk 2015-03-13 01:36:31 UTC
This simple code crashes (on Xcode/MacOSX):

Eigen::SparseMatrix<float> sm(10, 10);
sm.row(0);

it crashes in XprHelper.h, line 53:
explicit variable_if_dynamic(T v) { EIGEN_ONLY_USED_FOR_DEBUG(v); assert(v == T(Value)); }

note that sm.col(0) works fine.
Comment 1 Gael Guennebaud 2015-03-13 11:30:38 UTC
Indeed, patch coming soon. Meanwhile you can use sm.block(i,0,1,cols)
Comment 2 Christoph Hertzberg 2015-03-13 14:38:41 UTC
There appears to be a problem (only in 3.2) that SparseMatrix::row() will always be RowMajor, even if the original matrix is not. I guess Gael is quicker in resolving that.
If you do, could you please re-activate the out-commented unit-tests in sparse_basic?
Comment 3 Gael Guennebaud 2015-03-13 15:14:46 UTC
Fixed:

https://bitbucket.org/eigen/eigen/commits/3fcd51f0b38a/
Changeset:   3fcd51f0b38a
Branch:      3.2
User:        ggael
Date:        2015-03-13 14:13:58+00:00
Summary:     Bug 980: fix taking a row (resp. column) of a column-major (resp. row-major) sparse matrix and add missing coeff/coeffRef members.

Note You need to log in before you can comment on or make changes to this bug.