Re: [eigen] Overflow in sum()

[ Thread Index | Date Index | More Archives ]

It depends how common your use case is: if many people are going to do
the same, we could have another template parameter for sparse
matrices, the "accumulated scalar type", decoupled from the "scalar

Otherwise, you might just have your own safe_sum() method (we can add
if you need, so you can add methods also to sparse classes).


2009/4/1 Jens Mueller <jens.k.mueller@xxxxxx>:
> Hi,
> I added a custom Scalar type to Eigen, because my sparse matrices have
> many coefficients but these are rather small integers. When using the
> sum() method, I get wrong results, because the function returns a
> Scalar. I added an assertion (see attached diff against current trunk)
> to check for possible overflows.
> I'm willing to fix this problem but I'm not sure how. Any
> recommendations how to proceed?
> Regards,
> Jens

Mail converted by MHonArc 2.6.19+