This bugzilla service is closed. All entries have been migrated to
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
Alias: None
Product: Eigen
Classification: Unclassified
Component: Sparse (show other bugs)
Version: 3.2
Hardware: All All
: Normal Crash
Assignee: Nobody
Depends on:
Reported: 2015-11-12 10:14 UTC by simon.floery
Modified: 2019-12-04 15:10 UTC (History)
2 users (show)

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


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:
Summary:     Bug 1111: fix infinite recursion in sparse-column-major.row(i).nonZeros() (it now produces a compilation error)
Comment 2 Nobody 2019-12-04 15:10:35 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to'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:

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