/** * This default implementation calls {@link #clear}, then invokes * {@link #increment} in a loop over the the input array, and then uses * {@link #getResult} to compute the return value. * <p> * Note that this implementation changes the internal state of the * statistic. Its side effects are the same as invoking {@link #clear} and * then {@link #incrementAll(double[])}.</p> * <p> * Implementations may override this method with a more efficient and * possibly more accurate implementation that works directly with the * input array.</p> * <p> * If the array is null, an IllegalArgumentException is thrown.</p> * * @see org.apache.commons.math.stat.descriptive.UnivariateStatistic#evaluate(double[]) */ public double evaluate(final double[] values) { if (values == null) { throw new IllegalArgumentException("input value array is null"); } return evaluate(values, 0, values.length); }
/** * This default implementation calls {@link #clear}, then invokes * {@link #increment} in a loop over the the input array, and then uses * {@link #getResult} to compute the return value. * <p> * Note that this implementation changes the internal state of the * statistic. Its side effects are the same as invoking {@link #clear} and * then {@link #incrementAll(double[])}.</p> * <p> * Implementations may override this method with a more efficient and * possibly more accurate implementation that works directly with the * input array.</p> * <p> * If the array is null, an IllegalArgumentException is thrown.</p> * @param values input array * @return the value of the statistic applied to the input array * @see org.apache.commons.math.stat.descriptive.UnivariateStatistic#evaluate(double[]) */ @Override public double evaluate(final double[] values) { if (values == null) { throw new NullArgumentException(LocalizedFormats.INPUT_ARRAY); } return evaluate(values, 0, values.length); }
/** * This default implementation calls {@link #clear}, then invokes * {@link #increment} in a loop over the the input array, and then uses * {@link #getResult} to compute the return value. * <p> * Note that this implementation changes the internal state of the * statistic. Its side effects are the same as invoking {@link #clear} and * then {@link #incrementAll(double[])}.</p> * <p> * Implementations may override this method with a more efficient and * possibly more accurate implementation that works directly with the * input array.</p> * <p> * If the array is null, an IllegalArgumentException is thrown.</p> * @param values input array * @return the value of the statistic applied to the input array * @see org.apache.commons.math.stat.descriptive.UnivariateStatistic#evaluate(double[]) */ @Override public double evaluate(final double[] values) { if (values == null) { throw MathRuntimeException.createIllegalArgumentException("input values array is null"); } return evaluate(values, 0, values.length); }