Labels elements based on membership in the specified bins.
A bin i
is defined by left_edges[i], right_edges[i]
. Whether the edges are inclusive or not is determined by left_inclusive
and right_inclusive
, respectively.
A value input[j]
belongs to bin i
if value[j]
is contained in the range left_edges[i], right_edges[i]
(with the specified inclusiveness) and label[j] == i
. If input[j]
does not belong to any bin, then label[j]
is NULL.
Notes:
- If an empty set of edges is provided, all elements in
input
are labeled NULL.
- NULL elements in
input
belong to no bin and their corresponding label is NULL.
- NaN elements in
input
belong to no bin and their corresponding label is NULL.
- Bins must be provided in monotonically increasing order, otherwise behavior is undefined.
- If two or more bins overlap, behavior is undefined.
- Exceptions
-
- Parameters
-
input | The input elements to label according to the specified bins. |
left_edges | Values of the left edge of each bin. |
left_inclusive | Whether or not the left edge is inclusive. |
right_edges | Value of the right edge of each bin. |
right_inclusive | Whether or not the right edge is inclusive. |
stream | CUDA stream used for device memory operations and kernel launches |
mr | Device memory resource used to allocate the returned column's device. |
- Returns
- The integer labels of the elements in
input
according to the specified bins.