commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gilles <>
Subject Re: [Math] Adding min/max and argmin/argmax values for an arrays of double/int (Comparable).
Date Mon, 30 May 2016 22:19:45 GMT

On Tue, 31 May 2016 00:05:55 +0300, Artem Barger wrote:
> Hi.
> Lately working w/ Apache Commons Math, library I've found myself
> implementing functions which given an array of either doubles of 
> integers
> return the min or max value among all elements of an array. Moreover 
> I've
> added an argmin/argmin functions as well, which for given array of
> double/int values return an index of min/max element within that 
> array.
> Since I didn't find such functions available in the project, I'm 
> willing to
> contribute these function into the framework and was curious whenever 
> it's
> usable? Also what should be the right place to put these functions? 
> I've
> added them as static method for MathArrays class, however not 100% 
> sure
> this is the right place.
> Think further about these functions, I can easily make them work w/
> instances of Comparable interface of accept Comparator<T> as second
> parameter.
> What should be the right way to handle this?

It might be added to MathArrays indeed.
Note that such a functionality is available in "RealVector".


> Best regards,
>                       Artem Barger.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message