MatrixContext

interface MatrixContext<T : Any, out M : Matrix<T>> : SpaceOperations<Matrix<T>>

Basic operations on matrices. Operates on Matrix.

Parameters

T

the type of items in the matrices.

M

the type of operated matrices.

Types

Companion
Link copied to clipboard
common
object Companion

Functions

add
Link copied to clipboard
common
abstract fun add(a: Matrix<T>, b: Matrix<T>): Matrix<T>
Addition of two elements.
binaryOperation
Link copied to clipboard
common
open fun binaryOperation(operation: String, left: Matrix<T>, right: Matrix<T>): Matrix<T>
Dynamically invokes a binary operation with the certain name.
binaryOperationFunction
Link copied to clipboard
common
open override fun binaryOperationFunction(operation: String): (Matrix<T>, Matrix<T>) -> M
Dynamically dispatches a binary operation with the certain name.
bindSymbol
Link copied to clipboard
common
open fun bindSymbol(value: String): Matrix<T>
Wraps a raw string to T object.
div
Link copied to clipboard
common
open operator fun Matrix<T>.div(k: Number): Matrix<T>
Division of this element by scalar.
dot
Link copied to clipboard
common
abstract infix fun Matrix<T>.dot(other: Matrix<T>): M
Computes the dot product of this matrix and another one.
abstract infix fun Matrix<T>.dot(vector: Point<T>): Point<T>
Computes the dot product of this matrix and a vector.
equals
Link copied to clipboard
common
open operator fun equals(other: Any?): Boolean
getFeature
Link copied to clipboard
common
open fun <F : Any> getFeature(m: Matrix<T>, type: KClass<F>): F?
Gets a feature from the matrix.
hashCode
Link copied to clipboard
common
open fun hashCode(): Int
minus
Link copied to clipboard
common
open operator fun Matrix<T>.minus(b: Matrix<T>): Matrix<T>
Subtraction of two elements.
multiply
Link copied to clipboard
common
abstract fun multiply(a: Matrix<T>, k: Number): Matrix<T>
Multiplication of element by scalar.
plus
Link copied to clipboard
common
open operator fun Matrix<T>.plus(b: Matrix<T>): Matrix<T>
Addition of two elements.
point
Link copied to clipboard
common
open fun point(size: Int, initializer: (Int) -> T): Point<T>
Produces a point compatible with matrix space (and possibly optimized for it).
produce
Link copied to clipboard
common
abstract fun produce(rows: Int, columns: Int, initializer: (i: Int, j: Int) -> T): M
Produces a matrix with this context and given dimensions.
times
Link copied to clipboard
common
open operator fun T.times(m: Matrix<T>): M
Multiplies an element by a matrix of it.
abstract operator fun Matrix<T>.times(value: T): M
Multiplies a matrix by its element.
open operator fun Number.times(b: Matrix<T>): Matrix<T>
Multiplication of this number by element.
open operator fun Matrix<T>.times(k: Number): Matrix<T>
Multiplication of this element by a scalar.
toString
Link copied to clipboard
common
open fun toString(): String
unaryMinus
Link copied to clipboard
common
open operator fun Matrix<T>.unaryMinus(): Matrix<T>
The negation of this element.
unaryOperation
Link copied to clipboard
common
open fun unaryOperation(operation: String, arg: Matrix<T>): Matrix<T>
Dynamically invokes an unary operation with the certain name.
unaryOperationFunction
Link copied to clipboard
common
open override fun unaryOperationFunction(operation: String): (Matrix<T>) -> Matrix<T>
Dynamically dispatches an unary operation with the certain name.
unaryPlus
Link copied to clipboard
common
open operator fun Matrix<T>.unaryPlus(): Matrix<T>
Returns this value.

Inheritors

GenericMatrixContext
Link copied to clipboard
RealMatrixContext
Link copied to clipboard

Extensions

getFeature
Link copied to clipboard
common
inline fun <T : Any, F : Any> MatrixContext<T, *>.getFeature(m: Matrix<T>): F?
Gets a feature from the matrix.
lup
Link copied to clipboard
common
fun <T : Comparable<T>> MatrixContext<T, Matrix<T>>.lup(factory: MutableBufferFactory<T>, elementContext: Field<T>, matrix: Matrix<T>, checkSingular: (T) -> Boolean): LupDecomposition<T>
Create a lup decomposition of generic matrix.
fun MatrixContext<Double, Matrix<Double>>.lup(matrix: Matrix<Double>): LupDecomposition<Double>