Commons Math
  1. Commons Math
  2. MATH-1002

AbstractUnivariateStatistic.test(double[] values, int begin, int length, boolean allowEmpty) has uses outside subclasses

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.3
    • Labels:
      None

      Description

      The methods
      AbstractUnivariateStatistic.test(double[] values, int begin, int length, boolean allowEmpty)
      and
      AbstractUnivariateStatistic.test(double[] values, int begin, int length)

      have uses outside that particular class hierarchy.

      In particular, they might be useful in StatUtils.

        Activity

        Hide
        Thomas Neidhart added a comment -

        In r1537714, renamed methods to "verifyValues" and copied also relevant unit tests from class AbstractUnivariateStatisticTest to MathArraysTest.

        Show
        Thomas Neidhart added a comment - In r1537714, renamed methods to "verifyValues" and copied also relevant unit tests from class AbstractUnivariateStatisticTest to MathArraysTest.
        Hide
        Thomas Neidhart added a comment -

        I like verifyValues.

        Show
        Thomas Neidhart added a comment - I like verifyValues.
        Hide
        Sebb added a comment -

        Method needs to be renamed once the new name is agreed.

        Show
        Sebb added a comment - Method needs to be renamed once the new name is agreed.
        Hide
        Phil Steitz added a comment - - edited

        Agreed. Maybe isValidValuesArray since it checks more than just the indices or possibly verifyValuesArray or verifyValues since it throws (at least in current impl) in some cases.

        Show
        Phil Steitz added a comment - - edited Agreed. Maybe isValidValuesArray since it checks more than just the indices or possibly verifyValuesArray or verifyValues since it throws (at least in current impl) in some cases.
        Hide
        Thomas Neidhart added a comment -

        I wonder if we should not rename this method once its public.
        The name "test" is not really meaningful and one would have to read carefully the javadoc.

        I would propose a name like "isValidSubArray"

        Show
        Thomas Neidhart added a comment - I wonder if we should not rename this method once its public. The name "test" is not really meaningful and one would have to read carefully the javadoc. I would propose a name like "isValidSubArray"
        Hide
        Sebb added a comment -

        URL: http://svn.apache.org/r1532459
        Log:
        MATH-1002 AbstractUnivariateStatistic.test(double[] values, int begin, int length, boolean allowEmpty) has uses outside subclasses

        Modified:
        commons/proper/math/trunk/src/changes/changes.xml
        commons/proper/math/trunk/src/main/java/org/apache/commons/math3/stat/descriptive/AbstractUnivariateStatistic.java
        commons/proper/math/trunk/src/main/java/org/apache/commons/math3/util/MathArrays.java

        Show
        Sebb added a comment - URL: http://svn.apache.org/r1532459 Log: MATH-1002 AbstractUnivariateStatistic.test(double[] values, int begin, int length, boolean allowEmpty) has uses outside subclasses Modified: commons/proper/math/trunk/src/changes/changes.xml commons/proper/math/trunk/src/main/java/org/apache/commons/math3/stat/descriptive/AbstractUnivariateStatistic.java commons/proper/math/trunk/src/main/java/org/apache/commons/math3/util/MathArrays.java
        Hide
        Phil Steitz added a comment -

        +1 to deprecate (they are protected, so can't just rip them out) and move to MathArrays.

        Show
        Phil Steitz added a comment - +1 to deprecate (they are protected, so can't just rip them out) and move to MathArrays.

          People

          • Assignee:
            Unassigned
            Reporter:
            Sebb
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development