[ 
https://issues.apache.org/jira/browse/MATH-1372?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15310355#comment-15310355
 ] 

Gilles commented on MATH-1372:
------------------------------

bq. I'm wondering \[...\] reducing code duplication

Yes that was the purpose (e.g. not repeating the precondition check code).
Your solution goes further. :)

bq. Regarding preconditions, \[...\] assumed that getting an NPE is expected

Indeed there are various levels of compliance.  And we even discussed several 
times that particular point about NPE, without reaching consensus.

But if the array has zero size, your initial code would have thrown another 
exception.  That may be fine but in CM, we agreed to throw custom exceptions in 
all cases but (sometimes) NPE.
Of course this position on custom vs standard exception can change.  And now is 
the time to discuss this, and many other things...

bq. With regards to the right place,

Did you intend to use those utilities in your pending work on the clustering 
algorithms?


> Add argmin/argmax static functions to MathArrays utility class
> --------------------------------------------------------------
>
>                 Key: MATH-1372
>                 URL: https://issues.apache.org/jira/browse/MATH-1372
>             Project: Commons Math
>          Issue Type: Wish
>            Reporter: Artem Barger
>            Assignee: Artem Barger
>            Priority: Trivial
>         Attachments: MATH-1372.patch
>
>
> Following conversation in the ML thread.
> Working lately w/ CM, I've found myself using a lot functions which helps to 
> identify the index of the min/max elements in given array of doubles. 
> In ML it was pointed out that similar functionality already exists in 
> RealVector, however due to MATH-765 it's planned to be removed (deprecated), 
> moreover to use it one has to create an instance of RealVector, where for 
> simple cases it might be redundant.
> Hence I'd like to propose to add these static methods to the MathArrays 
> utility class.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to