New user self-registration is currently disabled. Please email eigen-core-team @ if you need an account.
Bug 1111 - Calling nonZeros() on row(i) of a col-major sparse matrix segfaults
Calling nonZeros() on row(i) of a col-major sparse matrix segfaults
Product: Eigen
Classification: Unclassified
Component: Sparse
All All
: Normal Crash
Assigned To: Nobody
Depends on:
  Show dependency treegraph
Reported: 2015-11-12 10:14 UTC by simon.floery
Modified: 2015-11-12 16:11 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)

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