commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Arne Plöse (JIRA) <>
Subject [jira] [Commented] (MATH-573) in ArrayFielVector i.e. subtract calls wrong constructor
Date Sun, 15 May 2011 17:47:47 GMT


Arne Plöse commented on MATH-573:

In AbstractRealvector

public RealVector add(double[] v) {
there is no check of any dimension (goes for (at least some) other operators as well.

What kind of benchmark do you want (RealVector current implementations v.s. true array|sparse
?) or the operators in map*?

Maybe I could think of an implementations where there is a private interface Storage {
 T getEntrx(int i);
 void setEntry(int i; T e);
 int getDimension();
 int setDimension(Field f, int size);
 int setDimension(T[] v, boolean makeCopy); << I dont like the name copyArray its implemetation
specifict but dataIsInmutabe sounds also bad ....

this is instatiated with ether An array implentation or a sparse list one could define if
the fillstate is more than 50 % switch to array ore something else ... just an idea ....

> in ArrayFielVector i.e. subtract calls wrong constructor
> --------------------------------------------------------
>                 Key: MATH-573
>                 URL:
>             Project: Commons Math
>          Issue Type: Bug
>    Affects Versions: 3.0
>            Reporter: Arne Plöse
>            Priority: Minor
>             Fix For: 3.0
> I.E. subtract calls
> "return new ArrayFieldVector<T>(out)" this constructor clones the array...
> "return new ArrayFieldVector<T>(field, out, false)" would be better (preserving
field as well)

This message is automatically generated by JIRA.
For more information on JIRA, see:

View raw message