Mean

class Mean<T>(group: Ring<T>, division: (sum: T, count: Int) -> T) : ComposableStatistic<T, Pair<T, Int>, T> , BlockingStatistic<T, T> (source)

Arithmetic mean

Constructors

Link copied to clipboard
constructor(group: Ring<T>, division: (sum: T, count: Int) -> T)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
open suspend override fun composeIntermediate(first: Pair<T, Int>, second: Pair<T, Int>): Pair<T, Int>
Link copied to clipboard
open suspend override fun computeIntermediate(data: Buffer<T>): Pair<T, Int>
Link copied to clipboard
open suspend override fun evaluate(data: Buffer<T>): T
Link copied to clipboard
open override fun evaluateBlocking(data: Buffer<T>): T
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
operator fun <T, R> BlockingStatistic<T, R>.invoke(data: Buffer<T>): R
suspend operator fun <T, R> Statistic<T, R>.invoke(data: Buffer<T>): R
Link copied to clipboard
open suspend override fun toResult(intermediate: Pair<T, Int>): T