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 (up to all cores); 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.11.4.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.4-cp39-abi3-win_amd64.whl (1.2 MB view details)

Uploaded CPython 3.9+Windows x86-64

rslab-0.11.4-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.4-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.4-cp39-abi3-macosx_11_0_arm64.whl (1.1 MB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

rslab-0.11.4-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.4.tar.gz.

File metadata

  • Download URL: rslab-0.11.4.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.4.tar.gz
Algorithm Hash digest
SHA256 bcaeebe74092638fce9d14bb77f21844f2537fab13549e1c20cb4f41d8da6677
MD5 eea34f29ebe2a73cce4a468603ee7e15
BLAKE2b-256 962d448174fb7ab57b1bc953e3d1a37012f6bf18504ccccf765c9e01c311bc87

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: rslab-0.11.4-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.4-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 f410ee8caa9480ee20ca87304ca66078d4e5c24bc32b8f2c0733ab87e4a9f3d9
MD5 d62e9d5c61cf1db9c4731c03fcd019e5
BLAKE2b-256 258ba80fa7c545bf751a19b876d5ab3a8adaa14c7cd644d262871e60312cb33f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rslab-0.11.4-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0b5cc43d87db0ee5dac1fc7d2fb3086d8d9b07d7f1031a763bb9cfd42dabb0cd
MD5 d64eed665802d94abfd991180fcefdee
BLAKE2b-256 ab8ce4be75d4d7a42cc798526e4c773fe69483f43a6fda47ccb5ff46b1459ff6

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rslab-0.11.4-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 b29c010324d83425729c37c22ca1da03482438445ebb992047d34fb741e35204
MD5 6dea95d716d77a4e561ca2a5c191b380
BLAKE2b-256 58479806ced7bd5ffc476c87b8af4360dd478ff6e6796587118faa7952ab137e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rslab-0.11.4-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 532cae721cbc37037f1bb382787be20a4c02053d1887ee1667ecf33d924fb6f3
MD5 b1db5012f6fce04e2c808f45c5e2f667
BLAKE2b-256 a0501916996fca4b6f3c5cc0aae1e82198724a791e2f61f82d22589123dc9fa1

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rslab-0.11.4-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 e6a17d02d20abaec938fefccf6981fe5d3298e825e21e54a4e99068d76f2d8c5
MD5 709fc61ed154b5cbd76853c0e5ec9ee1
BLAKE2b-256 8b30f2da15e6333027e4fcf7334118033ecf1fdf3d1ef335f075912ed61cf4fc

See more details on using hashes here.

Provenance

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