Registry / devops / tridiax

tridiax

JSON →
library0.2.1pypypi✓ verified 81d ago

A small Python library for efficiently solving tridiagonal systems of linear equations (Thomas algorithm). Current version 0.2.1, released with basic functionality and minimal API. Maintained as needed.

pip install tridiax
INSTALL
IMPORT
SIG · TRIDIAX
T
tridiax
devopspythonv0.2.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

thomas_solve
from tridiax import thomas_solve
from tridiax import solve
divide_and_conquer
from tridiax import divide_and_conquer
stone_solve
from tridiax import stone_solve

Solve a tridiagonal system using the Thomas algorithm.

import os import numpy as np from tridiax import solve # Example tridiagonal system: # [1 2 0] [x1] [5] # [3 4 5] [x2] = [10] # [0 6 7] [x3] [15] lower = np.array([3, 6], dtype=float) diag = np.array([1, 4, 7], dtype=float) upper = np.array([2, 5], dtype=float) rhs = np.array([5, 10, 15], dtype=float) solution = solve(lower, diag, upper, rhs) print(solution)
Debug
Known issues
breakingThe function `solve` may not be imported directly if version < 0.2.0. Older versions used a different module structure.
fix
Use `from tridiax import solve` for 0.2.0+.
affects: <0.2.0
gotchaThe input arrays must be of type `float` or will raise a TypeError. Using integer arrays fails silently in some numpy versions.
fix
Convert inputs to float via `np.array(..., dtype=float)`.
affects: all
gotchaThe `solve` function does not check for diagonal dominance or singularity. A singular system may produce incorrect results without error.
fix
Manually verify matrix condition before calling solve.
affects: all
deprecatedPassing keyword arguments for the individual diagonals is deprecated in 0.2.1; use positional arguments instead.
fix
Call `solve(lower, diag, upper, rhs)` with positional args.
affects: 0.2.1
Upgrade
Version history
0.2.1latest on PyPI · released Dec 5, 2024
Audit
Dependencies

No dependency data recorded yet.

Agent activity
11 hits · last 30 days
node
8
Resources

No resource links recorded.