Skip to content

Python interface to the QDLDL (https://github.com/osqp/qdldl) free LDL factorization routine for quasi-definite linear systems

License

Notifications You must be signed in to change notification settings

osqp/qdldl-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

076e203 · Jan 16, 2025
Jan 16, 2025
May 8, 2024
Jun 9, 2023
Jun 9, 2023
Jan 11, 2020
May 11, 2020
Apr 4, 2023
Jan 3, 2020
Jun 10, 2020
Jan 4, 2021
Jun 19, 2024
Jan 2, 2025

Repository files navigation

qdldl-python

github actions

Python interface to the 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.

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.