public class QuickSelectDBIDs
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static int |
SMALL
For small arrays, use a simpler method:
|
Modifier | Constructor and Description |
---|---|
private |
QuickSelectDBIDs()
Do not instantiate - static methods only!
|
Modifier and Type | Method and Description |
---|---|
private static int |
bestPivot(int rank,
int m1,
int m2,
int m3,
int m4,
int m5)
Choose the best pivot for the given rank.
|
private static void |
insertionSort(ArrayModifiableDBIDs data,
java.util.Comparator<? super DBIDRef> comparator,
int start,
int end,
DBIDArrayIter iter1,
DBIDArrayIter iter2)
Sort a small array using repetitive insertion sort.
|
private static void |
insertionSort(ModifiableDoubleDBIDList data,
int start,
int end,
DoubleDBIDListIter iter1,
DoubleDBIDListIter iter2)
Sort a small array using repetitive insertion sort.
|
static int |
median(ArrayModifiableDBIDs data,
java.util.Comparator<? super DBIDRef> comparator)
Compute the median of an array efficiently using the QuickSelect method.
|
static int |
median(ArrayModifiableDBIDs data,
java.util.Comparator<? super DBIDRef> comparator,
int begin,
int end)
Compute the median of an array efficiently using the QuickSelect method.
|
static int |
median(ModifiableDoubleDBIDList data)
Compute the median of an array efficiently using the QuickSelect method.
|
static int |
median(ModifiableDoubleDBIDList data,
int begin,
int end)
Compute the median of an array efficiently using the QuickSelect method.
|
static int |
quantile(ArrayModifiableDBIDs data,
java.util.Comparator<? super DBIDRef> comparator,
double quant)
Compute the median of an array efficiently using the QuickSelect method.
|
static int |
quantile(ArrayModifiableDBIDs data,
java.util.Comparator<? super DBIDRef> comparator,
int begin,
int end,
double quant)
Compute the median of an array efficiently using the QuickSelect method.
|
static int |
quantile(ModifiableDoubleDBIDList data,
double quant)
Compute the median of an array efficiently using the QuickSelect method.
|
static int |
quantile(ModifiableDoubleDBIDList data,
int begin,
int end,
double quant)
Compute the median of an array efficiently using the QuickSelect method.
|
static void |
quickSelect(ArrayModifiableDBIDs data,
java.util.Comparator<? super DBIDRef> comparator,
int rank)
QuickSelect is essentially quicksort, except that we only "sort" that half
of the array that we are interested in.
|
static void |
quickSelect(ArrayModifiableDBIDs data,
java.util.Comparator<? super DBIDRef> comparator,
int start,
int end,
int rank)
QuickSelect is essentially quicksort, except that we only "sort" that half
of the array that we are interested in.
|
static void |
quickSelect(ModifiableDoubleDBIDList data,
int rank)
QuickSelect is essentially quicksort, except that we only "sort" that half
of the array that we are interested in.
|
static void |
quickSelect(ModifiableDoubleDBIDList data,
int start,
int end,
int rank)
QuickSelect is essentially quicksort, except that we only "sort" that half
of the array that we are interested in.
|
private static final int SMALL
private QuickSelectDBIDs()
private static final int bestPivot(int rank, int m1, int m2, int m3, int m4, int m5)
rank
- Rankm1
- Pivot candidatem2
- Pivot candidatem3
- Pivot candidatem4
- Pivot candidatem5
- Pivot candidatepublic static void quickSelect(ArrayModifiableDBIDs data, java.util.Comparator<? super DBIDRef> comparator, int rank)
data
- Data to processcomparator
- Comparator to userank
- Rank position that we are interested in (integer!)public static int median(ArrayModifiableDBIDs data, java.util.Comparator<? super DBIDRef> comparator)
data
- Data to processcomparator
- Comparator to usepublic static int median(ArrayModifiableDBIDs data, java.util.Comparator<? super DBIDRef> comparator, int begin, int end)
data
- Data to processcomparator
- Comparator to usebegin
- Begin of valid valuesend
- End of valid values (exclusive!)public static int quantile(ArrayModifiableDBIDs data, java.util.Comparator<? super DBIDRef> comparator, double quant)
data
- Data to processcomparator
- Comparator to usequant
- Quantile to computepublic static int quantile(ArrayModifiableDBIDs data, java.util.Comparator<? super DBIDRef> comparator, int begin, int end, double quant)
data
- Data to processcomparator
- Comparator to usebegin
- Begin of valid valuesend
- End of valid values (exclusive)quant
- Quantile to computepublic static void quickSelect(ArrayModifiableDBIDs data, java.util.Comparator<? super DBIDRef> comparator, int start, int end, int rank)
data
- Data to processcomparator
- Comparator to usestart
- Interval startend
- Interval end (exclusive)rank
- rank position we are interested in (starting at 0)private static void insertionSort(ArrayModifiableDBIDs data, java.util.Comparator<? super DBIDRef> comparator, int start, int end, DBIDArrayIter iter1, DBIDArrayIter iter2)
data
- Data to sortstart
- Interval startend
- Interval endpublic static void quickSelect(ModifiableDoubleDBIDList data, int rank)
data
- Data to processrank
- Rank position that we are interested in (integer!)public static int median(ModifiableDoubleDBIDList data)
data
- Data to processpublic static int median(ModifiableDoubleDBIDList data, int begin, int end)
data
- Data to processbegin
- Begin of valid valuesend
- End of valid values (exclusive!)public static int quantile(ModifiableDoubleDBIDList data, double quant)
data
- Data to processquant
- Quantile to computepublic static int quantile(ModifiableDoubleDBIDList data, int begin, int end, double quant)
data
- Data to processbegin
- Begin of valid valuesend
- End of valid values (exclusive)quant
- Quantile to computepublic static void quickSelect(ModifiableDoubleDBIDList data, int start, int end, int rank)
data
- Data to processstart
- Interval startend
- Interval end (exclusive)rank
- rank position we are interested in (starting at 0)private static void insertionSort(ModifiableDoubleDBIDList data, int start, int end, DoubleDBIDListIter iter1, DoubleDBIDListIter iter2)
data
- Data to sortstart
- Interval startend
- Interval endCopyright © 2019 ELKI Development Team. License information.