Package-level declarations

Types

Link copied to clipboard
Link copied to clipboard
class SweepQueue<T>

SweepQueue is a data structure designed to manage and process events in a sweep line algorithm.

Properties

Link copied to clipboard
const val EXP_BIAS: Int = 1023
Link copied to clipboard
const val EXP_BIT_MASK: Long = 9218868437227405312
Link copied to clipboard
Link copied to clipboard
const val MAX_EXPONENT: Int = 1023
Link copied to clipboard
Link copied to clipboard
const val MIN_EXPONENT: Int
Link copied to clipboard
const val SCALAR_EPSILON: Double = 1.0E-14
Link copied to clipboard
const val SIGNIFICAND_WIDTH: Int = 53

Functions

Link copied to clipboard
fun angleEquals(t0: Double, t1: Double, epsilon: Double): Boolean
Link copied to clipboard
fun clamp(min: Double, n: Double, max: Double): Double
Link copied to clipboard
fun <V> combinations(paths: List<List<V>>): List<List<V>>

Given a list of potential values at each index in a list, returns all possible combinations of those values.

Link copied to clipboard
fun equals(a: Double, b: Double, epsilon: Double): Boolean
Link copied to clipboard
Link copied to clipboard
fun inside(min: Double, n: Double, max: Double): Boolean
Link copied to clipboard
fun lerp(a: Double, b: Double, t: Double): Double
Link copied to clipboard
fun max(a: Double, b: Double): Double
fun max(a: Double, b: Double, c: Double): Double
Link copied to clipboard
fun min(a: Double, b: Double): Double
fun min(a: Double, b: Double, c: Double): Double
Link copied to clipboard

Calculates a normalization factor based on the maximum value between two given numbers and the exponent of that maximum value. The normalization factor ensures that values within a certain range are normalized appropriately.

Calculates a normalization factor based on the maximum value among the input parameters and their exponent. It ensures the result lies within a reasonable range for numerical stability.

Computes a normalization factor for a given set of four double values. The normalization ensures values are scaled properly based on their maximum magnitude.

Link copied to clipboard
Link copied to clipboard
inline fun <V> permutations(values: List<V>): List<List<V>>

Generates permutations of the given list of values. If the size of the list exceeds a certain limit, it returns a fixed number of randomly shuffled permutations. Otherwise, it calculates all possible permutations.

Link copied to clipboard
Link copied to clipboard

Solves a cubic equation of the form ax^3 + bx^2 + cx + d = 0 and returns its real roots.

fun solveCubic(a: Double, b: Double, c: Double, d: Double, acc: DoubleArray): Int
Link copied to clipboard

Solves a linear equation of the form ax + b = 0 and returns the solution(s) as an array of doubles.

Solves a linear equation of the form ax + b = 0 and stores the solution in the provided array.

Link copied to clipboard
Link copied to clipboard
@JvmName(name = "kartifexHackSort2")
fun <T> sort(a: Array<T>, start: Int = 0, end: Int = a.size, selector: (T) -> Double)

Sorts a given array within a specified range based on a selector function that maps each element to a Double value.

Link copied to clipboard
@JvmName(name = "kartifexHackSort1")
fun <T> Array<T>.sort(start: Int = 0, end: Int = size, selector: (T) -> Double)
Link copied to clipboard
fun <V> swap(ary: Array<V>, i: Int, j: Int)

Swaps the elements at two specified indices in the given array.

Link copied to clipboard
fun ulp(d: Double): Double