Re: [eigen] Overflow in sum()

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


About your patch: we don't do asserts for overflows, innacuracies,
etc. Asserts crash programs, so they should only guard against plain
coding errors that can cause dangerous problems (typically: bad memory
accesses). Asserts are also costly (runtime check) and often are left
enabled in linux distro packages, so here it's not optimal to have an
assert in an inner loop.

Cheers,
Benoit

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+ http://listengine.tuxfamily.org/