static void sortBy_6(float[] l1, int[] l2) { SVectorOrdering[] a = new SVectorOrdering[6]; for (int c = 0; c < 6; ++c) { a[c].val = l1[c]; a[c].axis = l2[c]; } Array.Sort(a, (v1, v2) => v1.val.CompareTo(v2.val)); for (int c = 0; c < 6; ++c) { l2[c] = a[c].axis; } }
private static void Sort(float[] l1, int[] l2) { SVectorOrdering[] a = new SVectorOrdering[6]; for (int c = 0; c < 6; ++c) { a[c].val = l1[c]; a[c].axis = l2[c]; } System.Array.Sort(a); for (int c = 0; c < 6; ++c) { l2[c] = a[c].axis; } }