ComposableStatistic

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

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.

Inheritors

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
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.

Link copied to clipboard
suspend operator fun <T, R> Statistic<T, R>.invoke(data: Buffer<T>): R
Link copied to clipboard
abstract suspend fun toResult(intermediate: I): R