New user self-registration is disabled due to spam. Please email eigen-core-team @ lists.tuxfamily.org if you need an account.
Bug 1111 - Calling nonZeros() on row(i) of a col-major sparse matrix segfaults
Summary: Calling nonZeros() on row(i) of a col-major sparse matrix segfaults
Status: RESOLVED FIXED
Alias: None
Product: Eigen
Classification: Unclassified
Component: Sparse (show other bugs)
Version: 3.2
Hardware: All All
: Normal Crash
Assignee: Nobody
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-11-12 10:14 UTC by simon.floery
Modified: 2015-11-12 16:11 UTC (History)
2 users (show)



Attachments
Code to reproduce (619 bytes, text/x-c++src)
2015-11-12 10:14 UTC, simon.floery
no flags Details

Description simon.floery 2015-11-12 10:14:57 UTC
Created attachment 625 [details]
Code to reproduce

Hi,

attached code calling nonZeros() on a col() of a row-major sparse matrix segfaults with eigen 3.2.7 (same for row() of a column-major). 

thanks, Simon
Comment 1 Gael Guennebaud 2015-11-12 16:11:12 UTC
Indeed, the pb is that such a function does not exist (counting the number of non zeros of a row of a column major matrix is a O(n*log(nnz_per_col)) pb, so you don't want to do that). What current happens is that it starts an infinite recursion loop... This is already fixed in the devel branch (as a compilation error), and here is the fix for the 3.2 branch:

https://bitbucket.org/eigen/eigen/commits/e5b78b42b6b3/
Summary:     Bug 1111: fix infinite recursion in sparse-column-major.row(i).nonZeros() (it now produces a compilation error)

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