AlgebraND

interface AlgebraND<T, out C : Algebra<T>> : Algebra<StructureND<T>>

The base interface for all ND-algebra implementations.

Parameters

T

the type of ND-structure element.

C

the type of the element context.

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
open fun binaryOperation(operation: String, left: StructureND<T>, right: StructureND<T>): StructureND<T>

Dynamically invokes a binary operation with the certain name.

Link copied to clipboard
open fun binaryOperationFunction(operation: String): (left: StructureND<T>, right: StructureND<T>) -> StructureND<T>

Dynamically dispatches a binary operation with the certain name.

Link copied to clipboard
open fun bindSymbol(value: String): StructureND<T>

The same as bindSymbolOrNull but throws an error if symbol could not be bound

Link copied to clipboard
open fun bindSymbolOrNull(value: String): StructureND<T>?

Wraps a raw string to T object. This method is designed for three purposes:

Link copied to clipboard
open fun export(arg: StructureND<T>): StructureND<T>

Export an algebra element, so it could be accessed even after algebra scope is closed. This method must be used on algebras where data is stored externally or any local algebra state is used. By default (if not overridden), exports the object itself.

Link copied to clipboard
open fun <F : StructureFeature> getFeature(structure: StructureND<T>, type: KClass<out F>): F?

Get a feature of the structure in this scope. Structure features take precedence other context features.

Link copied to clipboard
open operator fun (T) -> T.invoke(structure: StructureND<T>): StructureND<T>

Element-wise invocation of function working on T on a StructureND.

Link copied to clipboard
@PerformancePitfall(message = "Very slow on remote execution algebras")
open fun StructureND<T>.map(transform: C.(T) -> T): StructureND<T>

Maps elements from one structure to another one by applying transform to them.

Link copied to clipboard
@PerformancePitfall(message = "Very slow on remote execution algebras")
open fun StructureND<T>.mapIndexed(transform: C.(index: IntArray, T) -> T): StructureND<T>

Maps elements from one structure to another one by applying transform to them alongside with their indices.

Link copied to clipboard
abstract fun structureND(shape: Shape, initializer: C.(IntArray) -> T): StructureND<T>

Produces a new StructureND using given initializer function.

Link copied to clipboard
open fun unaryOperation(operation: String, arg: StructureND<T>): StructureND<T>

Dynamically invokes a unary operation with the certain name.

Link copied to clipboard
open fun unaryOperationFunction(operation: String): (arg: StructureND<T>) -> StructureND<T>

Dynamically dispatches a unary operation with the certain name.

Link copied to clipboard
@PerformancePitfall(message = "Very slow on remote execution algebras")
open fun zip(left: StructureND<T>, right: StructureND<T>, transform: C.(T, T) -> T): StructureND<T>

Combines two structures into one.

Properties

Link copied to clipboard
abstract val elementAlgebra: C

The algebra over elements of ND structure.

Inheritors

Link copied to clipboard
Link copied to clipboard

Extensions

Link copied to clipboard
fun <T : Comparable<T>> AlgebraND<T, Ring<T>>.contentEquals(st1: StructureND<T>, st2: StructureND<T>): Boolean

Indicates whether some StructureND is equal to another one.

Link copied to clipboard
inline fun <T : Any, F : StructureFeature> AlgebraND<T, *>.getFeature(structure: StructureND<T>): F?

Get a feature of the structure in this scope. Structure features take precedence other context features.

Link copied to clipboard
fun <T, A : Ring<T>> AlgebraND<T, A>.one(shape: Shape): StructureND<T>
@JvmName(name = "oneVarArg")
fun <T, A : Ring<T>> AlgebraND<T, A>.one(shapeFirst: Int, vararg shapeRest: Int): StructureND<T>
Link copied to clipboard
fun <T, A : Algebra<T>> AlgebraND<T, A>.structureND(shapeFirst: Int, vararg shapeRest: Int, initializer: A.(IntArray) -> T): StructureND<T>
Link copied to clipboard
fun <T, A : Group<T>> AlgebraND<T, A>.zero(shape: Shape): StructureND<T>
@JvmName(name = "zeroVarArg")
fun <T, A : Group<T>> AlgebraND<T, A>.zero(shapeFirst: Int, vararg shapeRest: Int): StructureND<T>

Sources

Link copied to clipboard