Package space.kscience.kmath.nd

Types

AlgebraND
Link copied to clipboard
common
interface AlgebraND<T, out C : Algebra<T>>
The base interface for all ND-algebra implementations.
BufferAlgebraND
Link copied to clipboard
common
interface BufferAlgebraND<T, out A : Algebra<T>> : AlgebraND<T, A>
BufferedFieldND
Link copied to clipboard
common
open class BufferedFieldND<T, out R : Field<T>>(shape: IntArray, elementContext: R, bufferFactory: BufferFactory<T>) : BufferedRingND<T, R> , FieldND<T, R>
BufferedGroupND
Link copied to clipboard
common
open class BufferedGroupND<T, out A : Group<T>>(shape: IntArray, elementContext: A, bufferFactory: BufferFactory<T>) : GroupND<T, A> , BufferAlgebraND<T, A>
BufferedRingND
Link copied to clipboard
common
open class BufferedRingND<T, out R : Ring<T>>(shape: IntArray, elementContext: R, bufferFactory: BufferFactory<T>) : BufferedGroupND<T, R> , RingND<T, R>
BufferND
Link copied to clipboard
common
open class BufferND<out T>(strides: Strides, buffer: Buffer<T>) : StructureND<T>
Represents StructureND over Buffer.
DefaultStrides
Link copied to clipboard
common
class DefaultStrides : Strides
Simple implementation of Strides.
FieldND
Link copied to clipboard
common
interface FieldND<T, out F : Field<T>> : Field<StructureND<T>> , RingND<T, F>
Field of StructureND.
GroupND
Link copied to clipboard
common
interface GroupND<T, out S : Group<T>> : Group<StructureND<T>> , AlgebraND<T, S>
Space of StructureND.
MutableBufferND
Link copied to clipboard
common
class MutableBufferND<T>(strides: Strides, mutableBuffer: MutableBuffer<T>) : BufferND<T> , MutableStructureND<T>
MutableStructure1D
Link copied to clipboard
common
interface MutableStructure1D<T> : Structure1D<T> , MutableStructureND<T> , MutableBuffer<T>
A mutable structure that is guaranteed to be one-dimensional
MutableStructure2D
Link copied to clipboard
common
interface MutableStructure2D<T> : Structure2D<T> , MutableStructureND<T>
Represents mutable Structure2D.
MutableStructureND
Link copied to clipboard
common
interface MutableStructureND<T> : StructureND<T>
Represents mutable StructureND.
RingND
Link copied to clipboard
common
interface RingND<T, out R : Ring<T>> : Ring<StructureND<T>> , GroupND<T, R>
Ring of StructureND.
ShapeMismatchException
Link copied to clipboard
common
class ShapeMismatchException(expected: IntArray, actual: IntArray) : RuntimeException
An exception is thrown when the expected and actual shape of NDArray differ.
ShortRingND
Link copied to clipboard
common
class ShortRingND(shape: IntArray) : BufferedRingND<Short, ShortRing> , NumbersAddOperations<StructureND<Short>>
Strides
Link copied to clipboard
common
interface Strides
A way to convert ND indices to linear one and back.
Structure1D
Link copied to clipboard
common
interface Structure1D<out T> : StructureND<T> , Buffer<T>
A structure that is guaranteed to be one-dimensional
Structure2D
Link copied to clipboard
common
interface Structure2D<out T> : StructureND<T>
A structure that is guaranteed to be two-dimensional.
StructureFeature
Link copied to clipboard
common
interface StructureFeature : Feature<StructureFeature>
StructureND
Link copied to clipboard
common
interface StructureND<out T> : Featured<StructureFeature>
Represents n-dimensional structure i.e., multidimensional container of items of the same type and size.

Functions

