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] Second thoughts on MATH-803 and "zip-visitor" for vectors.
Date Tue, 27 Nov 2012 03:44:27 GMT
Hi,


2012/11/27 Gilles Sadowski <gilles@harfang.homelinux.org>

> Hello.
>
> > > > in MATH-803 [1] it was decided to deprecate
> > > RealVector.ebeMultiply/Divide,
> > > > because these methods were difficult to support with sparse vectors.
> > > > However, in MATH-870, we decided to deprecate sparse vectors
> altogether.
> > > >
> > > > I'm therefore having second thoughts on MATH-803. Since the
> problematic
> > > > implementations of RealVector are removed, why not keep these quite
> handy
> > > > methods?
>
> The goal was also to "clean up" the matrix and vector implementations.
>
> True, but all good scientific packages (matlab, scilab, numpy) have these
operations. If we do not keep them in the interface of RealVector (which
I'm OK about), we need to provide a clean alternative. At the moment,
visitors are not clean.


> I'd rather suggest to add such features in the "MathArrays" class:
> -----
> public static double[] ebeDivide(double[] numer,
>                                  double[] denom) {
>   if (numer.length != denom.length) {
>     throw new DimensionMismatchException(numer.length, denom.length);
>   }
>
>   final double[] result = numer.clone();
>   for (int i = 0; i < numer.length; i++) {
>     result[i] /= denom[i];
>   }
>
>   return result;
> }
> -----
>

I'm not adverse to the idea, but actually, cleaning recently took place the
other way round. In RealVector, we removed all methods which took an array
in place of a vector, since constructing an ArrayRealVector from an array
is almost costless (using the right constructor).


>
> What do you think?
>
> Gilles
>
> > [...]
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
> Best regards,
S├ębastien

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message