Skip to main content

Pure-Rust sparse direct solver (symmetric LDLᵀ + unsymmetric LU) and preconditioner, with NumPy/SciPy bindings.

Project description

rslab (Python bindings)

NumPy/SciPy bindings for RSLAB, a pure-Rust sparse direct solver and preconditioner: complex/real symmetric LDLᵀ (Bunch-Kaufman) plus unsymmetric LU. A thin wrapper, all numeric work happens in Rust.

Install

pip install rslab

Usage

import numpy as np
import scipy.sparse as sp
import rslab

# Symmetric system (real or complex; the dtype selects the path).
A = sp.random(5000, 5000, density=1e-3, format="csc") + sp.eye(5000) * 10
A = A + A.T
b = np.random.rand(5000)

# One-shot solve.
x = rslab.spsolve(A, b)

# Factor once, solve many right-hand sides.
f = rslab.ldlt(A)
x1 = f.solve(b)
X = f.solve_many(np.random.rand(5000, 8))   # n x nrhs

print(f.n, f.factor_nnz, f.inertia, f.dtype)

Complex-symmetric matrices (EM/FEM, PARDISO mtype 6) work identically:

A = A.astype(np.complex128); A.data += 1j * 0.3 * A.data.real
x = rslab.ldlt(A).solve(np.ones(A.shape[0], dtype=np.complex128))

Unsymmetric matrices use the LU path:

f = rslab.lu(A_general)
x = f.solve(b)

Preconditioner mode

Never-fail static pivoting plus iterative refinement for hard/indefinite systems:

f = rslab.ldlt(A, preconditioner=1e-4)
x = f.solve(b, refine=20)        # refine against the original A

Configuration (keyword arguments)

ldlt, lu and spsolve accept:

kwarg default meaning
threads 2 worker-thread budget (0 = all cores); result is bit-identical
preconditioner None static-pivot floor (e.g. 1e-4); never-fail, refine to solve
drop_tol None incomplete-factor threshold (preconditioner)
method "left_looking" "left_looking" or "multifrontal"
memory "low" "low" or "eager" factor emit strategy
force_accept False accept tiny pivots in exact mode instead of failing

Supported dtypes: float64, float32, complex128, complex64.

License

MIT.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rslab-0.11.3.tar.gz (1.6 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

rslab-0.11.3-cp39-abi3-win_amd64.whl (1.2 MB view details)

Uploaded CPython 3.9+Windows x86-64

rslab-0.11.3-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ x86-64

rslab-0.11.3-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.3 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ARM64

rslab-0.11.3-cp39-abi3-macosx_11_0_arm64.whl (1.1 MB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

rslab-0.11.3-cp39-abi3-macosx_10_12_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

File details

Details for the file rslab-0.11.3.tar.gz.

File metadata

  • Download URL: rslab-0.11.3.tar.gz
  • Upload date:
  • Size: 1.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for rslab-0.11.3.tar.gz
Algorithm Hash digest
SHA256 92def8a3e3f4602a8ee1b7994e4e750c770c86c57009af90e57e5223396d027c
MD5 bc8f8f21615f25ee662a46324b0a7d5a
BLAKE2b-256 ea13634c3e5e5f94c2152ec8c88aa8c2da5096ec6cc1ee9fd71172bd22bf996d

See more details on using hashes here.

Provenance

The following attestation bundles were made for rslab-0.11.3.tar.gz:

Publisher: publish.yml on milanofthe/rslab

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rslab-0.11.3-cp39-abi3-win_amd64.whl.

File metadata

  • Download URL: rslab-0.11.3-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: CPython 3.9+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for rslab-0.11.3-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 7baa4fdd5c236e8301e27327be0ed858455c29df3b2907068600b0362157a46e
MD5 45da60c672f605866f47c8cbc94e9a59
BLAKE2b-256 6a2413b4f1dd53214dbff09d17eae3e36558f568d3a95df1517b82a990838e74

See more details on using hashes here.

Provenance

The following attestation bundles were made for rslab-0.11.3-cp39-abi3-win_amd64.whl:

Publisher: publish.yml on milanofthe/rslab

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rslab-0.11.3-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for rslab-0.11.3-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 bbae87459b7cd99a2a16f6d4e65066787a1886716ae9a62ce58bd45512088b33
MD5 964dcb027eb649bf468415723be6f7c9
BLAKE2b-256 a9d9000d22dd92810c4b84c79b7988ec9e1bfa331f3576e017c231aab223e6d9

See more details on using hashes here.

Provenance

The following attestation bundles were made for rslab-0.11.3-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: publish.yml on milanofthe/rslab

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rslab-0.11.3-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for rslab-0.11.3-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 bb8920c677a7af8979892f482573a78f4682c80a053b4b7343a1bc345fee941c
MD5 380484340860f4729ef3e11a454a9911
BLAKE2b-256 27c2c42e792748b119a999e1098ee6336fab4e1f50161d1d5e5f8a27178758a7

See more details on using hashes here.

Provenance

The following attestation bundles were made for rslab-0.11.3-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: publish.yml on milanofthe/rslab

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rslab-0.11.3-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rslab-0.11.3-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b4b846e4a4747bacd4ce27b299e4c03a3b89fa2b27d94eef50a4c0aa16c32747
MD5 284fd66c2c51e2f1f00022379967fe36
BLAKE2b-256 cb6ccef241e53e94cea3a163c7a480a7c963b2ed37bc515f10add9b4624ab702

See more details on using hashes here.

Provenance

The following attestation bundles were made for rslab-0.11.3-cp39-abi3-macosx_11_0_arm64.whl:

Publisher: publish.yml on milanofthe/rslab

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rslab-0.11.3-cp39-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for rslab-0.11.3-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 ddd36a7065ec643344292aa1986ba10246c71747edf8a04b1162dc77358a8b57
MD5 fa1f56b1a55030cb82af1f5252f11673
BLAKE2b-256 cead73e15babfee470e2f05c8b92af6c6332645d3fba162b5b594d7e42686275

See more details on using hashes here.

Provenance

The following attestation bundles were made for rslab-0.11.3-cp39-abi3-macosx_10_12_x86_64.whl:

Publisher: publish.yml on milanofthe/rslab

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page