public class KthElement extends Object
Constructor and Description |
---|
KthElement() |
Modifier and Type | Method and Description |
---|---|
static void |
kthElement(int k,
byte[] values)
Partition an array of
values such that the k-th smallest value is
at position k , elements before the k-th are smaller or equal and
elements after the k-th are larger or equal. |
static void |
kthElement(int k,
char[] values)
Partition an array of
values such that the k-th smallest value is
at position k , elements before the k-th are smaller or equal and
elements after the k-th are larger or equal. |
static void |
kthElement(int k,
double[] values)
Partition an array of
values such that the k-th smallest value is
at position k , elements before the k-th are smaller or equal and
elements after the k-th are larger or equal. |
static void |
kthElement(int k,
float[] values)
Partition an array of
values such that the k-th smallest value is
at position k , elements before the k-th are smaller or equal and
elements after the k-th are larger or equal. |
static void |
kthElement(int k,
int[] values)
Partition an array of
values such that the k-th smallest value is
at position k , elements before the k-th are smaller or equal and
elements after the k-th are larger or equal. |
static void |
kthElement(int i,
int j,
int k,
byte[] values)
Partition a subarray of
values such that the k-th smallest value
is at position k , elements before the k-th are smaller or equal
and elements after the k-th are larger or equal. |
static void |
kthElement(int i,
int j,
int k,
char[] values)
Partition a subarray of
values such that the k-th smallest value
is at position k , elements before the k-th are smaller or equal
and elements after the k-th are larger or equal. |
static void |
kthElement(int i,
int j,
int k,
double[] values)
Partition a subarray of
values such that the k-th smallest value
is at position k , elements before the k-th are smaller or equal
and elements after the k-th are larger or equal. |
static void |
kthElement(int i,
int j,
int k,
float[] values)
Partition a subarray of
values such that the k-th smallest value
is at position k , elements before the k-th are smaller or equal
and elements after the k-th are larger or equal. |
static void |
kthElement(int i,
int j,
int k,
int[] values)
Partition a subarray of
values such that the k-th smallest value
is at position k , elements before the k-th are smaller or equal
and elements after the k-th are larger or equal. |
static <T extends Comparable<T>> |
kthElement(int i,
int j,
int k,
List<T> values)
Partition a sublist of
values such that the k-th smallest value
is at position k , elements before the k-th are smaller or equal
and elements after the k-th are larger or equal. |
static <T> void |
kthElement(int i,
int j,
int k,
List<T> values,
Comparator<? super T> comparator)
Partition a sublist of
values such that the k-th smallest value
is at position k , elements before the k-th are smaller or equal
and elements after the k-th are larger or equal. |
static <T extends Comparable<T>> |
kthElement(int i,
int j,
int k,
List<T> values,
int[] permutation)
Partition a sublist of
values such that the k-th smallest value
is at position k , elements before the k-th are smaller or equal
and elements after the k-th are larger or equal. |
static <T> void |
kthElement(int i,
int j,
int k,
List<T> values,
int[] permutation,
Comparator<? super T> comparator)
Partition a sublist of
values such that the k-th smallest value
is at position k , elements before the k-th are smaller or equal
and elements after the k-th are larger or equal. |
static void |
kthElement(int i,
int j,
int k,
long[] values)
Partition a subarray of
values such that the k-th smallest value
is at position k , elements before the k-th are smaller or equal
and elements after the k-th are larger or equal. |
static void |
kthElement(int i,
int j,
int k,
short[] values)
Partition a subarray of
values such that the k-th smallest value
is at position k , elements before the k-th are smaller or equal
and elements after the k-th are larger or equal. |
static <T extends Comparable<T>> |
kthElement(int k,
List<T> values)
Partition a list of
values such that the k-th smallest value is
at position k , elements before the k-th are smaller or equal and
elements after the k-th are larger or equal. |
static <T> void |
kthElement(int k,
List<T> values,
Comparator<? super T> comparator)
Partition a list of
values such that the k-th smallest value is
at position k , elements before the k-th are smaller or equal and
elements after the k-th are larger or equal. |
static <T extends Comparable<T>> |
kthElement(int k,
List<T> values,
int[] permutation)
Partition a list of
values such that the k-th smallest value is
at position k , elements before the k-th are smaller or equal and
elements after the k-th are larger or equal. |
static <T> void |
kthElement(int k,
List<T> values,
int[] permutation,
Comparator<? super T> comparator)
Partition a list of
values such that the k-th smallest value is
at position k , elements before the k-th are smaller or equal and
elements after the k-th are larger or equal. |
static void |
kthElement(int k,
long[] values)
Partition an array of
values such that the k-th smallest value is
at position k , elements before the k-th are smaller or equal and
elements after the k-th are larger or equal. |
static void |
kthElement(int k,
short[] values)
Partition an array of
values such that the k-th smallest value is
at position k , elements before the k-th are smaller or equal and
elements after the k-th are larger or equal. |
static <T extends Comparable<T>> |
kthElement(ListIterator<T> i,
ListIterator<T> j,
int k)
Partition a sublist such that the k-th smallest value is at position
k , elements before the k-th are smaller or equal, and elements
after the k-th are larger or equal. |
static <T> void |
kthElement(ListIterator<T> i,
ListIterator<T> j,
int k,
Comparator<? super T> comparator)
Partition a sublist such that the k-th smallest value is at position
k , elements before the k-th are smaller or equal, and elements
after the k-th are larger or equal. |
static <T extends Comparable<T>> |
kthElement(ListIterator<T> i,
ListIterator<T> j,
int k,
int[] permutation)
Partition a sublist such that the k-th smallest value is at position
k , elements before the k-th are smaller or equal, and elements
after the k-th are larger or equal. |
static <T> void |
kthElement(ListIterator<T> i,
ListIterator<T> j,
int k,
int[] permutation,
Comparator<? super T> comparator)
Partition a sublist such that the k-th smallest value is at position
k , elements before the k-th are smaller or equal, and elements
after the k-th are larger or equal. |
public static void kthElement(int i, int j, int k, byte[] values)
values
such that the k-th smallest value
is at position k
, elements before the k-th are smaller or equal
and elements after the k-th are larger or equal.i
- index of first element of subarrayj
- index of last element of subarrayk
- index for k-th smallest value. i <= k <= j
.values
- arraypublic static void kthElement(int k, byte[] values)
values
such that the k-th smallest value is
at position k
, elements before the k-th are smaller or equal and
elements after the k-th are larger or equal.k
- index for k-th smallest value. 0 <= k < values.length
.values
- arraypublic static void kthElement(int i, int j, int k, short[] values)
values
such that the k-th smallest value
is at position k
, elements before the k-th are smaller or equal
and elements after the k-th are larger or equal.i
- index of first element of subarrayj
- index of last element of subarrayk
- index for k-th smallest value. i <= k <= j
.values
- arraypublic static void kthElement(int k, short[] values)
values
such that the k-th smallest value is
at position k
, elements before the k-th are smaller or equal and
elements after the k-th are larger or equal.k
- index for k-th smallest value. 0 <= k < values.length
.values
- arraypublic static void kthElement(int i, int j, int k, int[] values)
values
such that the k-th smallest value
is at position k
, elements before the k-th are smaller or equal
and elements after the k-th are larger or equal.i
- index of first element of subarrayj
- index of last element of subarrayk
- index for k-th smallest value. i <= k <= j
.values
- arraypublic static void kthElement(int k, int[] values)
values
such that the k-th smallest value is
at position k
, elements before the k-th are smaller or equal and
elements after the k-th are larger or equal.k
- index for k-th smallest value. 0 <= k < values.length
.values
- arraypublic static void kthElement(int i, int j, int k, long[] values)
values
such that the k-th smallest value
is at position k
, elements before the k-th are smaller or equal
and elements after the k-th are larger or equal.i
- index of first element of subarrayj
- index of last element of subarrayk
- index for k-th smallest value. i <= k <= j
.values
- arraypublic static void kthElement(int k, long[] values)
values
such that the k-th smallest value is
at position k
, elements before the k-th are smaller or equal and
elements after the k-th are larger or equal.k
- index for k-th smallest value. 0 <= k < values.length
.values
- arraypublic static void kthElement(int i, int j, int k, float[] values)
values
such that the k-th smallest value
is at position k
, elements before the k-th are smaller or equal
and elements after the k-th are larger or equal.i
- index of first element of subarrayj
- index of last element of subarrayk
- index for k-th smallest value. i <= k <= j
.values
- arraypublic static void kthElement(int k, float[] values)
values
such that the k-th smallest value is
at position k
, elements before the k-th are smaller or equal and
elements after the k-th are larger or equal.k
- index for k-th smallest value. 0 <= k < values.length
.values
- arraypublic static void kthElement(int i, int j, int k, double[] values)
values
such that the k-th smallest value
is at position k
, elements before the k-th are smaller or equal
and elements after the k-th are larger or equal.i
- index of first element of subarrayj
- index of last element of subarrayk
- index for k-th smallest value. i <= k <= j
.values
- arraypublic static void kthElement(int k, double[] values)
values
such that the k-th smallest value is
at position k
, elements before the k-th are smaller or equal and
elements after the k-th are larger or equal.k
- index for k-th smallest value. 0 <= k < values.length
.values
- arraypublic static void kthElement(int i, int j, int k, char[] values)
values
such that the k-th smallest value
is at position k
, elements before the k-th are smaller or equal
and elements after the k-th are larger or equal.i
- index of first element of subarrayj
- index of last element of subarrayk
- index for k-th smallest value. i <= k <= j
.values
- arraypublic static void kthElement(int k, char[] values)
values
such that the k-th smallest value is
at position k
, elements before the k-th are smaller or equal and
elements after the k-th are larger or equal.k
- index for k-th smallest value. 0 <= k < values.length
.values
- arraypublic static <T> void kthElement(int i, int j, int k, List<T> values, Comparator<? super T> comparator)
values
such that the k-th smallest value
is at position k
, elements before the k-th are smaller or equal
and elements after the k-th are larger or equal.i
- index of first element of subarrayj
- index of last element of subarrayk
- index for k-th smallest value. i <= k <= j
.values
- arraycomparator
- ordering function on Tpublic static <T> void kthElement(int k, List<T> values, Comparator<? super T> comparator)
values
such that the k-th smallest value is
at position k
, elements before the k-th are smaller or equal and
elements after the k-th are larger or equal.k
- index for k-th smallest value. 0 <= k < values.size()
.values
- arraycomparator
- ordering function on Tpublic static <T extends Comparable<T>> void kthElement(int i, int j, int k, List<T> values)
values
such that the k-th smallest value
is at position k
, elements before the k-th are smaller or equal
and elements after the k-th are larger or equal.i
- index of first element of subarrayj
- index of last element of subarrayk
- index for k-th smallest value. i <= k <= j
.values
- arraypublic static <T extends Comparable<T>> void kthElement(int k, List<T> values)
values
such that the k-th smallest value is
at position k
, elements before the k-th are smaller or equal and
elements after the k-th are larger or equal.k
- index for k-th smallest value. 0 <= k < values.size()
.values
- arraypublic static <T> void kthElement(ListIterator<T> i, ListIterator<T> j, int k, Comparator<? super T> comparator)
k
, elements before the k-th are smaller or equal, and elements
after the k-th are larger or equal.
After the function returns, the iterator i
is on the k-th
element. That is, i.next()
gives the (k+1)-th element.
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.k
- index for k-th smallest value.
i.nextIndex() <= k <= j.previousIndex()
.comparator
- ordering function on Tpublic static <T extends Comparable<T>> void kthElement(ListIterator<T> i, ListIterator<T> j, int k)
k
, elements before the k-th are smaller or equal, and elements
after the k-th are larger or equal.
After the function returns, the iterator i
is on the k-th
element. That is, i.next()
gives the (k+1)-th element.
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.k
- index for k-th smallest value. i.nextIndex() <= k <=
j.previousIndex()
.public static <T> void kthElement(int i, int j, int k, List<T> values, int[] permutation, Comparator<? super T> comparator)
values
such that the k-th smallest value
is at position k
, elements before the k-th are smaller or equal
and elements after the k-th are larger or equal.
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 kthElement
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 subarrayj
- index of last element of subarrayk
- index for k-th smallest value. i <= k <= j
.values
- arraypermutation
- elements of this array are permuted in the same way as the
elements in the values listcomparator
- ordering function on Tpublic static <T> void kthElement(int k, List<T> values, int[] permutation, Comparator<? super T> comparator)
values
such that the k-th smallest value is
at position k
, elements before the k-th are smaller or equal and
elements after the k-th are larger or equal.
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 kthElement
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.
k
- index for k-th smallest value. 0 <= k < values.size()
.values
- arraypermutation
- elements of this array are permuted in the same way as the
elements in the values listcomparator
- ordering function on Tpublic static <T extends Comparable<T>> void kthElement(int i, int j, int k, List<T> values, int[] permutation)
values
such that the k-th smallest value
is at position k
, elements before the k-th are smaller or equal
and elements after the k-th are larger or equal.
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 kthElement
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 subarrayj
- index of last element of subarrayk
- index for k-th smallest value. i <= k <= j
.values
- arraypermutation
- elements of this array are permuted in the same way as the
elements in the values listpublic static <T extends Comparable<T>> void kthElement(int k, List<T> values, int[] permutation)
values
such that the k-th smallest value is
at position k
, elements before the k-th are smaller or equal and
elements after the k-th are larger or equal.
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 kthElement
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.
k
- index for k-th smallest value. 0 <= k < values.size()
.values
- arraypermutation
- elements of this array are permuted in the same way as the
elements in the values listpublic static <T> void kthElement(ListIterator<T> i, ListIterator<T> j, int k, int[] permutation, Comparator<? super T> comparator)
k
, elements before the k-th are smaller or equal, and elements
after the k-th are larger or equal.
After the function returns, the iterator i
is on the k-th
element. That is, i.next()
gives the (k+1)-th element.
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 kthElement
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.k
- index for k-th smallest value. i.nextIndex() <= k <=
j.previousIndex()
.permutation
- elements of this array are permuted in the same way as the
elements in the values listcomparator
- ordering function on Tpublic static <T extends Comparable<T>> void kthElement(ListIterator<T> i, ListIterator<T> j, int k, int[] permutation)
k
, elements before the k-th are smaller or equal, and elements
after the k-th are larger or equal.
After the function returns, the iterator i
is on the k-th
element. That is, i.next()
gives the (k+1)-th element.
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 kthElement
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.k
- index for k-th smallest value. i.nextIndex() <= k <=
j.previousIndex()
.permutation
- elements of this array are permuted in the same way as the
elements in the values listCopyright © 2015–2022 ImgLib2. All rights reserved.