getMin method

List getMin (Float64List array)

Finds the minimum value of the numbers in array. array may contain null values, they are skipped. Returns the minimum, its index. If 2 minima with the same value exist, the 1st one is returned.

Implementation

static List<dynamic> getMin(Float64List array) {
  double min_value = double.maxFinite;
  int min_index = -1;
  if (array != null) {
    for (int i = 0; i < array.length; i += 1) {
      if (array[i] != null && array[i] < min_value) {
        min_value = array[i];
        min_index = i;
      }
    }
  }
//  print("min=$min_value");
  return [min_value, min_index];
}