https://github.com/osqp/qdldl-python
Python interface to the QDLDL (https://github.com/osqp/qdldl) free LDL factorization routine for quasi-definite linear systems
https://github.com/osqp/qdldl-python
linear-algebra numerical-analysis numerical-optimization
Last synced: about 1 month ago
JSON representation
Python interface to the QDLDL (https://github.com/osqp/qdldl) free LDL factorization routine for quasi-definite linear systems
- Host: GitHub
- URL: https://github.com/osqp/qdldl-python
- Owner: osqp
- License: apache-2.0
- Created: 2019-04-24T03:18:42.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2025-11-24T15:00:39.000Z (about 2 months ago)
- Last Synced: 2025-12-07T11:29:17.630Z (about 1 month ago)
- Topics: linear-algebra, numerical-analysis, numerical-optimization
- Language: C
- Homepage:
- Size: 327 KB
- Stars: 15
- Watchers: 2
- Forks: 22
- Open Issues: 16
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# qdldl-python

Python interface to the [QDLDL](https://github.com/oxfordcontrol/qdldl/)
free LDL factorization routine for quasi-definite linear systems: `Ax =
b`.
## Installation
This package can be directly installed via pip,
```
pip install qdldl
```
## Usage
Initialize the factorization with
```
import qdldl
F = qdldl.Solver(A)
```
where `A` must be a square quasi-definite matrix in [scipy sparse CSC
format](https://docs.scipy.org/doc/scipy/reference/generated/scipy.sparse.csc_matrix.html).
The algorithm internally converts the matrix into upper triangular format. If `A` is already upper-triangular, you can specify it with the argument `upper=True` to the `qdldl.Solver` constructor.
To solve the linear system for a right-hand side `b`, just write
```
x = F.solve(b)
```
To update the factorization without changing the sparsity pattern of `A` you can run
```
F.update(A_new)
```
where `A_new` is a sparse matrix in CSR format with the same sparsity pattern as `A`.
The algorithm internally converts `A_new` into upper triangular format. If `A_new` is already upper-triangular, you can specify it with the argument `upper=True` to the `F.update` function.