This bugzilla service is closed. All entries have been migrated to https://gitlab.com/libeigen/eigen
Bug 1236 - [SparseSparseProductWithPruning] Integer overflow in ratioColRes estimation
Summary: [SparseSparseProductWithPruning] Integer overflow in ratioColRes estimation
Status: RESOLVED FIXED
Alias: None
Product: Eigen
Classification: Unclassified
Component: Sparse (show other bugs)
Version: 3.2
Hardware: x86 - 64-bit All
: Normal Unknown
Assignee: Nobody
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-05-26 10:14 UTC by Jérémie
Modified: 2019-12-04 15:52 UTC (History)
2 users (show)



Attachments

Description Jérémie 2016-05-26 10:14:24 UTC
Hi,


On Eigen's latest stable version (3.2.8), I am encountering a signed integer overflow when using Sparse / Sparse products with pruning, namely on the following line:

  double ratioColRes = double(estimated_nnz_prod)/double(lhs.rows()*rhs.cols());

And then the problem reported at the exectution:

  SparseSparseProductWithPruning.h:51:68: runtime error: signed integer overflow: 56224 * 56224 cannot be represented in type 'int [3]'

Now, I don't know what this 'int [3]' means, but this product would fit in a 'long long' or a double, so I guess the overflow could be avoided.
Comment 1 Gael Guennebaud 2016-05-26 15:52:38 UTC
Thanks for the report, I've simply moved the conversion to double before the product.
devel: https://bitbucket.org/eigen/eigen/commits/caa3c3993517/
3.2:   https://bitbucket.org/eigen/eigen/commits/282ed0ab80a9/
Comment 2 Nobody 2019-12-04 15:52:45 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/1236.

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