Re: [eigen] stable norm

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




On Wed, Jun 9, 2010 at 9:42 AM, Hauke Heibel <hauke.heibel@xxxxxxxxxxxxxx> wrote:
On Wed, Jun 9, 2010 at 9:20 AM, Gael Guennebaud
<gael.guennebaud@xxxxxxxxx> wrote:
>
>
> On Wed, Jun 9, 2010 at 9:13 AM, Hauke Heibel <hauke.heibel@xxxxxxxxxxxxxx>
> wrote:
>>
>> Hi,
>>
>> There is a glitch in stable norm. I think these two lines should be
>> removed
>>
>>  VERIFY(!isFinite( ei_abs(big)/RealScalar(0)));
>>  VERIFY(!isFinite(-ei_abs(big)/RealScalar(0)));
>>
>> The test seems useless since any number divided by zero will yield Inf
>> and thus the test is always true.
>>
>> Is that right, or am I overseeing someting?
>
> yes, the goal of these lines was simply to test the function isFinite
> itself, not the fact that x/0 returns Inf.
>
> So I still think it is nice to keep them.
>
> gael
>
>
>>
>> - Hauke
>>
>>
>
>

Then, I could as well replace the code by:

VERIFY(!isFinite( std::numeric_limits<RealScalar>::infinity() ) );

I am nit-picking, since we are receiving a warning on the division by
zero on MSVC.

sure, go ahead!

gael
 

- Hauke





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