commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sébastien Brisard <>
Subject Re: [math] Problems with sparse implementations of RealVector
Date Tue, 19 Jun 2012 08:36:45 GMT
Hi Bill,

> And, it is much worse than that.  Pretty much nobody cares about ebe, but
> dotProduct and outerProduct also assume that 0*NaN = 0 and 0*+-Infinity = 0.
> e.g.:
>  RealVector a = new OpenMapRealVector(100000);
>  RealVector b = new OpenMapRealVector(100000);
>  a.setEntry(1, 1.0);
>  b.setEntry(2, Double.NaN);
>  double prod = a.dotProduct(b);
>  assert(prod == 0.0);
> The OpenMapRealVector class is already so incredibly slow.  I really can't
> see maintaining support for it if it has to handle these edge cases as well.

Thanks for spotting this. I am in the middle of refactoring all unit
tests for RealVector, and haven't reached dotProduct() yet, so haven't
had the opportunity to reveal this bug.
I think the question you raise is legitimate. Gilles already
questioned in a recent post the support for this class.

What do the others think?


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message