|
template<domain D, type T> |
D T | selectK (D T[[1]] vector, uint k) |
|
Function for selecting the k smallest elements of a vector.
- Note
- D - all protection domains
-
Supported types - uint8 / uint16 / uint32 / uint / int8 / int16 / int32 / int / xor_uint8 / xor_uint16 / xor_uint32 / xor_uint64
-
Requires that the input array's length is a power of two.
-
The algorithm behind this function is optimized for speed, accuracy is not guaranteed.
- Parameters
-
vector | - a vector of supported type |
k | - the number of elements to be selected |
- Returns
- returns a vector of k elements selected from the input vector
◆ selectK()
D T selectK |
( |
D T[[1]] |
vector, |
|
|
uint |
k |
|
) |
| |