Here you can find the source of minFastSort(double[] x, int[] idx, int size)
public static void minFastSort(double[] x, int[] idx, int size)
//package com.java2s; // it under the terms of the GNU Lesser General Public License as published by public class Main { public static void minFastSort(double[] x, int[] idx, int size) { for (int i = 0; i < size; i++) { for (int j = i + 1; j < size; j++) { if (x[i] > x[j]) { double temp = x[i]; int tempIdx = idx[i]; x[i] = x[j];//from ww w. java 2 s .c o m x[j] = temp; idx[i] = idx[j]; idx[j] = tempIdx; } else if (x[i] == x[j]) { if (idx[i] > idx[j]) { double temp = x[i]; int tempIdx = idx[i]; x[i] = x[j]; x[j] = temp; idx[i] = idx[j]; idx[j] = tempIdx; } } } } } }