commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From S├ębastien Brisard <>
Subject [math] In class RealVector, sparseIterator() is confusing
Date Sat, 07 Jul 2012 12:31:54 GMT
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

Looking forward to reading your thoughts on that topic,

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

View raw message