Package org.jetbrains.kotlinx.multik.api.linalg

Types

Link copied to clipboard
interface LinAlg

Linear Algebra methods interface.

Link copied to clipboard
interface LinAlgEx

Extension interface for LinAlg for improved type support.

Link copied to clipboard
enum Norm : Enum<Norm>

Matrix norm types.

Functions

Link copied to clipboard
@JvmName(name = "dotDefVVNumber")
infix fun <T : Number> MultiArray<T, D1>.dot(b: MultiArray<T, D1>): T

Returns the product of two numeric vectors.

@JvmName(name = "dotDefMVNumber")
infix fun <T : Number> MultiArray<T, D2>.dot(b: MultiArray<T, D1>): NDArray<T, D1>

Returns the matrix product of a numeric matrix and a numeric vector.

@JvmName(name = "dotDefMMNumber")
infix fun <T : Number> MultiArray<T, D2>.dot(b: MultiArray<T, D2>): NDArray<T, D2>

Returns the matrix product of two numeric matrices.

@JvmName(name = "dotDefVVComplex")
infix fun <T : Complex> MultiArray<T, D1>.dot(b: MultiArray<T, D1>): T

Returns the product of two complex vectors.

@JvmName(name = "dotDefMVComplex")
infix fun <T : Complex> MultiArray<T, D2>.dot(b: MultiArray<T, D1>): NDArray<T, D1>

Returns the matrix product of a complex matrix and a complex vector.

@JvmName(name = "dotDefMMComplex")
infix fun <T : Complex> MultiArray<T, D2>.dot(b: MultiArray<T, D2>): NDArray<T, D2>

Returns the matrix product of two complex matrices.

@JvmName(name = "dotVVNumber")
fun <T : Number> LinAlg.dot(a: MultiArray<T, D1>, b: MultiArray<T, D1>): T

Dot products of two number vectors. Scalar product.

@JvmName(name = "dotMVNumber")
fun <T : Number> LinAlg.dot(a: MultiArray<T, D2>, b: MultiArray<T, D1>): NDArray<T, D1>

Dot products of number matrix and number vector.

@JvmName(name = "dotMMNumber")
fun <T : Number> LinAlg.dot(a: MultiArray<T, D2>, b: MultiArray<T, D2>): NDArray<T, D2>

Dot products of two number matrices.

@JvmName(name = "dotVVComplex")
fun <T : Complex> LinAlg.dot(a: MultiArray<T, D1>, b: MultiArray<T, D1>): T

Dot products of two complex vectors. Scalar product.

@JvmName(name = "dotMVComplex")
fun <T : Complex> LinAlg.dot(a: MultiArray<T, D2>, b: MultiArray<T, D1>): NDArray<T, D1>

Dot products of complex matrix and complex vector.

@JvmName(name = "dotMMComplex")
fun <T : Complex> LinAlg.dot(a: MultiArray<T, D2>, b: MultiArray<T, D2>): NDArray<T, D2>

Dot products of two complex matrices.

Link copied to clipboard
@JvmName(name = "eig")
fun <T : Number> LinAlg.eig(mat: MultiArray<T, D2>): Pair<D1Array<ComplexDouble>, D2Array<ComplexDouble>>

Calculates the eigenvalues and eigenvectors of a numeric matrix

@JvmName(name = "eigC")
fun <T : Complex> LinAlg.eig(mat: MultiArray<T, D2>): Pair<D1Array<T>, D2Array<T>>

Calculates the eigenvalues and eigenvectors of a complex matrix

@JvmName(name = "eigF")
fun LinAlg.eig(mat: MultiArray<Float, D2>): Pair<D1Array<ComplexFloat>, D2Array<ComplexFloat>>

Calculates the eigenvalues and eigenvectors of a float matrix

Link copied to clipboard
@JvmName(name = "eigVals")
fun <T : Number> LinAlg.eigVals(mat: MultiArray<T, D2>): D1Array<ComplexDouble>

Calculates the eigenvalues of a numeric matrix.

@JvmName(name = "eigValsC")
fun <T : Complex> LinAlg.eigVals(mat: MultiArray<T, D2>): D1Array<T>
@JvmName(name = "eigValsF")
fun LinAlg.eigVals(mat: MultiArray<Float, D2>): D1Array<ComplexFloat>

Calculates the eigenvalues of a float matrix

Link copied to clipboard
@JvmName(name = "invD")
fun <T : Number> LinAlg.inv(mat: MultiArray<T, D2>): NDArray<Double, D2>

Returns inverse of a double matrix from numeric matrix

@JvmName(name = "invC")
fun <T : Complex> LinAlg.inv(mat: MultiArray<T, D2>): NDArray<T, D2>

Returns inverse complex matrix

@JvmName(name = "invF")
fun LinAlg.inv(mat: MultiArray<Float, D2>): NDArray<Float, D2>

Returns inverse float matrix

Link copied to clipboard
@JvmName(name = "normD")
fun LinAlg.norm(mat: MultiArray<Double, D2>, norm: Norm = Norm.Fro): Double

Returns norm of double matrix

@JvmName(name = "normF")
fun LinAlg.norm(mat: MultiArray<Float, D2>, norm: Norm = Norm.Fro): Float

Returns norm of float matrix

Link copied to clipboard
@JvmName(name = "pluD")
fun <T : Number> LinAlg.plu(mat: MultiArray<T, D2>): Triple<D2Array<Double>, D2Array<Double>, D2Array<Double>>

Returns PLU decomposition of the numeric matrix

@JvmName(name = "pluC")
fun <T : Complex> LinAlg.plu(mat: MultiArray<T, D2>): Triple<D2Array<T>, D2Array<T>, D2Array<T>>

Returns PLU decomposition of the complex matrix

@JvmName(name = "pluF")
fun LinAlg.plu(mat: MultiArray<Float, D2>): Triple<D2Array<Float>, D2Array<Float>, D2Array<Float>>

Returns PLU decomposition of the float matrix

Link copied to clipboard
@JvmName(name = "qrD")
fun <T : Number> LinAlg.qr(mat: MultiArray<T, D2>): Pair<D2Array<Double>, D2Array<Double>>

Returns QR decomposition of the numeric matrix

@JvmName(name = "qrC")
fun <T : Complex> LinAlg.qr(mat: MultiArray<T, D2>): Pair<D2Array<T>, D2Array<T>>

Returns QR decomposition of the complex matrix

@JvmName(name = "qrF")
fun LinAlg.qr(mat: MultiArray<Float, D2>): Pair<D2Array<Float>, D2Array<Float>>

Returns QR decomposition of the float matrix

Link copied to clipboard
@JvmName(name = "solveD")
fun <T : Number, D : Dim2> LinAlg.solve(a: MultiArray<T, D2>, b: MultiArray<T, D>): NDArray<Double, D>
@JvmName(name = "solveC")
fun <T : Complex, D : Dim2> LinAlg.solve(a: MultiArray<T, D2>, b: MultiArray<T, D>): NDArray<T, D>
@JvmName(name = "solveF")
fun <D : Dim2> LinAlg.solve(a: MultiArray<Float, D2>, b: MultiArray<Float, D>): NDArray<Float, D>

Solves a linear matrix equation, or system of linear scalar equations.