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 0 (all cores) worker-thread budget; 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.2.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.2-cp39-abi3-win_amd64.whl (1.2 MB view details)

Uploaded CPython 3.9+Windows x86-64

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

Uploaded CPython 3.9+macOS 11.0+ ARM64

rslab-0.11.2-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.2.tar.gz.

File metadata

  • Download URL: rslab-0.11.2.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.2.tar.gz
Algorithm Hash digest
SHA256 6ca980ad47405e13ec7e2bf0ce83bba76a202e4ae86d4c03cb93aefec90f8a79
MD5 8f795e4b482af9caf586ad3c2286fb24
BLAKE2b-256 ab3daeaea7d0aca519dfe7d979da32d31115cda9f86dfd24c55d37fb87cbe05a

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: rslab-0.11.2-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.2-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 9adfdebc7adf765a8ce8bfed73c9b0bd5c2799bdd40b033d694beff0ec494240
MD5 f4e887f681c1df52bcadeb109f8a8c51
BLAKE2b-256 a69562cfe01bdd6fabf356db2e2a3d49e8ca1a8bc5d4466e1667c532347b1102

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rslab-0.11.2-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 97a8376f1f6ab7518ff0f8a2794edb35d72d5ac7522045f411e6cf3d9682cc2d
MD5 4730da09d5bc136df9310b81fe6da65a
BLAKE2b-256 282eb70d21ee73a30501851db1de2f4340dedc4718ff1e876df4a75d07f3b49a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rslab-0.11.2-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 c4ae2f279db8d139ecba02cbaeaa530b5b677e27c8d9ad8509b3f7231b155327
MD5 d337158fab8002e4bbd61794aa7b52ce
BLAKE2b-256 7af73fa9f115b1f5ccb5a1f862514f5c5af813bc328d51d0af358ca287ab2d84

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rslab-0.11.2-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 55234364570ecd85c1202ca787029b711b5110b2ab7c016f576d482102bb5e2e
MD5 df3ccb6bab6fd05705dbfb281eff0240
BLAKE2b-256 ab33453583a020af2eb3aede5b1aedf2eca5d10601de763d8eb09bc19f8dfd10

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rslab-0.11.2-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 88d13957411e355c31677501edb1034e1f2f499c9e4514cf496ed982d8064cc7
MD5 cde503ea297b76c292fef20b4b508247
BLAKE2b-256 7ce1f2d32b7538a53a932f24af24f143dbb02a8c109f7d94ce258c65928c783a

See more details on using hashes here.

Provenance

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