@saehrimnir/druidjs / quickselectByAxis
Function: quickselectByAxis()
ts
function quickselectByAxis<T>(
arr: T[],
randomizer: Randomizer,
k: number,
axis: number,
start_left?: number,
start_right?: number): T;Defined in: util/quickselect.js:87
QuickSelect by specific dimension axis for spatial trees (KDTree, BallTree). Partitions array in-place along arr[i].element[axis].
Type Parameters
| Type Parameter | Description |
|---|---|
T extends { element: number[] | Float64Array<ArrayBufferLike>; } |
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
arr | T[] | undefined | Array to partition in-place |
randomizer | Randomizer | undefined | Seeded source of randomness for pivot selection. |
k | number | undefined | Target 0-indexed rank to select |
axis | number | undefined | Dimension coordinate index |
start_left? | number | 0 | Start index (inclusive) |
start_right? | number | ... | End index (inclusive) |
Returns
T
The k-th element along specified axis