sparse_compute
Solve, multiply, transpose, and compute norms, eigenvalues, or singular values of sparse matrices, accepting triplet dicts, Matrix Market files, or dense lists.
Instructions
Compute with sparse matrices: info, solve, matmul, transpose, norm, eigsh or svds.
``a`` accepts ``{"rows", "cols", "values", "shape"}`` triplets, an
``@<path>.mtx`` Matrix Market file, or a dense two-dimensional list.
``b`` (solve/matmul) accepts a dense vector/matrix, a sparse triplet dict,
or an ``@<path>`` reference to .mtx/.npy/.csv/.tsv/.txt/.json data.
``solver`` applies to ``operation="solve"`` only: ``"direct"`` (default,
``spsolve``), ``"cg"`` (symmetric positive definite) or ``"gmres"``
(general square). Iterative solvers use a Jacobi preconditioner when every
diagonal entry is non-zero, honour ``tol`` as the relative residual
tolerance and ``maxiter`` as the iteration cap. Passing a non-direct
``solver`` with another operation returns ``err``. Solve results include
``"solver"``, ``"iterations"`` (``null`` for direct) and ``"residual"``
(``max(abs(a @ x - b))``).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| a | Yes | ||
| b | No | ||
| k | No | ||
| tol | No | ||
| solver | No | direct | |
| maxiter | No | ||
| operation | Yes |