Le 11/08/2010 16:49, Gilles Sadowski a écrit :
>> [...]
>>
>> It also appears that the Cartesian norm of a vector (in AbstractRealVector,
>> in AbstractLeastSquares, ...) does not care at all about overflow or
>> underflow.  I thus translated enorm.f (minpack) into Java.  My initial
>> intend was to put in AbstractLeastSquares but it might be more useful in
>> a more general location (MathUitls).  What do you think?
> 
> "MathUtils" contains various "distance" functions, so it would be logical to
> have the "norm" functions there too.  But...
> ... I noticed that there is duplicated code: e.g. the same "distance"
> computations are performed in "ArrayRealVector" and in "MathUtils". Since
> some computations cannot directly access the internal ("private") data, then
> maybe it would be more consistent (?) to have all distance computations
> that involve "double[]" arguments (i.e. also those in currently in
> "MathUtils") into "ArrayRealVector".

You are right: the duplication should be removed.

I would rather have them in a utility class (either MathUtils as
suggested or in MatrixUtils) than in ArrayRealVector which is not
devoted to provide utilities. ArrayRealVector can delegate its
computation to MathUtils/MatrixUtils since it has acces to its own
internal data and can provide it to the utility.

Luc

> 
> 
> Gilles
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
> For additional commands, e-mail: dev-h...@commons.apache.org
> 
> 


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

Reply via email to