Companion

object Companion

Functions

Link copied to clipboard
inline fun compute(count: Int, out: RLE = RLE(), filter: (value: Int) -> Boolean = { true }, gen: (index: Int) -> Int): RLE

Generates a new RLE or reuses out, from a sequence of count items, generated by the gen function. Emitted value can be filtered with the filter function.

inline fun compute(data: IntArray, start: Int = 0, end: Int = data.size, out: RLE = RLE()): RLE

Generates a RLE sequence based on the data in the segment start and end. When providing out, that RLE is reused.

Link copied to clipboard
inline fun emit(count: Int, emit: (n: Int, start: Int, count: Int, value: Int) -> Unit, gen: (index: Int) -> Int)

Processes a RLE sequence of count elements generated by the gen function, and calls emit function for every RLE segment