commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gilles Sadowski <>
Subject Re: [math] In class RealVector, sparseIterator() is confusing
Date Mon, 09 Jul 2012 00:39:20 GMT
On Sat, Jul 07, 2012 at 02:31:54PM +0200, S├ębastien Brisard wrote:
> Hi,
> recent bugs have revealed that the use of sparseIterator() is quite
> delicate. Also, the current Javadoc is confusing, since it says
> "Specialized implementations may choose to not iterate over all
> dimensions, either because those values are unset, or are equal to
> defaultValue(), or are small enough to be ignored for the purposes of
> iteration". This suggests that an unstored value different from zero
> could be used (in fact, I have implemented RealVectorAbstractTest with
> this goal in mind). However, method "defaultValue()" (mentioned in the
> javadoc) does not exist, and when sparseIterators are invoked in the
> current implementation of CM3, it is *always* assumed that this
> default value is indeed zero.
> At the very least, we need to alter the Javadoc.
> I would personally be in favor of deprecating this method, at least in
> the {{RealVector}} base class. I think it would make more sense to
> move it to the {{SparseRealVector}} class. Also, I think that at some
> point, we should have a discussion on the current implementation of
> sparse vectors/matrices, since recent tests have shown flaws in the
> implementation.

I agree...


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

View raw message