MutableBufferND

class MutableBufferND<T>(strides: ShapeIndexer, buffer: MutableBuffer<T>) : BufferND<T> , MutableStructureND<T>

Represents MutableStructureND over MutableBuffer.

Parameters

T

the type of items.

strides

The strides to access elements of MutableBuffer by linear indices.

buffer

The underlying buffer.

Constructors

Link copied to clipboard
fun <T> MutableBufferND(strides: ShapeIndexer, buffer: MutableBuffer<T>)

Functions

Link copied to clipboard
open fun elements(): Sequence<Pair<IntArray, T>>

Returns the sequence of all the elements associated by their indices.

Link copied to clipboard
abstract operator fun get(index: IntArray): T

Returns the value at the specified indices.

Link copied to clipboard
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. If the feature is not present, null is returned.

Link copied to clipboard
open operator override fun set(index: IntArray, value: T)

Inserts an item at the specified indices.

Properties

Link copied to clipboard
open override val buffer: MutableBuffer<T>
Link copied to clipboard
open val dimension: Int

The count of dimensions in this structure. It should be equal to size of shape.

Link copied to clipboard
open val indices: ShapeIndexer
Link copied to clipboard
abstract override val shape: Shape

The shape of structure i.e., non-empty sequence of non-negative integers that specify sizes of dimensions of this structure.

Sources

Link copied to clipboard