Here you can find the source of minIndex(float[] xs)
public static int minIndex(float[] xs)
//package com.java2s; //License from project: Apache License public class Main { public static int minIndex(float[] xs) { if (xs == null) throw new RuntimeException("Received null input"); if (xs.length == 0) throw new RuntimeException("Receveid empty array input"); int minIdx = -1; float minVal = Float.MAX_VALUE; for (int i = 0; i < xs.length; ++i) { if (xs[i] < minVal) { minVal = xs[i];/*from w w w . j a va 2 s . c o m*/ minIdx = i; } } return minIdx; } }