public class Partition extends Object
Constructor and Description |
---|
Partition() |
Modifier and Type | Method and Description |
---|---|
static int |
partitionSubList(int i,
int j,
byte[] values)
Partition a subarray of
values . |
static int |
partitionSubList(int i,
int j,
char[] values)
Partition a subarray of
values . |
static int |
partitionSubList(int i,
int j,
double[] values)
Partition a subarray of
values . |
static int |
partitionSubList(int i,
int j,
float[] values)
Partition a subarray of
values . |
static int |
partitionSubList(int i,
int j,
int[] values)
Partition a subarray of
values . |
static <T extends Comparable<T>> |
partitionSubList(int i,
int j,
List<T> values)
Partition a sublist of
values . |
static <T> int |
partitionSubList(int i,
int j,
List<T> values,
Comparator<? super T> compare)
Partition a sublist of
values . |
static <T extends Comparable<T>> |
partitionSubList(int i,
int j,
List<T> values,
int[] permutation)
Partition a sublist of
values . |
static <T> int |
partitionSubList(int i,
int j,
List<T> values,
int[] permutation,
Comparator<? super T> compare)
Partition a sublist of
values . |
static int |
partitionSubList(int i,
int j,
long[] values)
Partition a subarray of
values . |
static int |
partitionSubList(int i,
int j,
short[] values)
Partition a subarray of
values . |
static <T extends Comparable<T>> |
partitionSubList(ListIterator<T> i,
ListIterator<T> j)
Partition a sublist.
|
static <T> void |
partitionSubList(ListIterator<T> i,
ListIterator<T> j,
Comparator<? super T> compare)
Partition a sublist.
|
static <T extends Comparable<T>> |
partitionSubList(ListIterator<T> i,
ListIterator<T> j,
int[] permutation)
Partition a sublist.
|
static <T> void |
partitionSubList(ListIterator<T> i,
ListIterator<T> j,
int[] permutation,
Comparator<? super T> compare)
Partition a sublist.
|
public static int partitionSubList(int i, int j, byte[] values)
values
.
The element at index j
is taken as the pivot value. The elements
[i,j]
are reordered, such that all elements before the pivot are
smaller and all elements after the pivot are equal or larger than the
pivot. The index of the pivot element is returned.i
- index of first element of subarrayj
- index of last element of subarrayvalues
- arraypublic static int partitionSubList(int i, int j, short[] values)
values
.
The element at index j
is taken as the pivot value. The elements
[i,j]
are reordered, such that all elements before the pivot are
smaller and all elements after the pivot are equal or larger than the
pivot. The index of the pivot element is returned.i
- index of first element of subarrayj
- index of last element of subarrayvalues
- arraypublic static int partitionSubList(int i, int j, int[] values)
values
.
The element at index j
is taken as the pivot value. The elements
[i,j]
are reordered, such that all elements before the pivot are
smaller and all elements after the pivot are equal or larger than the
pivot. The index of the pivot element is returned.i
- index of first element of subarrayj
- index of last element of subarrayvalues
- arraypublic static int partitionSubList(int i, int j, long[] values)
values
.
The element at index j
is taken as the pivot value. The elements
[i,j]
are reordered, such that all elements before the pivot are
smaller and all elements after the pivot are equal or larger than the
pivot. The index of the pivot element is returned.i
- index of first element of subarrayj
- index of last element of subarrayvalues
- arraypublic static int partitionSubList(int i, int j, float[] values)
values
.
The element at index j
is taken as the pivot value. The elements
[i,j]
are reordered, such that all elements before the pivot are
smaller and all elements after the pivot are equal or larger than the
pivot. The index of the pivot element is returned.i
- index of first element of subarrayj
- index of last element of subarrayvalues
- arraypublic static int partitionSubList(int i, int j, double[] values)
values
.
The element at index j
is taken as the pivot value. The elements
[i,j]
are reordered, such that all elements before the pivot are
smaller and all elements after the pivot are equal or larger than the
pivot. The index of the pivot element is returned.i
- index of first element of subarrayj
- index of last element of subarrayvalues
- arraypublic static int partitionSubList(int i, int j, char[] values)
values
.
The element at index j
is taken as the pivot value. The elements
[i,j]
are reordered, such that all elements before the pivot are
smaller and all elements after the pivot are equal or larger than the
pivot. The index of the pivot element is returned.i
- index of first element of subarrayj
- index of last element of subarrayvalues
- arraypublic static <T> int partitionSubList(int i, int j, List<T> values, Comparator<? super T> compare)
values
.
The element at index j
is taken as the pivot value. The elements
[i,j]
are reordered, such that all elements before the pivot are
smaller and all elements after the pivot are equal or larger than the
pivot. The index of the pivot element is returned.i
- index of first element of the sublistj
- index of last element of the sublistvalues
- the listcompare
- ordering function on Tpublic static <T extends Comparable<T>> int partitionSubList(int i, int j, List<T> values)
values
.
The element at index j
is taken as the pivot value. The elements
[i,j]
are reordered, such that all elements before the pivot are
smaller and all elements after the pivot are equal or larger than the
pivot. The index of the pivot element is returned.i
- index of first element of the sublistj
- index of last element of the sublistvalues
- the listpublic static <T> void partitionSubList(ListIterator<T> i, ListIterator<T> j, Comparator<? super T> compare)
j
is taken as the pivot value. The elements
[i,j]
are reordered, such that all elements before the pivot are
smaller and all elements after the pivot are equal or larger than the
pivot. The index of the pivot element is returned.
After the function returns, the iterator i
is on the pivot
element. That is, i.next()
gives the element after the
pivot.
i
- iterator pointing before first element of the sublist, that
is, i.next()
gives you the first element.j
- iterator pointing behind the last element of the sublist, that
is, i.previous()
gives you the last element.compare
- ordering function on Tpublic static <T extends Comparable<T>> void partitionSubList(ListIterator<T> i, ListIterator<T> j)
j
is taken as the pivot value. The elements
[i,j]
are reordered, such that all elements before the pivot are
smaller, and all elements after the pivot are equal or larger than the
pivot. The index of the pivot element is returned.
After the function returns, the iterator i
is on the pivot
element. That is, i.next()
gives the element after the
pivot.
i
- iterator pointing before first element of the sublist, that
is, i.next()
gives you the first element.j
- iterator pointing behind the last element of the sublist, that
is, i.previous()
gives you the last element.public static <T> int partitionSubList(int i, int j, List<T> values, int[] permutation, Comparator<? super T> compare)
values
.
The element at index j
is taken as the pivot value. The elements
[i,j]
are reordered, such that all elements before the pivot are
smaller and all elements after the pivot are equal or larger than the
pivot. The index of the pivot element is returned.
The permutation
array is permuted in the same way as the list.
Usually, this will be an array of indices, so that the partition
operation can be mirrored in another list: Suppose, we have a list of
keys and a lists (or several) of values. If we use
partitionSubList
to sort the keys, we want to reorder the values
in the same manner. We pass an indices array [0, 1, 2, ...] and use the
permutation of the indices to permute the values list.
i
- index of first element of the sublistj
- index of last element of the sublistvalues
- the listpermutation
- elements of this array are permuted in the same way as the
elements in the values listcompare
- ordering function on Tpublic static <T extends Comparable<T>> int partitionSubList(int i, int j, List<T> values, int[] permutation)
values
.
The element at index j
is taken as the pivot value. The elements
[i,j]
are reordered, such that all elements before the pivot are
smaller and all elements after the pivot are equal or larger than the
pivot. The index of the pivot element is returned.
The permutation
array is permuted in the same way as the list.
Usually, this will be an array of indices, so that the partition
operation can be mirrored in another list: Suppose, we have a list of
keys and a lists (or several) of values. If we use
partitionSubList
to sort the keys, we want to reorder the values
in the same manner. We pass an indices array [0, 1, 2, ...] and use the
permutation of the indices to permute the values list.
i
- index of first element of the sublistj
- index of last element of the sublistvalues
- the listpermutation
- elements of this array are permuted in the same way as the
elements in the values listpublic static <T> void partitionSubList(ListIterator<T> i, ListIterator<T> j, int[] permutation, Comparator<? super T> compare)
j
is taken as the pivot value. The elements
[i,j]
are reordered, such that all elements before the pivot are
smaller and all elements after the pivot are equal or larger than the
pivot. The index of the pivot element is returned.
After the function returns, the iterator i
is on the pivot
element. That is, i.next()
gives the element after the
pivot.
The permutation
array is permuted in the same way as the list.
Usually, this will be an array of indices, so that the partition
operation can be mirrored in another list: Suppose, we have a list of
keys and a lists (or several) of values. If we use
partitionSubList
to sort the keys, we want to reorder the values
in the same manner. We pass an indices array [0, 1, 2, ...] and use the
permutation of the indices to permute the values list.
i
- iterator pointing before first element of the sublist, that
is, i.next()
gives you the first element.j
- iterator pointing behind the last element of the sublist, that
is, i.previous()
gives you the last element.permutation
- elements of this array are permuted in the same way as the
elements in the values listcompare
- ordering function on Tpublic static <T extends Comparable<T>> void partitionSubList(ListIterator<T> i, ListIterator<T> j, int[] permutation)
j
is taken as the pivot value. The elements
[i,j]
are reordered, such that all elements before the pivot are
smaller, and all elements after the pivot are equal or larger than the
pivot. The index of the pivot element is returned.
After the function returns, the iterator i
is on the pivot
element. That is, i.next()
gives the element after the
pivot.
i
- iterator pointing before first element of the sublist, that
is, i.next()
gives you the first element.j
- iterator pointing behind the last element of the sublist, that
is, i.previous()
gives you the last element.permutation
- elements of this array are permuted in the same way as the
elements in the values listCopyright © 2015–2022 ImgLib2. All rights reserved.