VirtualMatrix

class VirtualMatrix<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

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

Functions

elements
Link copied to clipboard
common
open override fun elements(): Sequence<Pair<IntArray, T>>
Returns the sequence of all the elements associated by their indices.
equals
Link copied to clipboard
common
open operator override fun equals(other: Any?): Boolean
get
Link copied to clipboard
common
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.
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
open override fun hashCode(): Int
toString
Link copied to clipboard
common
open fun toString(): String

Properties

colNum
Link copied to clipboard
common
open override val colNum: Int
The number of columns in this structure.
columns
Link copied to clipboard
common
open val columns: Buffer<Buffer<T>>
The buffer of columns of this structure.
dimension
Link copied to clipboard
common
open val dimension: Int
The count of dimensions in this structure.
generator
Link copied to clipboard
common
val generator: (i: Int, j: Int) -> T
the function that provides elements.
rowNum
Link copied to clipboard
common
open override val rowNum: Int
The number of rows in this structure.
rows
Link copied to clipboard
common
open val rows: Buffer<Buffer<T>>
The buffer of rows of this structure.
shape
Link copied to clipboard
common
open override val shape: IntArray
The shape of structure, i.e.