LinearSpace

interface LinearSpace<T, out A : Ring<T>>

Basic operations on matrices and vectors.

Parameters

T

the type of items in the matrices.

A

the type of ring over T.

Types

Companion
Link copied to clipboard
common
object Companion

Functions

buildMatrix
Link copied to clipboard
common
abstract fun buildMatrix(rows: Int, columns: Int, initializer: A.(i: Int, j: Int) -> T): Matrix<T>
Produces a matrix with this context and given dimensions.
buildVector
Link copied to clipboard
common
abstract fun buildVector(size: Int, initializer: A.(Int) -> T): Point<T>
Produces a point compatible with matrix space (and possibly optimized for it).
computeFeature
Link copied to clipboard
common
open fun <F : StructureFeature> computeFeature(structure: Matrix<T>, type: KClass<out F>): F?
Compute a feature of the structure in this scope.
dot
Link copied to clipboard
common
open infix fun Matrix<T>.dot(other: Matrix<T>): Matrix<T>
Computes the dot product of this matrix and another one.
open infix fun Matrix<T>.dot(vector: Point<T>): Point<T>
Computes the dot product of this matrix and a vector.
minus
Link copied to clipboard
common
open operator fun Matrix<T>.minus(other: Matrix<T>): Matrix<T>
Matrix subtraction
open operator fun Point<T>.minus(other: Point<T>): Point<T>
Vector subtraction
plus
Link copied to clipboard
common
open operator fun Matrix<T>.plus(other: Matrix<T>): Matrix<T>
Matrix sum
open operator fun Point<T>.plus(other: Point<T>): Point<T>
Vector sum
times
Link copied to clipboard
common
open operator fun T.times(m: Matrix<T>): Matrix<T>
Multiplies an element by a matrix of it.
open operator fun T.times(v: Point<T>): Point<T>
Multiplies an element by a vector of it.
open operator fun Matrix<T>.times(value: T): Matrix<T>
Multiplies a matrix by its element.
open operator fun Point<T>.times(value: T): Point<T>
Multiplies a vector by its element.
unaryMinus
Link copied to clipboard
common
open operator fun Matrix<T>.unaryMinus(): Matrix<T>
open operator fun Point<T>.unaryMinus(): Point<T>

Properties

elementAlgebra
Link copied to clipboard
common
abstract val elementAlgebra: A

Inheritors

BufferedLinearSpace
Link copied to clipboard
DoubleLinearSpace
Link copied to clipboard

Extensions

column
Link copied to clipboard
common
inline fun <T : Any> LinearSpace<T, Ring<T>>.column(size: Int, crossinline builder: (Int) -> T): Matrix<T>
fun <T : Any> LinearSpace<T, Ring<T>>.column(vararg values: T): Matrix<T>
computeFeature
Link copied to clipboard
common
inline fun <T : Any, F : StructureFeature> LinearSpace<T, *>.computeFeature(structure: Matrix<T>): F?
Get a feature of the structure in this scope.
contentEquals
Link copied to clipboard
common
fun <T : Comparable<T>> LinearSpace<T, Ring<T>>.contentEquals(st1: StructureND<T>, st2: StructureND<T>): Boolean
Indicates whether some StructureND is equal to another one.
fun <T : Comparable<T>> LinearSpace<T, Ring<T>>.contentEquals(st1: StructureND<T>, st2: StructureND<T>, absoluteTolerance: T): Boolean
Indicates whether some StructureND is equal to another one with absoluteTolerance.
lup
Link copied to clipboard
common
fun <T : Comparable<T>> LinearSpace<T, Field<T>>.lup(factory: MutableBufferFactory<T>, matrix: Matrix<T>, checkSingular: (T) -> Boolean): LupDecomposition<T>
Create a lup decomposition of generic matrix.
inline fun <T : Comparable<T>> LinearSpace<T, Field<T>>.lup(matrix: Matrix<T>, noinline checkSingular: (T) -> Boolean): LupDecomposition<T>
fun LinearSpace<Double, DoubleField>.lup(matrix: Matrix<Double>, singularityThreshold: Double = 1e-11): LupDecomposition<Double>
lupSolver
Link copied to clipboard
common
fun <T : Comparable<T>, F : Field<T>> LinearSpace<T, F>.lupSolver(bufferFactory: MutableBufferFactory<T>, singularityCheck: (T) -> Boolean): LinearSolver<T>
Produce a generic solver based on LUP decomposition
fun LinearSpace<Double, DoubleField>.lupSolver(singularityThreshold: Double = 1e-11): LinearSolver<Double>
matrix
Link copied to clipboard
common
fun <T : Any, A : Ring<T>> LinearSpace<T, A>.matrix(rows: Int, columns: Int): MatrixBuilder<T, A>
Create a matrix builder with given number of rows and columns
one
Link copied to clipboard
common
fun <T : Any> LinearSpace<T, Ring<T>>.one(rows: Int, columns: Int): Matrix<T>
Diagonal matrix of ones.
row
Link copied to clipboard
common
inline fun <T : Any> LinearSpace<T, Ring<T>>.row(size: Int, crossinline builder: (Int) -> T): Matrix<T>
fun <T : Any> LinearSpace<T, Ring<T>>.row(vararg values: T): Matrix<T>
vector
Link copied to clipboard
common
fun <T : Any> LinearSpace<T, Ring<T>>.vector(vararg elements: T): Point<T>
zero
Link copied to clipboard
common
fun <T : Any> LinearSpace<T, Ring<T>>.zero(rows: Int, columns: Int): Matrix<T>
A virtual matrix of zeroes

Sources

common source
Link copied to clipboard