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 Re: [math] RealVector.toArray() vs. RealVector.getData()
Date Wed, 07 Sep 2011 06:11:20 GMT
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 <aploese@gmx.de>:
> 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 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 toArray(). In order to
>> maintain consistency, should ArrayRealVector.getDataRef() be renamed
>> getArrayRef() ?
>>
>> Sébastien
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>> For additional commands, e-mail: dev-help@commons.apache.org
>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>

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


Mime
View raw message