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

DoubleBuffer
Link copied to clipboard
common
value class DoubleBuffer(array: DoubleArray) : MutableBuffer<Double>
Specialized MutableBuffer implementation over DoubleArray.
FlaggedBuffer
Link copied to clipboard
common
interface FlaggedBuffer<out T> : Buffer<T>
A buffer with flagged values.
FlaggedDoubleBuffer
Link copied to clipboard
common
class FlaggedDoubleBuffer(values: DoubleArray, flags: ByteArray) : FlaggedBuffer<Double?> , Buffer<Double?>
A Double buffer that supports flags for each value like NaN or Missing.
FloatBuffer
Link copied to clipboard
common
value class FloatBuffer(array: FloatArray) : MutableBuffer<Float>
Specialized MutableBuffer implementation over FloatArray.
IntBuffer
Link copied to clipboard
common
value class IntBuffer(array: IntArray) : MutableBuffer<Int>
Specialized MutableBuffer implementation over IntArray.
ListBuffer
Link copied to clipboard
common
class ListBuffer<T>(list: List<T>) : Buffer<T>
Buffer implementation over List.
LongBuffer
Link copied to clipboard
common
value 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
value 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
value class ReadOnlyBuffer<T>(buffer: MutableBuffer<T>) : Buffer<T>
Immutable wrapper for MutableBuffer.
ShortBuffer
Link copied to clipboard
common
value class ShortBuffer(array: ShortArray) : MutableBuffer<Short>
Specialized MutableBuffer implementation over ShortArray.
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<out T>(size: Int, generator: (Int) -> T) : Buffer<T>
A buffer with content calculated on-demand.

Functions

asBuffer
Link copied to clipboard
common
fun <T> Array<T>.asBuffer(): ArrayBuffer<T>
Returns an ArrayBuffer that wraps the original array.
fun DoubleArray.asBuffer(): DoubleBuffer
Returns DoubleBuffer 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.
asMutableBuffer
Link copied to clipboard
common
fun <T> MutableList<T>.asMutableBuffer(): MutableListBuffer<T>
Returns an MutableListBuffer that wraps the original list.
asReadOnly
Link copied to clipboard
common
fun <T> Buffer<T>.asReadOnly(): Buffer<T>
Convert this buffer to read-only buffer.
contentEquals
Link copied to clipboard
common
fun DoubleBuffer.contentEquals(vararg doubles: Double): Boolean
Simplified DoubleBuffer to array comparison
DoubleBuffer
Link copied to clipboard
common
fun DoubleBuffer(vararg doubles: Double): DoubleBuffer
Returns a new DoubleBuffer of given elements.
inline fun DoubleBuffer(size: Int, init: (Int) -> Double): DoubleBuffer
Creates a new DoubleBuffer with the specified size, where each element is calculated by calling the specified init function.
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 FlaggedDoubleBuffer.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
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.
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.
toDoubleArray
Link copied to clipboard
common
fun Buffer<Double>.toDoubleArray(): DoubleArray
Returns a new DoubleArray containing all the elements of this Buffer.
toFloatArray
Link copied to clipboard
common
fun Buffer<Float>.toFloatArray(): FloatArray
Returns a new FloatArray containing all the elements of this Buffer.
toIntArray
Link copied to clipboard
common
fun Buffer<Int>.toIntArray(): IntArray
Returns a new IntArray containing all the elements of this Buffer.
toLongArray
Link copied to clipboard
common
fun Buffer<Long>.toLongArray(): LongArray
Returns a new LongArray containing all the elements of this Buffer.
toShortArray
Link copied to clipboard
common
fun Buffer<Short>.toShortArray(): ShortArray
Returns a new ShortArray containing all the elements of this Buffer.

Properties

indices
Link copied to clipboard
common
val Buffer<*>.indices: IntRange
Returns an IntRange of the valid indices for this Buffer.