[eigen] again a unit test precision question

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


Ok, we all know that this is slightly difficult - or maybe it is just
me. But probably not because sometimes it feels as if we are fixing
more unit tests than actual Eigen code. ;)

Anyways, the redux_8 test is failing every now and then in redux.cpp
line 105 (e.g. seed 1278148098).

The test is

test_ei_isApprox(s, v.tail(size-i).sum())

and it is failing with values

6.1214e-005 and 6.10948e-005

and those values are probably occurring because v's values are uniform
random values from [-1,1]. I am quite bad in numerics but I assume we
are seeing such differences because of cancellation errors? Or is it
simply addition arithmetic?

Whatever it is, I think a trivial fix would be to compute the absolute
sum. It is not the same test but in order to succeed it requires both,
the sum and the absolute value to be working.

Do you consider this a good fix? Then I will apply it.

- Hauke

Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/