ComposableStatistic

interface ComposableStatistic<in T, I, out R> : Statistic<T, R>

A statistic tha could be computed separately on different blocks of data and then composed

Parameters

T

the source type.

I

the intermediate block type.

R

the result type.

Functions

Link copied to clipboard
abstract suspend fun composeIntermediate(first: I, second: I): I
Link copied to clipboard
abstract suspend fun computeIntermediate(data: Buffer<T>): I
Link copied to clipboard
open suspend override fun evaluate(data: Buffer<T>): R
Link copied to clipboard
abstract suspend fun toResult(intermediate: I): R

Inheritors

Link copied to clipboard

Extensions

Link copied to clipboard
fun <T, I, R> ComposableStatistic<T, I, R>.flow(flow: Flow<Buffer<T>>, dispatcher: CoroutineDispatcher = Dispatchers.Default): Flow<R>

Perform a streaming statistical analysis on a chunked data. The computation of inner representation is done in parallel if dispatcher allows it.

Sources

Link copied to clipboard