Package space.kscience.kmath.structures

Types

ArrayBuffer
Link copied to clipboard
common
class ArrayBuffer<T>(array: Array<T>) : MutableBuffer<T>
MutableBuffer implementation over Array.
Buffer
Link copied to clipboard
common
interface Buffer<out T>
A generic immutable random-access structure for both primitives and objects.
BufferFactory
Link copied to clipboard
common
typealias BufferFactory<T> = (Int, (Int) -> T) -> Buffer<T>

Function that produces Buffer from its size and function that supplies values.

BufferTransform
Link copied to clipboard
common
typealias BufferTransform<T, R> = (Buffer<T>) -> Buffer<R>

Typealias for buffer transformations.

FlaggedBuffer
Link copied to clipboard
common
interface FlaggedBuffer<T> : Buffer<T>
A buffer with flagged values.
FlaggedRealBuffer
Link copied to clipboard
common
class FlaggedRealBuffer(values: DoubleArray, flags: ByteArray) : FlaggedBuffer<Double?> , Buffer<Double?>
A real buffer which supports flags for each value like NaN or Missing
FloatBuffer
Link copied to clipboard
common
inline class FloatBuffer(array: FloatArray) : MutableBuffer<Float>
Specialized MutableBuffer implementation over FloatArray.
IntBuffer
Link copied to clipboard
common
inline class IntBuffer(array: IntArray) : MutableBuffer<Int>
Specialized MutableBuffer implementation over IntArray.
ListBuffer
Link copied to clipboard
common
inline class ListBuffer<T>(list: List<T>) : Buffer<T>
Buffer implementation over List.
LongBuffer
Link copied to clipboard
common
inline class LongBuffer(array: LongArray) : MutableBuffer<Long>
Specialized MutableBuffer implementation over LongArray.
MemoryBuffer
Link copied to clipboard
common
open class MemoryBuffer<T : Any>(memory: Memory, spec: MemorySpec<T>) : Buffer<T>
A non-boxing buffer over Memory object.
MutableBuffer
Link copied to clipboard
common
interface MutableBuffer<T> : Buffer<T>
A generic mutable random-access structure for both primitives and objects.
MutableBufferFactory
Link copied to clipboard
common
typealias MutableBufferFactory<T> = (Int, (Int) -> T) -> MutableBuffer<T>

Function that produces MutableBuffer from its size and function that supplies values.

MutableListBuffer
Link copied to clipboard
common
inline class MutableListBuffer<T>(list: MutableList<T>) : MutableBuffer<T>
MutableBuffer implementation over MutableList.
MutableMemoryBuffer
Link copied to clipboard
common
class MutableMemoryBuffer<T : Any>(memory: Memory, spec: MemorySpec<T>) : MemoryBuffer<T> , MutableBuffer<T>
A mutable non-boxing buffer over Memory object.
ReadOnlyBuffer
Link copied to clipboard
common
inline class ReadOnlyBuffer<T>(buffer: MutableBuffer<T>) : Buffer<T>
Immutable wrapper for MutableBuffer.
RealBuffer
Link copied to clipboard
common
inline class RealBuffer(array: DoubleArray) : MutableBuffer<Double>
Specialized MutableBuffer implementation over DoubleArray.
RealBufferField
Link copied to clipboard
common
class RealBufferField(size: Int) : ExtendedField<Buffer<Double>>
RealBufferFieldOperations
Link copied to clipboard
ShortBuffer
Link copied to clipboard
common
inline class ShortBuffer(array: ShortArray) : MutableBuffer<Short>
Specialized MutableBuffer implementation over ShortArray.
SuspendBufferTransform
Link copied to clipboard
common
typealias SuspendBufferTransform<T, R> = suspend (Buffer<T>) -> Buffer<R>

Typealias for buffer transformations with suspend function.

ValueFlag
Link copied to clipboard
common
enum ValueFlag : Enum<ValueFlag>
Represents flags to supply additional info about values of buffer.
VirtualBuffer
Link copied to clipboard
common
class VirtualBuffer<T>(size: Int, generator: (Int) -> T) : Buffer<T>
A buffer with content calculated on-demand.

Functions

