commons-dev mailing list archives

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

Looking forward to reading your thoughts on that topic,
S├ębastien


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message