Package-level declarations

Types

Link copied to clipboard

A function that takes two arguments of different types and returns a value of the first type.

Link copied to clipboard

A function that takes three arguments of different types and returns a value of the first type.

Link copied to clipboard
typealias BiPredicate<X, Y> = (X, Y) -> Boolean

A function that takes two arguments and returns a boolean value.

Link copied to clipboard

A ReductionType that excludes the local value from the reduction.

Link copied to clipboard

A ReductionType that includes the local value in the reduction.

Link copied to clipboard
@Serializable
value class Maybe<out T>

A Serializable wrapper for Option to allow serialization of optional values.

Link copied to clipboard
@Serializable
value class Point2D(val coordinates: Pair<Double, Double>)

A 2D point represented as a pair of x and y.

Link copied to clipboard
@Serializable
value class Point3D(coordinates: Triple<Double, Double, Double>)

A 3D point represented as a triple of x, y, and z.

Link copied to clipboard
typealias Reducer<T> = Accumulator<T, T>

A function that takes two arguments of the same type and returns a value of the same type.

Link copied to clipboard
sealed interface ReductionType

A marker interface representing whether the local value should be included in a reduction.

Functions

Link copied to clipboard
fun <T : Comparable<T>> T.coerceIn(range: ClosedRange<T>): T

Coerce this value in a range.

fun <ID : Any, T : Comparable<T>> Field<ID, T>.coerceIn(range: ClosedRange<T>): Field<ID, T>

Coerces all field values in a range.

fun <T : Comparable<T>> T.coerceIn(min: T, max: T): T

Coerce this value to be in the range between min and max.

fun <ID : Any, T : Comparable<T>> Field<ID, T>.coerceIn(min: T, max: T): Field<ID, T>

Coerce all field values to be in the range between min and max.

Link copied to clipboard
fun <ID : Any> Aggregate<ID>.euclideanDistance2D(localPosition: Point2D): Field<ID, Double>
inline fun <ID : Any> Aggregate<ID>.euclideanDistance2D(crossinline extractPosition: (ID) -> Point2D): Field<ID, Double>
fun <ID : Any> Aggregate<ID>.euclideanDistance2D(localPosition: Pair<Double, Double>): Field<ID, Double>

Returns a field containing the Euclidean distance from the local node to each neighbor.

Link copied to clipboard
fun <ID : Any> Aggregate<ID>.euclideanDistance3D(localPosition: Point3D): Field<ID, Double>
inline fun <ID : Any> Aggregate<ID>.euclideanDistance3D(crossinline extractPosition: (ID) -> Point3D): Field<ID, Double>
fun <ID : Any> Aggregate<ID>.euclideanDistance3D(localPosition: Triple<Double, Double, Double>): Field<ID, Double>

Returns a field containing the Euclidean distance from the local node to each neighbor.

Link copied to clipboard
fun <ID : Any> Aggregate<ID>.hops(): Field<ID, Int>

Returns a field containing 1 for each aligned neighbor.

Link copied to clipboard
inline fun <ID : Any, T, R> ReductionType.init(field: Field<ID, T>, default: R, crossinline self: (FieldEntry<ID, T>) -> R): R

Computes the initial value for a reduction using a FieldEntry, based on whether the local value is included.

inline fun <ID : Any, T, R> ReductionType.init(field: Field<ID, T>, default: R, crossinline self: (ID, T) -> R): R

Computes the initial value for a reduction, depending on whether the local value is included.

Link copied to clipboard
fun <R> ReductionType.initTo(default: R, self: R): R

Selects the initial value for a reduction based on whether the local value is included.

Link copied to clipboard

Sums this positive Int with another, and returns the result only if the result is positive. Otherwise, the function assumes that the sum has overflowed and returns Int.MAX_VALUE.