Re: [math] RealVector.toArray() vs. RealVector.getData()

2011-09-07 Thread Arne Ploese
I would introduce getArrayRef(), which makes clear what exactly happen. It is after all the same like spares/dense discussion ... Arne Am Mittwoch, den 07.09.2011, 08:11 +0200 schrieb Sébastien Brisard: > In fact, getArrayRef does not belong to the RealVector class. It is > only defined in Array

Re: [math] RealVector.toArray() vs. RealVector.getData()

2011-09-07 Thread Luc Maisonobe
Le 07/09/2011 08:27, Sébastien Brisard a écrit : True enough. Maybe the use of one those two could be strongly discouraged. I personally was puzzled the first time I saw those two methods. I was even wondering wether one of them would not return a shallow copy (when possible), while the other wou

Re: [math] RealVector.toArray() vs. RealVector.getData()

2011-09-06 Thread Sébastien Brisard
True enough. Maybe the use of one those two could be strongly discouraged. I personally was puzzled the first time I saw those two methods. I was even wondering wether one of them would not return a shallow copy (when possible), while the other would return a deep copy. Had to look at the source to

Re: [math] RealVector.toArray() vs. RealVector.getData()

2011-09-06 Thread Jochen Wiedmann
2011/9/7 Sébastien Brisard : > Hi, > as noted in MATH-653, these two methods are redundant, and one should > go. Pros and cons are > * toArray() is fairly classical in the Java world > * but getData() is consistent with ArrayRealVector.getDataRef(). > Personnaly, my preference goes to keeping toArr

Re: [math] RealVector.toArray() vs. RealVector.getData()

2011-09-06 Thread Sébastien Brisard
In fact, getArrayRef does not belong to the RealVector class. It is only defined in ArrayRealVector (which is backed by a double[]). Sébastien 2011/9/7 Arne Ploese : > If toArray() returns always a copy and if getArrayRef() throws an > exception if there is no backing array, it would be much clear

Re: [math] RealVector.toArray() vs. RealVector.getData()

2011-09-06 Thread Arne Ploese
If toArray() returns always a copy and if getArrayRef() throws an exception if there is no backing array, it would be much clearer. A property isArray() is needed in this case. Arne Am Mittwoch, den 07.09.2011, 04:19 +0200 schrieb Sébastien Brisard: > Hi, > as noted in MATH-653, these two method