VirtualMatrix

class VirtualMatrix<out T : Any>(rowNum: Int, colNum: Int, generator: (i: Int, j: Int) -> T) : Structure2D<T>

The matrix where each element is evaluated each time when is being accessed.

Constructors

Link copied to clipboard
fun <out T : Any> VirtualMatrix(rowNum: Int, colNum: Int, generator: (i: Int, j: Int) -> T)

Functions

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

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

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

Returns the value at the specified indices.

open operator override fun get(i: Int, j: Int): T

Retrieves an element from the structure by two 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.

Properties

Link copied to clipboard
open override val colNum: Int

The number of columns in this structure.

Link copied to clipboard
open val columns: List<Buffer<T>>

The buffer of columns of this structure. It gets elements from the structure dynamically.

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
val generator: (i: Int, j: Int) -> T

the function that provides elements.

Link copied to clipboard
open val indices: ShapeIndexer
Link copied to clipboard
open override val rowNum: Int

The number of rows in this structure.

Link copied to clipboard
open val rows: List<Buffer<T>>

The buffer of rows of this structure. It gets elements from the structure dynamically.

Link copied to clipboard
open override val shape: IntArray

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