Class AbstractUnivariateStatistic

    • Method Summary

      Modifier and Type Method Description
      abstract UnivariateStatistic copy()
      Returns a copy of the statistic with the same internal state.
      double evaluate()
      Returns the result of evaluating the statistic over the stored data.
      double evaluate​(double[] values)
      Returns the result of evaluating the statistic over the input array.
      abstract double evaluate​(double[] values, int begin, int length)
      Returns the result of evaluating the statistic over the specified entries in the input array.
      double[] getData()
      Get a copy of the stored data array.
      protected double[] getDataRef()
      Get a reference to the stored data array.
      void setData​(double[] values)
      Set the data array.
      void setData​(double[] values, int begin, int length)
      Set the data array.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AbstractUnivariateStatistic

        public AbstractUnivariateStatistic()
    • Method Detail

      • evaluate

        public abstract double evaluate​(double[] values,
                                        int begin,
                                        int length)
                                 throws MathIllegalArgumentException
        Returns the result of evaluating the statistic over the specified entries in the input array.
        Specified by:
        evaluate in interface MathArrays.Function
        Specified by:
        evaluate in interface UnivariateStatistic
        Parameters:
        values - the input array
        begin - the index of the first element to include
        length - the number of elements to include
        Returns:
        the value of the statistic applied to the included array entries
        Throws:
        MathIllegalArgumentException - if values is null or the indices are invalid
      • setData

        public void setData​(double[] values)
        Set the data array.

        The stored value is a copy of the parameter array, not the array itself.

        Parameters:
        values - data array to store (may be null to remove stored data)
        See Also:
        evaluate()
      • getData

        public double[] getData()
        Get a copy of the stored data array.
        Returns:
        copy of the stored data array (may be null)
      • getDataRef

        protected double[] getDataRef()
        Get a reference to the stored data array.
        Returns:
        reference to the stored data array (may be null)
      • setData

        public void setData​(double[] values,
                            int begin,
                            int length)
                     throws MathIllegalArgumentException
        Set the data array. The input array is copied, not referenced.
        Parameters:
        values - data array to store
        begin - the index of the first element to include
        length - the number of elements to include
        Throws:
        MathIllegalArgumentException - if values is null or the indices are not valid
        See Also:
        evaluate()