commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sebb (JIRA)" <>
Subject [jira] [Comment Edited] (MATH-1007) Add mode function to StatUtils class
Date Tue, 16 Jul 2013 10:34:49 GMT


Sebb edited comment on MATH-1007 at 7/16/13 10:34 AM:

Sample implementation - this does not use a separate helper class, and does its own parameter
      was (Author:
    Sample implementation
> Add mode function to StatUtils class
> ------------------------------------
>                 Key: MATH-1007
>                 URL:
>             Project: Commons Math
>          Issue Type: New Feature
>            Reporter: Sebb
>         Attachments: MATH-1007.patch
> It might be useful to have a StatUtils function to get the mode.
> However, this may be tricky as it does not easily fit in with the current StatUtils design.
> The mode can have multiple elements, but all the other methods only return a single value.
> There are at least two options for converting an array to a single value:
> - arbitrarily (or randomly) pick one
> - throw an Exception if there is more than one mode
> Or maybe StatUtils should return a double array.
> StatUtils also uses nested classes for all but the difference and normalize methods.
However the standard interfaces and classes don't support returning arrays.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

View raw message