Package space.kscience.kmath.nd

Types

BufferedNDField
Link copied to clipboard
common
open class BufferedNDField<T, R : Field<T>>(shape: IntArray, elementContext: R, bufferFactory: BufferFactory<T>) : BufferedNDRing<T, R> , NDField<T, R>
BufferedNDRing
Link copied to clipboard
common
open class BufferedNDRing<T, R : Ring<T>>(shape: IntArray, elementContext: R, bufferFactory: BufferFactory<T>) : BufferedNDSpace<T, R> , NDRing<T, R>
BufferedNDSpace
Link copied to clipboard
common
open class BufferedNDSpace<T, R : Space<T>>(shape: IntArray, elementContext: R, bufferFactory: BufferFactory<T>) : NDSpace<T, R> , BufferNDAlgebra<T, R>
BufferNDAlgebra
Link copied to clipboard
common
interface BufferNDAlgebra<T, C> : NDAlgebra<T, C>
DefaultStrides
Link copied to clipboard
common
class DefaultStrides : Strides
Simple implementation of Strides.
Matrix
Link copied to clipboard
common
typealias Matrix<T> = Structure2D<T>

Alias for Structure2D with more familiar name.

MutableNDBuffer
Link copied to clipboard
common
class MutableNDBuffer<T>(strides: Strides, buffer: MutableBuffer<T>) : NDBuffer<T> , MutableNDStructure<T>
Mutable ND buffer based on linear MutableBuffer.
MutableNDStructure
Link copied to clipboard
common
interface MutableNDStructure<T> : NDStructure<T>
Represents mutable NDStructure.
NDAlgebra
Link copied to clipboard
common
interface NDAlgebra<T, C>
The base interface for all ND-algebra implementations.
NDBuffer
Link copied to clipboard
common
open class NDBuffer<T>(strides: Strides, buffer: Buffer<T>) : NDStructure<T>
Represents NDStructure over Buffer.
NDField
Link copied to clipboard
common
interface NDField<T, F : Field<T>> : Field<NDStructure<T>> , NDRing<T, F>
Field of NDStructure.
NDRing
Link copied to clipboard
common
interface NDRing<T, R : Ring<T>> : Ring<NDStructure<T>> , NDSpace<T, R>
Ring of NDStructure.
NDSpace
Link copied to clipboard
common
interface NDSpace<T, S : Space<T>> : Space<NDStructure<T>> , NDAlgebra<T, S>
Space of NDStructure.
NDStructure
Link copied to clipboard
common
interface NDStructure<T>
Represents n-dimensional structure, i.e.
RealNDField
Link copied to clipboard
ShapeMismatchException
Link copied to clipboard
common
class ShapeMismatchException(expected: IntArray, actual: IntArray) : RuntimeException
An exception is thrown when the expected ans actual shape of NDArray differs.
ShortNDRing
Link copied to clipboard
common
class ShortNDRing(shape: IntArray) : BufferedNDRing<Short, ShortRing> , RingWithNumbers<NDStructure<Short>>
Strides
Link copied to clipboard
common
interface Strides
A way to convert ND index to linear one and back.
Structure1D
Link copied to clipboard
common
interface Structure1D<T> : NDStructure<T> , Buffer<T>
A structure that is guaranteed to be one-dimensional
Structure2D
Link copied to clipboard
common
interface Structure2D<T> : NDStructure<T>
A structure that is guaranteed to be two-dimensional.

Functions

as1D
Link copied to clipboard
common
fun <T> NDStructure<T>.as1D(): Structure1D<T>
Represent a NDStructure as Structure1D.
as2D
Link copied to clipboard
common
fun <T> NDStructure<T>.as2D(): Structure2D<T>
Represent a NDStructure as Structure1D.
asND
Link copied to clipboard
common
fun <T> Buffer<T>.asND(): Structure1D<T>
Represent this buffer as 1D structure
auto
Link copied to clipboard
common
inline fun <T : Any, A : Field<T>> NDAlgebra.Companion.auto(field: A, vararg shape: Int): NDField<T, A>
combine
Link copied to clipboard
common
inline fun <T : Any> NDStructure<T>.combine(struct: NDStructure<T>, crossinline block: (T, T) -> T): NDStructure<T>
field
Link copied to clipboard
common
fun <T, A : Field<T>> NDAlgebra.Companion.field(field: A, bufferFactory: BufferFactory<T>, vararg shape: Int): BufferedNDField<T, A>
get
Link copied to clipboard
common
operator fun <T> NDStructure<T>.get(vararg index: Int): T
Returns the value at the specified indices.
getFeature
Link copied to clipboard
common
inline fun <T : Any> NDStructure<*>.getFeature(): T?
mapInPlace
Link copied to clipboard
common
inline fun <T> MutableNDStructure<T>.mapInPlace(action: (IntArray, T) -> T)
Transform a structure element-by element in place.
mapToBuffer
Link copied to clipboard
common
inline fun <T, R : Any> NDStructure<T>.mapToBuffer(factory: BufferFactory<R> = Buffer.Companion::auto, crossinline transform: (T) -> R): NDBuffer<R>
Transform structure to a new structure using provided BufferFactory and optimizing if argument is NDBuffer
nd
Link copied to clipboard
common
inline fun <R> RealField.nd(vararg shape: Int, action: RealNDField.() -> R): R
Produce a context for n-dimensional operations inside this real field
inline fun <R> ShortRing.nd(vararg shape: Int, action: ShortNDRing.() -> R): R
ndField
Link copied to clipboard
common
inline fun <T, A : Field<T>, R> A.ndField(noinline bufferFactory: BufferFactory<T>, vararg shape: Int, action: BufferedNDField<T, A>.() -> R): R
ndRing
Link copied to clipboard
common
inline fun <T, A : Ring<T>, R> A.ndRing(noinline bufferFactory: BufferFactory<T>, vararg shape: Int, action: BufferedNDRing<T, A>.() -> R): R
ndSpace
Link copied to clipboard
common
inline fun <T, A : Space<T>, R> A.ndSpace(noinline bufferFactory: BufferFactory<T>, vararg shape: Int, action: BufferedNDSpace<T, A>.() -> R): R
produceInline
Link copied to clipboard
common
inline fun BufferedNDRing<Short, ShortRing>.produceInline(crossinline initializer: ShortRing.(Int) -> Short): NDBuffer<Short>
Fast element production using function inlining.
real
Link copied to clipboard
common
fun NDAlgebra.Companion.real(vararg shape: Int): RealNDField
ring
Link copied to clipboard
common
fun <T, A : Ring<T>> NDAlgebra.Companion.ring(ring: A, bufferFactory: BufferFactory<T>, vararg shape: Int): BufferedNDRing<T, A>
space
Link copied to clipboard
common
fun <T, A : Space<T>> NDAlgebra.Companion.space(space: A, bufferFactory: BufferFactory<T>, vararg shape: Int): BufferedNDSpace<T, A>