Package space.kscience.kmath.misc

Types

Link copied to clipboard
interface Feature<F : Feature<F>>
Link copied to clipboard
interface Featured<F : Any>

A entity that contains a set of features defined by their types

Link copied to clipboard
typealias FeatureKey<T> = KClass<out T>
Link copied to clipboard
value class FeatureSet<F : Feature<F>> : Featured<F>

A container for a set of features

Link copied to clipboard
fun interface Loggable
Link copied to clipboard
annotation class PerformancePitfall(message: String)

Marks API that could cause performance problems. The code marked by this API is unnecessary slow but could cause slow-down in some cases. Refer to the documentation and benchmark it to be sure.

Link copied to clipboard
annotation class UnstableKMathAPI

Marks declarations that are still experimental in the KMath APIs, which means that the design of the corresponding declarations has open issues that may (or may not) lead to their changes in the future. Roughly speaking, there is a chance of those declarations will be deprecated in the near future or the semantics of their behavior may change in some way that may break some code.

Functions

Link copied to clipboard
inline fun <T, R> Iterable<T>.cumulative(initial: R, crossinline operation: (R, T) -> R): Iterable<R>
inline fun <T, R> List<T>.cumulative(initial: R, crossinline operation: (R, T) -> R): List<R>
inline fun <T, R> Sequence<T>.cumulative(initial: R, crossinline operation: (R, T) -> R): Sequence<R>

inline fun <T, R> Iterator<T>.cumulative(initial: R, crossinline operation: (R, T) -> R): Iterator<R>

Generic cumulative operation on iterator.

Link copied to clipboard
@JvmName(name = "cumulativeSumOfDouble")
fun Iterable<Double>.cumulativeSum(): Iterable<Double>
@JvmName(name = "cumulativeSumOfInt")
fun Iterable<Int>.cumulativeSum(): Iterable<Int>
@JvmName(name = "cumulativeSumOfLong")
fun Iterable<Long>.cumulativeSum(): Iterable<Long>
@JvmName(name = "cumulativeSumOfDouble")
fun List<Double>.cumulativeSum(): List<Double>
@JvmName(name = "cumulativeSumOfInt")
fun List<Int>.cumulativeSum(): List<Int>
@JvmName(name = "cumulativeSumOfLong")
fun List<Long>.cumulativeSum(): List<Long>
@JvmName(name = "cumulativeSumOfDouble")
fun Sequence<Double>.cumulativeSum(): Sequence<Double>
@JvmName(name = "cumulativeSumOfInt")
fun Sequence<Int>.cumulativeSum(): Sequence<Int>
@JvmName(name = "cumulativeSumOfLong")
fun Sequence<Long>.cumulativeSum(): Sequence<Long>
fun <T> List<T>.cumulativeSum(group: Ring<T>): List<T>
fun <T> Sequence<T>.cumulativeSum(group: Ring<T>): Sequence<T>

fun <T> Iterable<T>.cumulativeSum(group: Ring<T>): Iterable<T>

Cumulative sum with custom space

Link copied to clipboard
fun <V : Comparable<V>> Buffer<V>.indicesSorted(): IntArray

Return a new array filled with buffer indices. Indices order is defined by sorting associated buffer value. This feature allows sorting buffer values without reordering its content.

Link copied to clipboard
fun <V, C : Comparable<C>> Buffer<V>.indicesSortedBy(selector: (V) -> C): IntArray
Link copied to clipboard
fun <V, C : Comparable<C>> Buffer<V>.indicesSortedByDescending(selector: (V) -> C): IntArray
Link copied to clipboard
fun <V : Comparable<V>> Buffer<V>.indicesSortedDescending(): IntArray
Link copied to clipboard
fun <V> Buffer<V>.indicesSortedWith(comparator: Comparator<V>): IntArray
Link copied to clipboard
fun Loggable.log(block: () -> String)
Link copied to clipboard
fun <T : Comparable<T>> Buffer<T>.requireSorted()

Checks that the Buffer is sorted (ascending) and throws IllegalArgumentException if it is not.

Link copied to clipboard
fun <V : Comparable<V>> Buffer<V>.sorted(): Buffer<V>

Create a zero-copy virtual buffer that contains the same elements but in ascending order

Link copied to clipboard
fun <V, C : Comparable<C>> Buffer<V>.sortedBy(selector: (V) -> C): Buffer<V>
Link copied to clipboard
fun <V, C : Comparable<C>> Buffer<V>.sortedByDescending(selector: (V) -> C): Buffer<V>
Link copied to clipboard
fun <V : Comparable<V>> Buffer<V>.sortedDescending(): Buffer<V>

Create a zero-copy virtual buffer that contains the same elements but in descending order

Link copied to clipboard
expect fun Long.toIntExact(): Int
actual fun Long.toIntExact(): Int
actual fun Long.toIntExact(): Int
actual fun Long.toIntExact(): Int