On 12/26/2015 05:22 PM, Gilles wrote:
On Sat, 26 Dec 2015 16:21:04 -0600, Ole Ersoy wrote:
Hi,
What do you think of removing iterator(), Entry, and Iterator() from
RealVector? ArrayRealVector can replace these with Vector...I
think...Still need to attempt it. Vector is synchronized so it makes
it easier to make ArrayRealVector thread safe.
I don't follow at all.
We're in the same boat :). I've only half baked my thinking at this point, but
java.util.Vector is synchronized, uses a 0 based index, and throws
ConcurrentModificationException if it is modified while it is being iterated
over, so it would provide thread safety for operations like add(RealVector v).
It also provides a lot of the modification methods provided by RealVector like
append, getSubVector, etc....Although they are named differently. But I think
utilities that performs Matrix / Vector operations might be better(Thinking out
loud). For example:
Vector.add(final double[] v1 , final double[] v2) {
//validate
//operate
//return brand new array.
}
That's thread safe without even trying :).
But anyways, please have a look at the long-standing issue on JIRA concerning
the refactoring of RealVector/RealMatrix.
Will do.
https://issues.apache.org/jira/browse/MATH-765
Just did. I think it's better to just skip the whole thing and separate the
pieces into:
1) Structure:
One dimensional or two dimensional arrays
2) Structure Manipulation:
Manipulate one dimensional or two dimensional arrays
3) Operations (Like above Vector.add(), Matrix.add())
Cheers,
Ole
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org