Package-level declarations

Functions

Link copied to clipboard
fun Double.equalsDelta(other: Double, delta: Double = EQUALS_DELTA): Boolean

Performs comparisons between real numbers using delta parameter

Link copied to clipboard
fun <T : Comparable<T>> Array<T>.findOrderStatistic(k: Int, from: Int, to: Int, ascending: Boolean): T

Executes K-th order statistic. Average O(N). Swap elements in array. At the end, the K-th element will be under index k.

Link copied to clipboard
inline fun <T> Array<out T>.forEach(start: Int, end: Int = this.size, action: (T) -> Unit)

For each implementation with start and end.

Link copied to clipboard
inline fun <T> Array<out T>.forEachIndexed(start: Int, end: Int = this.size, action: (index: Int, T) -> Unit)

For each indexed implementation with start and end.

Link copied to clipboard
inline fun <T> Array<T>.forEachReverse(from: Int = lastIndex, to: Int = 0, action: (T) -> Unit)

For each reversed implementation with from and to.

Link copied to clipboard
inline fun <T> Array<T>.forEachReverseIndexed(from: Int = lastIndex, to: Int = 0, action: (T, index: Int) -> Unit)
inline fun IntArray.forEachReverseIndexed(from: Int = lastIndex, to: Int = 0, action: (Int, index: Int) -> Unit)

For each reversed indexed implementation with from and to.

Link copied to clipboard
fun indicesByRandom(count: Int, size: Int, random: Random): IntArray

Creates IntArray with random indices

Link copied to clipboard

Creates IntArray with random indices

Link copied to clipboard
inline fun IntArray.inUntil(elem: Int, subSize: Int): Boolean

Checks if an element is included in an array

Link copied to clipboard
infix fun Double.lessOrEquals(other: Double): Boolean

Performs comparisons between real numbers using equalsDelta

Link copied to clipboard
inline fun loop(start: Int, end: Int, action: (index: Int) -> Unit)

Implementation standard loop: for(int i = start; i <end; i++)

inline fun loop(start: Int, end: Int, step: Int, action: (index: Int) -> Unit)

Implementation standard loop: for(int i = start; i <end; i += step)

Link copied to clipboard
fun main()
Link copied to clipboard
infix fun Double.moreOrEquals(other: Double): Boolean

Performs comparisons between real numbers using equalsDelta

Link copied to clipboard
fun Random.nextGaussian(mean: Double, stddev: Double): Double

Next Gaussian realization

Link copied to clipboard
fun <T : Comparable<T>> Array<T>.partitionAscending(start: Int, end: Int): Int

Executes splits array with standard partition (that used in quicksort) in ascending order

Link copied to clipboard
fun <T : Comparable<T>> Array<T>.partitionDescending(start: Int, end: Int): Int

Executes splits array with standard partition (that used in quicksort) in descending order

Link copied to clipboard
inline fun <T> Array<out T>.random(count: Int, random: Random): Array<T>

Creates Array with random elements from source array

Link copied to clipboard
fun randomByChance(chance: Double, random: Random): Boolean

Returns true with probability chance (0.0 < 1.0)

inline fun randomByChance(chance: Double, random: Random, action: () -> Unit)

Execute action with probability chance (0.0 < 1.0)

Link copied to clipboard
inline fun EvolveScope<*, *>.randomByChance(chance: Double, action: () -> Unit)

Execute action with probability chance (0.0 < 1.0)

Link copied to clipboard
inline fun <V, F> Population<V, F>.randomWithIndices(count: Int, random: Random): Pair<Array<Chromosome<V, F>>, IntArray>

Creates Array with randomly selected chromosomes from source array

Link copied to clipboard
inline fun <T> Array<T>.swap(first: Int, second: Int)

Executes swap between two indices.