An operator-splitting solver for convex quadratic programs in pure Rust.
splitqp is an experimental Rust library for solving convex quadratic programs of the form
The crate is built around a small validated problem interface, explicit solver state, and a modular linear-system backend for KKT solves.
splitqp is an early-stage project and is not yet production-ready.
The current implementation includes:
- validated quadratic program construction
- a configurable ADMM-style solver loop
- a dense LU-based KKT solve backend
- residual tracking and convergence checks
- a modular architecture intended to support additional linear-system backends
Planned work includes:
- improved status and result reporting
- adaptive step-size updates
- infeasibility detection
- sparse / alternative KKT backends
- more examples, tests, and benchmarks
splitqp targets problems of the form
where:
Pis a symmetric quadratic cost matrixqis a linear cost vectorAis a constraint matrixlanduare lower and upper bounds on the affine constraints
This corresponds to box constraints on the transformed variable Ax.
The project aims to be:
-
Pure Rust
No Python or C dependency layer. -
Readable
The solver structure should reflect the algorithm directly. -
Modular
Problem data, solver state, configuration, and linear algebra backends are separated cleanly. -
Practical
The API is intended for real optimization workflows, not only toy examples.
use splitqp::{Config, Problem, Solver};
use nalgebra::{matrix, vector};
fn main() {
let p = matrix![
4.0, 1.0;
1.0, 2.0
];
let q = vector![1.0, 1.0];
let a = matrix![
1.0, 1.0;
1.0, 0.0;
0.0, 1.0
];
let l = vector![1.0, 0.0, 0.0];
let u = vector![1.0, 0.7, 0.7];
let problem = Problem::new(p, q, a, l, u).unwrap();
let config = Config::default();
let mut solver = Solver::new(&problem, &config);
let result = solver.solve();
println!("{result:?}");
}