@Test public void testGetIndexCorrespondence(){ int[] result=Utils.getIndexCorrespondence(new int []{2,3,5}, new int []{2,3}); assertArrayEquals(new int []{0,1},result); result=Utils.getIndexCorrespondence(new int []{1,2,3,4,5}, new int []{1,2,3,4,5}); assertArrayEquals(new int []{0,1,2,3,4},result); result=Utils.getIndexCorrespondence(new int []{1,2,5}, new int []{1,5}); assertArrayEquals(new int []{0,2},result); result=Utils.getIndexCorrespondence(new int []{1,2,5}, new int []{2}); assertArrayEquals(new int []{1},result); }
public static int[] getIndexCorrespondence(int[] originalSet, int[] subSet) { int [] indices= new int[subSet.length]; int j=0; for (int i=0; i<subSet.length;i++){ while(originalSet[j]!=subSet[i]) j++; indices[i]=j; } return indices; }
Utils { public static int[] getIndexCorrespondence(int[] originalSet, int[] subSet) { int [] indices= new int[subSet.length]; int j=0; for (int i=0; i<subSet.length;i++){ while(originalSet[j]!=subSet[i]) j++; indices[i]=j; } return indices; } }
Utils { public static int[] getIndexCorrespondence(int[] originalSet, int[] subSet) { int [] indices= new int[subSet.length]; int j=0; for (int i=0; i<subSet.length;i++){ while(originalSet[j]!=subSet[i]) j++; indices[i]=j; } return indices; }  }
Utils { public static int[] getIndexCorrespondence(int[] originalSet, int[] subSet) { int [] indices= new int[subSet.length]; int j=0; for (int i=0; i<subSet.length;i++){ while(originalSet[j]!=subSet[i]) j++; indices[i]=j; } return indices; }  static double computeVariance(double count, double sum, double sumSquares); static double computeVariance(DoubleVector statistics); static double computeSD(double squaredSum, double sum, double weightSeen); static double computeSD(DoubleVector statistics); static DoubleVector[][] copy(DoubleVector[][] toCopy); static DoubleVector[] copy(DoubleVector[] toCopy); static SingleVector[] copyAsFloatVector(DoubleVector[] toCopy); static SingleVector[] copy(SingleVector[] toCopy); static DoubleVector floatToDoubleVector(SingleVector toCopy); static int [] complementSet(int[] referenceSet, int[] comparingSet); static int[] getIndexCorrespondence(int[] originalSet, int[] subSet); static double computeEntropy(DoubleVector statistics); static double computeEntropy(double count, double sum); }
Utils { public static int[] getIndexCorrespondence(int[] originalSet, int[] subSet) { int [] indices= new int[subSet.length]; int j=0; for (int i=0; i<subSet.length;i++){ while(originalSet[j]!=subSet[i]) j++; indices[i]=j; } return indices; }  static double computeVariance(double count, double sum, double sumSquares); static double computeVariance(DoubleVector statistics); static double computeSD(double squaredSum, double sum, double weightSeen); static double computeSD(DoubleVector statistics); static DoubleVector[][] copy(DoubleVector[][] toCopy); static DoubleVector[] copy(DoubleVector[] toCopy); static SingleVector[] copyAsFloatVector(DoubleVector[] toCopy); static SingleVector[] copy(SingleVector[] toCopy); static DoubleVector floatToDoubleVector(SingleVector toCopy); static int [] complementSet(int[] referenceSet, int[] comparingSet); static int[] getIndexCorrespondence(int[] originalSet, int[] subSet); static double computeEntropy(DoubleVector statistics); static double computeEntropy(double count, double sum);  }