Here you can find the source of minIndex(double[] x, int length)
public static int minIndex(double[] x, int length)
//package com.java2s; //License from project: BSD License public class Main { public static int minIndex(double[] x, int length) { double m = Double.POSITIVE_INFINITY; int mi = -1; for (int i = 0; i < length; i++) if (x[i] < m) { m = x[i];// w w w . j a va 2 s .c om mi = i; } return mi; } public static int minIndex(int[] x, int length) { int m = Integer.MAX_VALUE; int mi = -1; for (int i = 0; i < length; i++) if (x[i] < m) { m = x[i]; mi = i; } return mi; } }