as1D
Link copied to clipboard
common
fun <T> MutableStructureND<T>.as1D(): MutableStructure1D<T>
fun <T> StructureND<T>.as1D(): Structure1D<T>
Represent a StructureND as Structure1D.
as2D
Link copied to clipboard
common
fun <T> MutableStructureND<T>.as2D(): MutableStructure2D<T>
Represents a StructureND as Structure2D.
fun <T> StructureND<T>.as2D(): Structure2D<T>
Represents a StructureND as Structure2D.
asND
Link copied to clipboard
common
fun <T> Buffer<T>.asND(): Structure1D<T>
Represent this buffer as 1D structure
autoNdAlgebra
Link copied to clipboard
common
inline fun <T : Any, A : Field<T>> A.autoNdAlgebra(vararg shape: Int): FieldND<T, A>
Create a FieldND for this Field inferring proper buffer factory from the type
combine
Link copied to clipboard
common
inline fun <T : Any> StructureND<T>.combine(struct: StructureND<T>, crossinline block: (T, T) -> T): StructureND<T>
contentEquals
Link copied to clipboard
common
fun <T : Comparable<T>> LinearSpace<T, Ring<T>>.contentEquals(st1: StructureND<T>, st2: StructureND<T>): Boolean
Indicates whether some StructureND is equal to another one.
fun <T : Comparable<T>> AlgebraND<T, Ring<T>>.contentEquals(st1: StructureND<T>, st2: StructureND<T>): Boolean
Indicates whether some StructureND is equal to another one.
fun <T : Comparable<T>> LinearSpace<T, Ring<T>>.contentEquals(st1: StructureND<T>, st2: StructureND<T>, absoluteTolerance: T): Boolean
Indicates whether some StructureND is equal to another one with absoluteTolerance.
fun <T : Comparable<T>> GroupND<T, Ring<T>>.contentEquals(st1: StructureND<T>, st2: StructureND<T>, absoluteTolerance: T): Boolean
Indicates whether some StructureND is equal to another one with absoluteTolerance.
get
Link copied to clipboard
common
operator fun <T> StructureND<T>.get(vararg index: Int): T
Returns the value at the specified indices.
getFeature
Link copied to clipboard
common
inline fun <T : Any, F : StructureFeature> AlgebraND<T, *>.getFeature(structure: StructureND<T>): F?
Get a feature of the structure in this scope.
mapInPlace
Link copied to clipboard
common
inline fun <T> MutableStructureND<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> StructureND<T>.mapToBuffer(factory: BufferFactory<R> = Buffer.Companion::auto, crossinline transform: (T) -> R): BufferND<R>
Transform structure to a new structure using provided BufferFactory and optimizing if argument is BufferND
mapToMutableBuffer
Link copied to clipboard
common
inline fun <T, R : Any> MutableStructureND<T>.mapToMutableBuffer(factory: MutableBufferFactory<R> = MutableBuffer.Companion::auto, crossinline transform: (T) -> R): MutableBufferND<R>
Transform structure to a new structure using provided MutableBufferFactory and optimizing if argument is MutableBufferND
ndAlgebra
Link copied to clipboard
common
fun DoubleField.ndAlgebra(vararg shape: Int): DoubleFieldND
fun <T, A : Field<T>> A.ndAlgebra(bufferFactory: BufferFactory<T>, vararg shape: Int): BufferedFieldND<T, A>
fun <T, A : Group<T>> A.ndAlgebra(bufferFactory: BufferFactory<T>, vararg shape: Int): BufferedGroupND<T, A>
fun <T, A : Ring<T>> A.ndAlgebra(bufferFactory: BufferFactory<T>, vararg shape: Int): BufferedRingND<T, A>
produceInline
Link copied to clipboard
common
inline fun BufferedRingND<Short, ShortRing>.produceInline(crossinline initializer: ShortRing.(Int) -> Short): BufferND<Short>
Fast element production using function inlining.
withNdAlgebra
Link copied to clipboard
common
inline fun <R> DoubleField.withNdAlgebra(vararg shape: Int, action: DoubleFieldND.() -> R): R
Produce a context for n-dimensional operations inside this real field
inline fun <R> ShortRing.withNdAlgebra(vararg shape: Int, action: ShortRingND.() -> R): R
@JvmName(name = withNdField)
inline fun <T, A : Field<T>, R> A.withNdAlgebra(noinline bufferFactory: BufferFactory<T>, vararg shape: Int, action: BufferedFieldND<T, A>.() -> R): R
@JvmName(name = withNdGroup)
inline fun <T, A : Group<T>, R> A.withNdAlgebra(noinline bufferFactory: BufferFactory<T>, vararg shape: Int, action: BufferedGroupND<T, A>.() -> R): R
@JvmName(name = withNdRing)
inline fun <T, A : Ring<T>, R> A.withNdAlgebra(noinline bufferFactory: BufferFactory<T>, vararg shape: Int, action: BufferedRingND<T, A>.() -> R): R