Sounds right to me. I think the more generic this kind of code is, the better. I feel this even in the face of some (but not massive) performance loss. I don't see that there should be any performance loss here.
On Sun, Sep 4, 2011 at 5:00 AM, Luc Maisonobe <luc.maison...@free.fr> wrote: > Le 04/09/2011 11:14, Sébastien Brisard a écrit : > >> Hi, >> > > Hi Sébastien, > > > In JIRA MATH-653, Gilles initiated a simplification of the RealVector >> abstract class, by removing all methods which make use of double[] as >> RealVectors. >> The logical step is to simplify DecompositionSolver along these lines. >> While doing this for CholeskyDecompositionImpl, I initially intended >> to inline the code corresponding to solve(double[]) in >> solve(ArrayRealVector). >> However, looking more closely at the code, I'm not sure there is any >> gain in distinguishing general RealVectors, and ArrayRealVectors (and >> eventually double[]). Indeed, in the first case, there is a call to >> b.getData() (see line 240) >> and in the other case >> b.clone() (see line 205) >> So basically, in both cases, a new double[] is created, and data is >> copied from b to x, with the additional drawback of having duplicate >> code. So I suggest to remove solve(ArrayRealVector), and keep only >> solve(RealVector). This should come to no harm in terms of >> performances, I think. >> Do you agree with that? >> > > Yes, this seems fair. > > Luc > > > >> ------------------------------**------------------------------**--------- >> To unsubscribe, e-mail: >> dev-unsubscribe@commons.**apache.org<dev-unsubscr...@commons.apache.org> >> For additional commands, e-mail: dev-h...@commons.apache.org >> >> >> > > ------------------------------**------------------------------**--------- > To unsubscribe, e-mail: > dev-unsubscribe@commons.**apache.org<dev-unsubscr...@commons.apache.org> > For additional commands, e-mail: dev-h...@commons.apache.org > >