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>
BufferedNDGroup
Link copied to clipboard
common
open class BufferedNDGroup<T, A : Group<T>>(shape: IntArray, elementContext: A, bufferFactory: BufferFactory<T>) : NDGroup<T, A> , BufferNDAlgebra<T, A>
BufferedNDRing
Link copied to clipboard
common
open class BufferedNDRing<T, R : Ring<T>>(shape: IntArray, elementContext: R, bufferFactory: BufferFactory<T>) : BufferedNDGroup<T, R> , NDRing<T, R>
BufferNDAlgebra
Link copied to clipboard
common
interface BufferNDAlgebra<T, A : Algebra<T>> : NDAlgebra<T, A>
DefaultStrides
Link copied to clipboard
common
class DefaultStrides : Strides
Simple implementation of Strides.
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 : Algebra<T>>
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> , ScaleOperations<NDStructure<T>>
Field of NDStructure.
NDGroup
Link copied to clipboard
common
interface NDGroup<T, S : Group<T>> : Group<NDStructure<T>> , NDAlgebra<T, S>
Space of NDStructure.
NDRing
Link copied to clipboard
common
interface NDRing<T, R : Ring<T>> : Ring<NDStructure<T>> , NDGroup<T, R>
Ring 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> , NumbersAddOperations<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?
inline fun <T : Any, F : Any> NDAlgebra<T, *>.getFeature(structure: NDStructure<T>): F?
Get a feature of the structure in this scope.
group
Link copied to clipboard
common
fun <T, A : Group<T>> NDAlgebra.Companion.group(space: A, bufferFactory: BufferFactory<T>, vararg shape: Int): BufferedNDGroup<T, A>
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
ndGroup
Link copied to clipboard
common
inline fun <T, A : Group<T>, R> A.ndGroup(noinline bufferFactory: BufferFactory<T>, vararg shape: Int, action: BufferedNDGroup<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
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>