NDStructure

interface NDStructure<T>

Represents n-dimensional structure, i.e. multidimensional container of items of the same type and size. The number of dimensions and items in an array is defined by its shape, which is a sequence of non-negative integers that specify the sizes of each dimension.

Parameters

T

the type of items.

Types

Companion
Link copied to clipboard
common
object Companion

Functions

elements
Link copied to clipboard
common
abstract fun elements(): Sequence<Pair<IntArray, T>>
Returns the sequence of all the elements associated by their indices.
equals
Link copied to clipboard
common
abstract operator override fun equals(other: Any?): Boolean
get
Link copied to clipboard
common
abstract operator fun get(index: IntArray): T
Returns the value at the specified indices.
getFeature
Link copied to clipboard
common
open fun <T : Any> getFeature(type: KClass<T>): T?
Feature is additional property or hint that does not directly affect the structure, but could in some cases help optimize operations and performance.
hashCode
Link copied to clipboard
common
abstract override fun hashCode(): Int
toString
Link copied to clipboard
common
open fun toString(): String

Properties

dimension
Link copied to clipboard
common
open val dimension: Int
The count of dimensions in this structure.
shape
Link copied to clipboard
common
abstract val shape: IntArray
The shape of structure, i.e.

Inheritors

MutableNDStructure
Link copied to clipboard
NDBuffer
Link copied to clipboard
Structure1D
Link copied to clipboard
Structure2D
Link copied to clipboard

Extensions

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.
combine
Link copied to clipboard
common
inline fun <T : Any> NDStructure<T>.combine(struct: NDStructure<T>, crossinline block: (T, T) -> T): NDStructure<T>
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?
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