API reference#
Generated from the docstrings of the compiled module. Most functions are overloaded once per element type; the signatures list every overload.
Containers and conversion#
Overloaded function. |
|
Overloaded function. |
|
Overloaded function. |
|
Element dtypes accepted by convert() and the mixed-precision operations. |
|
mtl5.DenseVector and mtl5.DenseMatrix are aliases of the float64
classes above. Every other element type has the same pair of classes with a
different suffix, such as DenseMatrix_posit16. mtl5.dtypes() lists the
suffixes.
Dense linear algebra#
Overloaded function. |
|
Overloaded function. |
|
Overloaded function. |
|
Matrix-vector multiplication: y = A @ x |
|
Overloaded function. |
|
Overloaded function. |
|
Householder QR of a tall-or-square matrix (num_rows >= num_cols). |
|
Cholesky factorization A = L L^T of a symmetric positive definite matrix. |
|
LDL^T factorization of a symmetric matrix. |
|
Singular value decomposition, returned as (U, s, V) with s the vector of singular values (NumPy's convention, not MTL5's diagonal matrix) |
|
Eigenvalues and right eigenvectors of a general square matrix, as (w, V) complex arrays with V's columns the eigenvectors |
|
Eigenvalues and eigenvectors of a symmetric matrix, as (w, Q) with A = Q diag(w) Q^T |
|
Overloaded function. |
|
Compute the determinant of a matrix via LU factorization. |
|
2-norm condition number sigma_max/sigma_min via SVD. |
Sparse matrices and direct solvers#
Construct an MTL5 CSR sparse matrix directly from the three CSR arrays. |
|
Construct an MTL5 COO matrix from scipy-style (row, col, data) triplets. |
|
Convert a scipy.sparse matrix (any format) to an MTL5 SparseMatrix. |
|
Convert an MTL5 sparse matrix back to scipy.sparse. |
|
LU-factorize a square sparse matrix (Gilbert-Peierls, threshold pivoting). |
|
Factor a square sparse matrix with native KLU. |
|
Cholesky factorization A = L L^T of a symmetric positive definite matrix. |
|
LDL^T factorization of a symmetric matrix. |
|
Householder QR for sparse linear least squares. |
|
Supernodal LU: columns grouped into supernodes, applied as dense blocks. |
|
Supernodal LDL^T of a symmetric matrix, using dense block updates. |
|
Fill-reducing orderings accepted by the sparse factorizations |
|
Return a fill-reducing permutation of A as an int64 array. |
|
Approximate minimum degree ordering on the pattern of A + A^T. |
|
Column approximate minimum degree ordering on the pattern of A^T A. |
|
Reverse Cuthill-McKee (bandwidth-reducing) ordering. |
|
Nested dissection ordering on the pattern of A + A^T. |
|
Sparse iterative solvers#
Conjugate Gradient, for symmetric positive definite systems. |
|
GMRES with restarts, for general non-symmetric systems. |
|
BiCGSTAB, for general non-symmetric systems. |
|
MINRES, for symmetric systems that may be indefinite — where CG does not apply. |
|
Solve |
|
Incomplete LU factorization with no fill-in. |
|
Incomplete Cholesky factorization with no fill-in (SPD matrices only). |
|
Incomplete LU with a drop threshold |
Mixed precision#
Overloaded function. |
|
Solve A x = b by factoring in |
|
Overloaded function. |
|
Overloaded function. |
|
Accumulators available for an element dtype (None is always valid and means 'accumulate in the element precision') |
Input and output#
Read a Matrix Market file into a sparse (CSR) matrix. |
|
Write a dense matrix in Matrix Market |
|
Binary non-zero pattern as a grayscale PNG (MATLAB |
|
Colour each non-zero by |
|
Colour each pixel by how many non-zeros landed in it. |