MutableStructureND

interface MutableStructureND<T> : StructureND<T>

Represents mutable StructureND.

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.
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 override fun <F : StructureFeature> getFeature(type: KClass<out F>): F?
Feature is some additional structure information that allows to access it special properties or hints.
set
Link copied to clipboard
common
abstract operator fun set(index: IntArray, value: T)
Inserts an item at the specified indices.

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., non-empty sequence of non-negative integers that specify sizes of dimensions of this structure.

Inheritors

MutableBufferND
Link copied to clipboard
MutableStructure1D
Link copied to clipboard
MutableStructure2D
Link copied to clipboard

Extensions

as1D
Link copied to clipboard
common
fun <T> MutableStructureND<T>.as1D(): MutableStructure1D<T>
as2D
Link copied to clipboard
common
fun <T> MutableStructureND<T>.as2D(): MutableStructure2D<T>
Represents a StructureND as Structure2D.
mapInPlace
Link copied to clipboard
common
inline fun <T> MutableStructureND<T>.mapInPlace(action: (IntArray, T) -> T)
Transform a structure element-by element in place.
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

Sources

common source
Link copied to clipboard