|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.knowceans.util.IndexQuickSort
public class IndexQuickSort
IndexQuickSort sorts indices of an array without changing its values. There are additional functions to reverse the order and to get the inverse of the mapping from the array to the sorted index. Types supported include primitive double and int arrays as well as objects and associated Comparators.
Constructor Summary | |
---|---|
IndexQuickSort()
|
Method Summary | ||
---|---|---|
static int[] |
inverse(int[] index)
inverse of the index, i.e., the ordered index of the argument |
|
static void |
inverse(int[] index,
int[] invindex)
inverse of the index, i.e., the ordered index of the argument |
|
static void |
main(java.lang.String[] args)
|
|
static void |
reorder(double[] x,
int[] sort)
reorder the matrix according to the sorting |
|
static void |
resortdec(int[] x,
int[] idx,
int[] invidx,
int dec)
re-sort index of x after x[dec] has reduced in value |
|
static void |
resortinc(int[] x,
int[] idx,
int[] invidx,
int inc)
re-sort index of x after x[inc] has increased in value |
|
static void |
reverse(int[] index)
reverse ordering |
|
static int[] |
sort(double[] fixedArray)
sort indices |
|
static void |
sort(double[] fixedArray,
int[] index)
sort indices |
|
static void |
sort(double[] a,
int[] index,
int left,
int right)
|
|
static int[] |
sort(int[] fixedArray)
sort indices |
|
static void |
sort(int[] fixedArray,
int[] index)
sort indices |
|
static void |
sort(int[] a,
int[] index,
int left,
int right)
|
|
static
|
sort(T[] fixedArray,
java.util.Comparator<T> cmp)
sort indices |
|
static
|
sort(T[] fixedArray,
java.util.Comparator<T> cmp,
int[] index)
sort indices |
|
static
|
sort(T[] a,
java.util.Comparator<T> cmp,
int[] index,
int left,
int right)
|
|
static void |
swap(int[] index,
int i,
int j)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public IndexQuickSort()
Method Detail |
---|
public static void main(java.lang.String[] args)
public static void sort(double[] fixedArray, int[] index)
fixedArray
- values to be sortedindex
- range of indices into fixedArraypublic static int[] sort(double[] fixedArray)
fixedArray
- values to be sorted
public static int[] inverse(int[] index)
index
- public static void inverse(int[] index, int[] invindex)
index
- invindex
- the inverse mapping of indexpublic static void reverse(int[] index)
main
- index
- public static void sort(double[] a, int[] index, int left, int right)
public static void swap(int[] index, int i, int j)
public static void sort(int[] fixedArray, int[] index)
fixedArray
- values to be sortedindex
- range of indices into fixedArraypublic static int[] sort(int[] fixedArray)
fixedArray
- values to be sorted
public static void sort(int[] a, int[] index, int left, int right)
public static <T> void sort(T[] fixedArray, java.util.Comparator<T> cmp, int[] index)
fixedArray
- values to be sortedindex
- range of indices into fixedArraypublic static <T> int[] sort(T[] fixedArray, java.util.Comparator<T> cmp)
fixedArray
- values to be sorted
public static <T> void sort(T[] a, java.util.Comparator<T> cmp, int[] index, int left, int right)
public static void resortinc(int[] x, int[] idx, int[] invidx, int inc)
x
- sort2k
- invidx
- inc
- public static void resortdec(int[] x, int[] idx, int[] invidx, int dec)
x
- sort2k
- invidx
- dec
- public static void reorder(double[] x, int[] sort)
ds
- sort
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |