Package-level declarations

Types

Link copied to clipboard
class KDTreeNode<T>(val dimensions: Int, val mapper: (T, Int) -> Double)

Represents a node in a KD-Tree, a data structure for organizing points in a k-dimensional space.

Functions

Link copied to clipboard
expect fun <T> buildKDTree(items: MutableList<T>, dimensions: Int, mapper: (T, Int) -> Double): KDTreeNode<T>

Builds a KD-Tree from a mutable list of items, using a mapper function to extract coordinate values for the specified dimensions.

actual fun <T> buildKDTree(items: MutableList<T>, dimensions: Int, mapper: (T, Int) -> Double): KDTreeNode<T>
actual fun <T> buildKDTree(items: MutableList<T>, dimensions: Int, mapper: (T, Int) -> Double): KDTreeNode<T>
Link copied to clipboard
Link copied to clipboard
fun intVector2Mapper(v: IntVector2, dimension: Int): Double

Maps the specified dimension of an IntVector2 to a Double.

Link copied to clipboard
@JvmName(name = "kdTreeVector2")
fun Iterable<Vector2>.kdTree(): KDTreeNode<Vector2>

Constructs a KD-Tree for a collection of 2D vectors.

@JvmName(name = "kdTreeVector3")
fun Iterable<Vector3>.kdTree(): KDTreeNode<Vector3>

Constructs a KD-Tree from an iterable collection of 3-dimensional Vector3 objects.

@JvmName(name = "kdTreeVector4")
fun Iterable<Vector4>.kdTree(): KDTreeNode<Vector4>

Constructs a KD-Tree from the iterable collection of 4-dimensional vectors.

Link copied to clipboard
fun <T> selectNth(items: MutableList<T>, n: Int, mapper: (T) -> Double): T

Selects the nth element from the given list after partially sorting it based on a mapping function.

Link copied to clipboard
fun vector2Mapper(v: Vector2, dimension: Int): Double

Maps a 2D vector's dimension to its corresponding value.

Link copied to clipboard
fun vector3Mapper(v: Vector3, dimension: Int): Double

Maps a Vector3 object to one of its components (x, y, or z) based on the specified dimension.

Link copied to clipboard
fun vector4Mapper(v: Vector4, dimension: Int): Double

Maps the components of a 4-dimensional vector based on the specified dimension index.