/** * Returns the product of the entries in the input array, or * <code>Double.NaN</code> if the array is empty. * <p> * Throws <code>IllegalArgumentException</code> if the array is null.</p> * * @param values the input array * @return the product of the values or Double.NaN if the array is empty * @throws IllegalArgumentException if the array is null */ public static double product(final double[] values) { return PRODUCT.evaluate(values); }
@Override public double evaluate(double[] values, int begin, int length) { return delegate.evaluate(values, begin, length); } }
@Override public double evaluate(double[] values) { return delegate.evaluate(values); }
/** * Returns the product of the entries in the input array, or * <code>Double.NaN</code> if the array is empty. * <p> * Throws <code>IllegalArgumentException</code> if the array is null.</p> * * @param values the input array * @return the product of the values or Double.NaN if the array is empty * @throws IllegalArgumentException if the array is null */ public static double product(final double[] values) { return prod.evaluate(values); }
/** * Returns the product of the entries in the input array, or * <code>Double.NaN</code> if the array is empty. * <p> * Throws <code>IllegalArgumentException</code> if the array is null.</p> * * @param values the input array * @return the product of the values or Double.NaN if the array is empty * @throws IllegalArgumentException if the array is null */ public static double product(final double[] values) { return PRODUCT.evaluate(values); }
/** * Returns the sum of the squares of the entries in the input array, or * <code>Double.NaN</code> if the array is empty. * <p> * Throws <code>IllegalArgumentException</code> if the array is null.</p> * * @param values input array * @return the sum of the squared values or <code>Double.NaN</code> if the * array is empty * @throws IllegalArgumentException if the array is null */ public static double sumSq(final double[] values) { return SUM_OF_SQUARES.evaluate(values); }
/** * Returns the sum of the squares of the entries in the input array, or * <code>Double.NaN</code> if the array is empty. * <p> * Throws <code>IllegalArgumentException</code> if the array is null.</p> * * @param values input array * @return the sum of the squared values or <code>Double.NaN</code> if the * array is empty * @throws IllegalArgumentException if the array is null */ public static double sumSq(final double[] values) { return sumSq.evaluate(values); }
/** * Returns the sum of the values in the input array, or * <code>Double.NaN</code> if the array is empty. * <p> * Throws <code>IllegalArgumentException</code> if the input array * is null.</p> * * @param values array of values to sum * @return the sum of the values or <code>Double.NaN</code> if the array * is empty * @throws IllegalArgumentException if the array is null */ public static double sum(final double[] values) { return SUM.evaluate(values); }
/** * Returns the sum of the squares of the entries in the input array, or * <code>Double.NaN</code> if the array is empty. * <p> * Throws <code>IllegalArgumentException</code> if the array is null.</p> * * @param values input array * @return the sum of the squared values or <code>Double.NaN</code> if the * array is empty * @throws IllegalArgumentException if the array is null */ public static double sumSq(final double[] values) { return SUM_OF_SQUARES.evaluate(values); }
/** * Returns the arithmetic mean of the entries in the input array, or * <code>Double.NaN</code> if the array is empty. * <p> * Throws <code>IllegalArgumentException</code> if the array is null.</p> * <p> * See {@link org.apache.commons.math.stat.descriptive.moment.Mean} for * details on the computing algorithm.</p> * * @param values the input array * @return the mean of the values or Double.NaN if the array is empty * @throws IllegalArgumentException if the array is null */ public static double mean(final double[] values) { return MEAN.evaluate(values); }
/** * Returns the arithmetic mean of the entries in the input array, or * <code>Double.NaN</code> if the array is empty. * <p> * Throws <code>IllegalArgumentException</code> if the array is null.</p> * <p> * See {@link org.apache.commons.math.stat.descriptive.moment.Mean} for * details on the computing algorithm.</p> * * @param values the input array * @return the mean of the values or Double.NaN if the array is empty * @throws IllegalArgumentException if the array is null */ public static double mean(final double[] values) { return MEAN.evaluate(values); }
/** * Returns the sum of the values in the input array, or * <code>Double.NaN</code> if the array is empty. * <p> * Throws <code>IllegalArgumentException</code> if the input array * is null.</p> * * @param values array of values to sum * @return the sum of the values or <code>Double.NaN</code> if the array * is empty * @throws IllegalArgumentException if the array is null */ public static double sum(final double[] values) { return SUM.evaluate(values); }
/** * Returns the sum of the values in the input array, or * <code>Double.NaN</code> if the array is empty. * <p> * Throws <code>IllegalArgumentException</code> if the input array * is null.</p> * * @param values array of values to sum * @return the sum of the values or <code>Double.NaN</code> if the array * is empty * @throws IllegalArgumentException if the array is null */ public static double sum(final double[] values) { return sum.evaluate(values); }
/** * Returns the sum of the natural logs of the entries in the input array, or * <code>Double.NaN</code> if the array is empty. * <p> * Throws <code>IllegalArgumentException</code> if the array is null.</p> * <p> * See {@link org.apache.commons.math.stat.descriptive.summary.SumOfLogs}. * </p> * * @param values the input array * @return the sum of the natural logs of the values or Double.NaN if * the array is empty * @throws IllegalArgumentException if the array is null */ public static double sumLog(final double[] values) { return sumLog.evaluate(values); }
/** * Returns the sum of the natural logs of the entries in the input array, or * <code>Double.NaN</code> if the array is empty. * <p> * Throws <code>IllegalArgumentException</code> if the array is null.</p> * <p> * See {@link org.apache.commons.math.stat.descriptive.summary.SumOfLogs}. * </p> * * @param values the input array * @return the sum of the natural logs of the values or Double.NaN if * the array is empty * @throws IllegalArgumentException if the array is null */ public static double sumLog(final double[] values) { return SUM_OF_LOGS.evaluate(values); }
private double getGcRatio(List<TaskExecutionAPIEntity> tasks) { if (tasks.isEmpty()) { return 0; } double[] gcMs = ResourceUtils.getCounterValues(tasks, JobCounters.CounterName.GC_MILLISECONDS); double[] cpuMs = ResourceUtils.getCounterValues(tasks, JobCounters.CounterName.CPU_MILLISECONDS); DescriptiveStatistics statistics = new DescriptiveStatistics(); double averageCpuMs = statistics.getMeanImpl().evaluate(cpuMs); double averageGcMs = statistics.getMeanImpl().evaluate(gcMs); if (averageCpuMs == 0) { averageCpuMs = 1; } return averageGcMs / averageCpuMs; }
/** * Apply the given statistic to the data associated with this set of statistics. * @param stat the statistic to apply * @return the computed value of the statistic. */ public double apply(UnivariateStatistic stat) { return stat.evaluate(eDA.getInternalValues(), eDA.start(), eDA.getNumElements()); }
/** * Apply the given statistic to the data associated with this set of statistics. * @param stat the statistic to apply * @return the computed value of the statistic. */ public double apply(UnivariateStatistic stat) { return stat.evaluate(eDA.getValues(), eDA.start(), eDA.getNumElements()); }
/** * Apply the given statistic to the data associated with this set of statistics. * @param stat the statistic to apply * @return the computed value of the statistic. */ public double apply(UnivariateStatistic stat) { return stat.evaluate(eDA.getInternalValues(), eDA.start(), eDA.getNumElements()); }
@Override public JobSuggestionResponse apply(TaskGroupResponse data) { MRTaskExecutionResponse.TaskGroup taskGroup = getTasks(data); double[] smallerGroup = ResourceUtils.getCounterValues(taskGroup.shortTasks, counterName); double[] largerGroup = ResourceUtils.getCounterValues(taskGroup.longTasks, counterName); DescriptiveStatistics statistics = new DescriptiveStatistics(); double avgSmaller = statistics.getMeanImpl().evaluate(smallerGroup); double avgLarger = statistics.getMeanImpl().evaluate(largerGroup); List<MRTaskExecutionResponse.SuggestionResult> suggestionResults = getDeviationSuggest(avgSmaller, avgLarger); MRTaskExecutionResponse.JobSuggestionResponse response = new MRTaskExecutionResponse.JobSuggestionResponse(); response.suggestionResults = suggestionResults; response.suggestionType = suggestType.toString(); return response; }