Linear algebra
Overview
The mk.linalg entry point provides linear algebra operations on 2D matrices and 1D vectors. Functions are defined in the LinAlg and LinAlgEx interfaces; convenience extension functions and infix operators are also available.
Most functions accept Number, Float, and Complex types through separate overloads. Numeric overloads typically return Double results; float overloads preserve Float precision.
Operations
Operation | Function | Description |
|---|---|---|
| Matrix-matrix, matrix-vector, or vector-vector product. | |
| Inverse of a square matrix. | |
| Raise a square matrix to an integer power. | |
| Decompose into orthogonal Q and upper-triangular R. | |
| Decompose into permutation P, lower-triangular L, upper-triangular U. | |
| Singular value decomposition (experimental). | |
| Eigenvalues and eigenvectors. | |
| Eigenvalues without eigenvectors. | |
| Solve a linear system Ax = b. | |
| Matrix or vector norm (Frobenius, 1-norm, infinity, max). |
Type support
Each operation has up to three overloads:
Overload | Input type | Output type |
|---|---|---|
Default |
|
|
Float ( |
|
|
Complex ( |
|
|