NDAlgebra

interface NDAlgebra<T, C : Algebra<T>>

The base interface for all ND-algebra implementations.

Parameters

T

the type of ND-structure element.

C

the type of the element context.

N

the type of the structure.

Types

Companion
Link copied to clipboard
common
object Companion

Functions

combine
Link copied to clipboard
common
abstract fun combine(a: NDStructure<T>, b: NDStructure<T>, transform: C.(T, T) -> T): NDStructure<T>
Combines two structures into one.
equals
Link copied to clipboard
common
open operator fun equals(other: Any?): Boolean
getFeature
Link copied to clipboard
common
open fun <F : Any> getFeature(structure: NDStructure<T>, type: KClass<F>): F?
Get a feature of the structure in this scope.
hashCode
Link copied to clipboard
common
open fun hashCode(): Int
invoke
Link copied to clipboard
common
open operator fun (T) -> T.invoke(structure: NDStructure<T>): NDStructure<T>
Element-wise invocation of function working on T on a NDStructure.
map
Link copied to clipboard
common
abstract fun NDStructure<T>.map(transform: C.(T) -> T): NDStructure<T>
Maps elements from one structure to another one by applying transform to them.
mapIndexed
Link copied to clipboard
common
abstract fun NDStructure<T>.mapIndexed(transform: C.(index: IntArray, T) -> T): NDStructure<T>
Maps elements from one structure to another one by applying transform to them alongside with their indices.
produce
Link copied to clipboard
common
abstract fun produce(initializer: C.(IntArray) -> T): NDStructure<T>
Produces a new NDStructure using given initializer function.
toString
Link copied to clipboard
common
open fun toString(): String

Properties

elementContext
Link copied to clipboard
common
abstract val elementContext: C
The algebra over elements of ND structure.
shape
Link copied to clipboard
common
abstract val shape: IntArray
The shape of ND-structures this algebra operates on.

Inheritors

BufferNDAlgebra
Link copied to clipboard
NDGroup
Link copied to clipboard

Extensions

getFeature
Link copied to clipboard
common
inline fun <T : Any, F : Any> NDAlgebra<T, *>.getFeature(structure: NDStructure<T>): F?
Get a feature of the structure in this scope.