ArrayBuffer
Link copied to clipboard
common
inline fun <T> ArrayBuffer(size: Int, init: (Int) -> T): ArrayBuffer<T>
Creates a new ArrayBuffer with the specified size, where each element is calculated by calling the specified init function.
asBuffer
Link copied to clipboard
common
fun <T> Array<T>.asBuffer(): ArrayBuffer<T>
Returns an ArrayBuffer that wraps the original array.
fun DoubleArray.asBuffer(): RealBuffer
Returns RealBuffer over this array.
fun FloatArray.asBuffer(): FloatBuffer
Returns FloatBuffer over this array.
fun IntArray.asBuffer(): IntBuffer
Returns IntBuffer over this array.
fun LongArray.asBuffer(): LongBuffer
Returns LongBuffer over this array.
fun ShortArray.asBuffer(): ShortBuffer
Returns ShortBuffer over this array.
fun <T> List<T>.asBuffer(): ListBuffer<T>
Returns an ListBuffer that wraps the original list.
asIterable
Link copied to clipboard
common
fun <T> Buffer<T>.asIterable(): Iterable<T>
Creates an iterable that returns all elements from this Buffer.
asReadOnly
Link copied to clipboard
common
fun <T> Buffer<T>.asReadOnly(): Buffer<T>
Convert this buffer to read-only buffer.
asSequence
Link copied to clipboard
common
fun <T> Buffer<T>.asSequence(): Sequence<T>
Creates a sequence that returns all elements from this Buffer.
contentEquals
Link copied to clipboard
common
fun RealBuffer.contentEquals(vararg doubles: Double): Boolean
Simplified RealBuffer to array comparison
FloatBuffer
Link copied to clipboard
common
fun FloatBuffer(vararg floats: Float): FloatBuffer
Returns a new FloatBuffer of given elements.
inline fun FloatBuffer(size: Int, init: (Int) -> Float): FloatBuffer
Creates a new FloatBuffer with the specified size, where each element is calculated by calling the specified init function.
forEachValid
Link copied to clipboard
common
inline fun FlaggedRealBuffer.forEachValid(block: (Double) -> Unit)
hasFlag
Link copied to clipboard
common
fun FlaggedBuffer<*>.hasFlag(index: Int, flag: ValueFlag): Boolean
IntBuffer
Link copied to clipboard
common
fun IntBuffer(vararg ints: Int): IntBuffer
Returns a new IntBuffer of given elements.
inline fun IntBuffer(size: Int, init: (Int) -> Int): IntBuffer
Creates a new IntBuffer with the specified size, where each element is calculated by calling the specified init function.
isMissing
Link copied to clipboard
common
fun FlaggedBuffer<*>.isMissing(index: Int): Boolean
isValid
Link copied to clipboard
common
fun FlaggedBuffer<*>.isValid(index: Int): Boolean
The value is valid if all flags are down
ListBuffer
Link copied to clipboard
common
inline fun <T> ListBuffer(size: Int, init: (Int) -> T): ListBuffer<T>
Creates a new ListBuffer with the specified size, where each element is calculated by calling the specified init function.
LongBuffer
Link copied to clipboard
common
fun LongBuffer(vararg longs: Long): LongBuffer
Returns a new LongBuffer of given elements.
inline fun LongBuffer(size: Int, init: (Int) -> Long): LongBuffer
Creates a new LongBuffer with the specified size, where each element is calculated by calling the specified init function.
RealBuffer
Link copied to clipboard
common
fun RealBuffer(vararg doubles: Double): RealBuffer
Returns a new RealBuffer of given elements.
inline fun RealBuffer(size: Int, init: (Int) -> Double): RealBuffer
Creates a new RealBuffer with the specified size, where each element is calculated by calling the specified init function.
ShortBuffer
Link copied to clipboard
common
fun ShortBuffer(vararg shorts: Short): ShortBuffer
Returns a new ShortBuffer of given elements.
inline fun ShortBuffer(size: Int, init: (Int) -> Short): ShortBuffer
Creates a new ShortBuffer with the specified size, where each element is calculated by calling the specified init function.
toList
Link copied to clipboard
common
fun <T> Buffer<T>.toList(): List<T>
Converts this Buffer to a new List

Properties

array
Link copied to clipboard
common
val MutableBuffer<out Float>.array: FloatArray
Returns a FloatArray containing all of the elements of this MutableBuffer.
array
Link copied to clipboard
common
val MutableBuffer<out Int>.array: IntArray
Returns a IntArray containing all of the elements of this MutableBuffer.
array
Link copied to clipboard
common
val MutableBuffer<out Long>.array: LongArray
Returns a IntArray containing all of the elements of this MutableBuffer.
array
Link copied to clipboard
common
val MutableBuffer<out Double>.array: DoubleArray
Returns a DoubleArray containing all of the elements of this MutableBuffer.
array
Link copied to clipboard
common
val MutableBuffer<out Short>.array: ShortArray
Returns a ShortArray containing all of the elements of this MutableBuffer.
indices
Link copied to clipboard
common
val Buffer<*>.indices: IntRange
Returns an IntRange of the valid indices for this Buffer.