commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gilles Sadowski <gil...@harfang.homelinux.org>
Subject Re: [math] Second thoughts on MATH-803 and "zip-visitor" for vectors.
Date Mon, 26 Nov 2012 23:37:58 GMT
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.

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;
}
-----

What do you think?

Gilles

> [...]

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


Mime
View raw message