Here you can find the source of min(double[] series)
Parameter | Description |
---|---|
series | The timeseries. |
public static double min(double[] series)
//package com.java2s; //License from project: Open Source License public class Main { /**/*ww w . j av a 2 s . c o m*/ * Finds the minimal value in timeseries. * * @param series The timeseries. * @return The min value. */ public static double min(double[] series) { if (countNaN(series) == series.length) { return Double.NaN; } double min = Double.MAX_VALUE; for (int i = 0; i < series.length; i++) { if (min > series[i]) { min = series[i]; } } return min; } /** * Counts the number of NaNs' in the timeseries. * * @param series The timeseries. * @return The count of NaN values. */ private static int countNaN(double[] series) { int res = 0; for (double d : series) { if (Double.isInfinite(d) || Double.isNaN(d)) { res += 1; } } return res; } }