This bugzilla service is closed. All entries have been migrated to https://gitlab.com/libeigen/eigen

Bug 980

Summary: Crash when accessing sparse matrix row
Product: Eigen Reporter: jazkkk
Component: SparseAssignee: Nobody <eigen.nobody>
Status: RESOLVED FIXED    
Severity: Crash CC: chtz, gael.guennebaud
Priority: Normal    
Version: 3.2   
Hardware: All   
OS: All   
Whiteboard:

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.
Comment 4 Nobody 2019-12-04 14:23:36 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to gitlab.com's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.com/libeigen/eigen/issues/980.