Skip to content

awinick/splitqp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

splitqp

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

$$ \min_x \tfrac12 x^T P x + q^T x \quad \text{subject to} \quad l \le Ax \le u. $$

The crate is built around a small validated problem interface, explicit solver state, and a modular linear-system backend for KKT solves.

Status

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

Problem form

splitqp targets problems of the form

$$ \min_x \tfrac12 x^T P x + q^T x \quad \text{subject to} \quad l \le Ax \le u, $$

where:

  • P is a symmetric quadratic cost matrix
  • q is a linear cost vector
  • A is a constraint matrix
  • l and u are lower and upper bounds on the affine constraints

This corresponds to box constraints on the transformed variable Ax.

Design goals

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.

Example

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:?}");
}

About

An operator-splitting solver in pure Rust

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages