DSRing

open class DSRing<T, A : Ring<T>, NumericAlgebra<T>, ScaleOperations<T>>(algebra: A, order: Int, bindings: Map<Symbol, T>) : DSAlgebra<T, A> , Ring<DS<T, A>> , ScaleOperations<DS<T, A>> , NumericAlgebra<DS<T, A>> , NumbersAddOps<DS<T, A>> (source)

A ring over DS.

Parameters

bindings

The map of bindings values. All bindings are considered free parameters.

Inheritors

Constructors

Link copied to clipboard
constructor(algebra: A, order: Int, bindings: Map<Symbol, T>)

Functions

Link copied to clipboard
fun <T : Comparable<T>> Group<T>.abs(value: T): T

Absolute of the comparable value

Link copied to clipboard
open override fun add(left: DS<T, A>, right: DS<T, A>): DS<T, A>

Addition of two elements.

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

Dynamically invokes a binary operation with the certain name.

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

Dynamically dispatches a binary operation with the certain name.

Link copied to clipboard
open override fun bindSymbol(value: String): DSAlgebra.DSSymbol<T, A>

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

Link copied to clipboard
fun <T> Algebra<T>.bindSymbol(symbol: Symbol): T
Link copied to clipboard

open override fun bindSymbolOrNull(value: String): DSAlgebra.DSSymbol<T, A>?

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

Link copied to clipboard
fun <T> Algebra<T>.bindSymbolOrNull(symbol: Symbol): T?
Link copied to clipboard
open override fun const(value: T): DS<T, A>

A constant expression that does not depend on arguments.

Link copied to clipboard
fun DS<T, A>.derivative(vararg symbols: Symbol): T
fun DS<T, A>.derivative(symbols: List<Symbol>): T
Link copied to clipboard
open operator fun DS<T, A>.div(k: Number): DS<T, A>

Division of this element by scalar.

Link copied to clipboard
open fun export(arg: DS<T, A>): DS<T, A>

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 operator fun <T> Array<T>.get(symbol: Symbol): T
open operator fun DoubleArray.get(symbol: Symbol): Double
open operator fun <T> List<T>.get(symbol: Symbol): T
open operator fun <T> Point<T>.get(symbol: Symbol): T
open operator fun <T> Structure2D<T>.get(rowSymbol: Symbol, columnSymbol: Symbol): T
Link copied to clipboard
open fun indexOf(symbol: Symbol): Int
Link copied to clipboard
open fun leftSideNumberOperation(operation: String, left: Number, right: DS<T, A>): DS<T, A>

Dynamically invokes a binary operation with the certain name with numeric first argument.

Link copied to clipboard
open fun leftSideNumberOperationFunction(operation: String): (left: Number, right: DS<T, A>) -> DS<T, A>

Dynamically dispatches a binary operation with the certain name with numeric first argument.

Link copied to clipboard
open operator override fun Number.minus(other: DS<T, A>): DS<T, A>

Subtraction of number from element.

open operator fun DS<T, A>.minus(arg: DS<T, A>): DS<T, A>

Subtraction of two elements.

open operator fun DS<T, A>.minus(other: Number): DS<T, A>

Subtraction of element from number.

Link copied to clipboard
open override fun multiply(left: DS<T, A>, right: DS<T, A>): DS<T, A>

Multiplies two elements.

Link copied to clipboard
open override fun number(value: Number): DS<T, A>

Wraps a number to T object.

Link copied to clipboard
fun ofDerivatives(vararg derivatives: T): DS<T, A>

Build an instance from all its derivatives.

Link copied to clipboard
open operator override fun Number.plus(other: DS<T, A>): DS<T, A>

Addition of scalar and element.

open operator override fun DS<T, A>.plus(other: Number): DS<T, A>

Addition of element and scalar.

open operator fun DS<T, A>.plus(arg: DS<T, A>): DS<T, A>

Addition of two elements.

Link copied to clipboard
open fun power(arg: DS<T, A>, pow: UInt): DS<T, A>

Raises arg to the integer power pow.

Link copied to clipboard
open fun rightSideNumberOperation(operation: String, left: DS<T, A>, right: Number): DS<T, A>

Dynamically invokes a binary operation with the certain name with numeric second argument.

Link copied to clipboard
open fun rightSideNumberOperationFunction(operation: String): (left: DS<T, A>, right: Number) -> DS<T, A>

Dynamically dispatches a binary operation with the certain name with numeric first argument.

Link copied to clipboard
open override fun scale(a: DS<T, A>, value: Double): DS<T, A>

Scaling an element by a scalar.

Link copied to clipboard
fun <T> Group<T>.sum(data: Iterable<T>): T
@PerformancePitfall(message = "Potential boxing access to buffer elements")
fun <T> Group<T>.sum(data: Buffer<T>): T

Returns the sum of all elements in the iterable in this Group.

fun <T> Group<T>.sum(data: Sequence<T>): T

Returns the sum of all elements in the sequence in this Group.

Link copied to clipboard
open operator fun DS<T, A>.times(arg: DS<T, A>): DS<T, A>

Multiplies this element by scalar.

open operator fun Number.times(arg: DS<T, A>): DS<T, A>

Multiplication of this number by element.

open operator fun DS<T, A>.times(k: Number): DS<T, A>

Multiplication of this element by a scalar.

Link copied to clipboard
Link copied to clipboard
open fun <T> Map<Symbol, T>.toList(): List<T>
Link copied to clipboard
open fun <T> Point<T>.toMap(): Map<Symbol, T>
Link copied to clipboard
open fun <T> Map<Symbol, T>.toPoint(bufferFactory: BufferFactory<T>): Point<T>
Link copied to clipboard
open operator override fun DS<T, A>.unaryMinus(): DS<T, A>

The negation of this element.

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

Dynamically invokes a unary operation with the certain name.

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

Dynamically dispatches a unary operation with the certain name.

Link copied to clipboard
open operator fun DS<T, A>.unaryPlus(): DS<T, A>

Returns this value.

Link copied to clipboard
fun variable(index: Int, value: T): DS<T, A>

Build an instance representing a variable.

Properties

Link copied to clipboard
val algebra: A
Link copied to clipboard

Bind a symbol by name inside the ExpressionAlgebra

Link copied to clipboard

Provide a factory for buffers, associated with this Algebra

Link copied to clipboard
val <T> NumericAlgebra<T>.e: T

The e mathematical constant.

Link copied to clipboard
open override val one: DS<T, A>

The neutral element of multiplication

Link copied to clipboard
val order: Int
Link copied to clipboard

The π mathematical constant.

Link copied to clipboard
open override val symbols: List<Symbol>
Link copied to clipboard
open override val zero: DS<T, A>

The neutral element of addition.