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 None (auto) None = per-matrix auto predictor, capped at 4 workers; int = fixed (0 = all)
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.12.0.tar.gz (4.0 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.12.0-cp39-abi3-win_amd64.whl (1.4 MB view details)

Uploaded CPython 3.9+Windows x86-64

rslab-0.12.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.6 MB view details)

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

rslab-0.12.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.4 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ARM64

rslab-0.12.0-cp39-abi3-macosx_11_0_arm64.whl (1.3 MB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

rslab-0.12.0-cp39-abi3-macosx_10_12_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

File details

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

File metadata

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

File hashes

Hashes for rslab-0.12.0.tar.gz
Algorithm Hash digest
SHA256 3b79e504e2f8cf028a27bf6a969a4af2d89986aba320a8dd62c887f959062b01
MD5 2f9e995e297527fc077e9aaca1852acf
BLAKE2b-256 e8a30666c77c6165a5b9d98d0e137c4f43b4fd3e33ecfe47de59f9d9378202ba

See more details on using hashes here.

Provenance

The following attestation bundles were made for rslab-0.12.0.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.12.0-cp39-abi3-win_amd64.whl.

File metadata

  • Download URL: rslab-0.12.0-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 1.4 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.12.0-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 988e84f92372ce372e6e6ef274471feedfb5a45db43da09502a385926fd62e9c
MD5 9178d5d31e2cdb5219bad9a2443ef685
BLAKE2b-256 3740dbb093e3a1ed55f5d1782e557784b968c2300fa06c07b74dafa7e23a24cf

See more details on using hashes here.

Provenance

The following attestation bundles were made for rslab-0.12.0-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.12.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for rslab-0.12.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ff30780ea255cd79f0d0d5c4644ee6dfc23cd9820859e05e6a677268be3d1352
MD5 7d854d2b7539f65ec3c337838319dc36
BLAKE2b-256 668ab606da9cf5d253a9931bf09810b4a85e81ed2e553823ef15212b98f6e66e

See more details on using hashes here.

Provenance

The following attestation bundles were made for rslab-0.12.0-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.12.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for rslab-0.12.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 3c3945b2410abf32acb5052a684b627f0aec8afda28bd3ca5ab42c60a6676d31
MD5 c1e5cbd61854e87e68c1875e678e1fa5
BLAKE2b-256 df65b4cd545741c896713903c74ba448d6a74a08fbd7f3a549ba6f202101faa3

See more details on using hashes here.

Provenance

The following attestation bundles were made for rslab-0.12.0-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.12.0-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rslab-0.12.0-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ac391683484a52b132f6a54e348a208184d5539dd254d97b9ec1948febe2d7a9
MD5 cae539b8ce969581bc67eae7955e8b85
BLAKE2b-256 86101754ce78f714df35039c6fa035c1b5128aca5bc21a915796e0c9854e457a

See more details on using hashes here.

Provenance

The following attestation bundles were made for rslab-0.12.0-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.12.0-cp39-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for rslab-0.12.0-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 8809cbfe51315f17c3db68303a851e3a13367ca1c24972e63ea95e5334c1683a
MD5 96cd572fb7faf94392ed62d9376c2491
BLAKE2b-256 1d05b2d3efb249fa81ba859c49be260d7d4b5c0bd84b2d9256a3e6fa5eb2ba50

See more details on using hashes here.

Provenance

The following attestation bundles were made for rslab-0.12.0-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