|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectweka.classifiers.misc.monotone.MultiDimensionalSort
public class MultiDimensionalSort
Class for doing multidimensional sorting, using an array of
Comparator.
The goal is to sort an array topologically. If o1
and o2
are two objects of the array a,
and for all valid indices i
in the array c
if holds that c[i].compare(o1,o2) < 0
then
o1
comes before o2
in the sorted array.
A typical is the sorting of vectors in an n-dimensional space, where the ordering is determined by the product ordering.
This implementation is part of the master's thesis: "Studie en implementatie van instantie-gebaseerde algoritmen voor gesuperviseerd rangschikken", Stijn Lievens, Ghent University, 2004.
Constructor Summary | |
---|---|
MultiDimensionalSort()
|
Method Summary | |
---|---|
static void |
multiDimensionalSort(java.lang.Object[] a,
java.util.Comparator[] c)
Sort an array using different comparators. |
static void |
multiDimensionalSort(java.lang.Object[] a,
int fromIndex,
int toIndex,
java.util.Comparator[] c)
Sort part of an array using different comparators. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MultiDimensionalSort()
Method Detail |
---|
public static void multiDimensionalSort(java.lang.Object[] a, java.util.Comparator[] c)
a
- the array to be sorted. The sorted array is returned
in the array a
itself.c
- an array holding the different comparatorspublic static void multiDimensionalSort(java.lang.Object[] a, int fromIndex, int toIndex, java.util.Comparator[] c) throws java.lang.IllegalArgumentException
a
- the array to be sorted, the indicated part of the array will
be replaced by the sorted elementsfromIndex
- index of the first element to be sorted (inclusive)toIndex
- index of the last element to be sorted (exclusive)c
- array holding the different comparators
java.lang.IllegalArgumentException
- if fromIndex > toIndex
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |