herculesabqp 0.1.2

A convex box-constrained quadratic programming solver with warm starts and active-set polishing.
Documentation
use herculesabqp::matrix::QuadraticMatrix;
use herculesabqp::solver::{solve_box_qp, SolverOptions};
use ndarray::Array2;

fn main() {
    let q = QuadraticMatrix::dense(
        Array2::from_shape_vec((3, 3), vec![4.0, 1.0, 0.0, 1.0, 3.0, 0.0, 0.0, 0.0, 2.0])
            .expect("Q should be a valid dense matrix"),
    );
    let c = vec![-1.0, -0.5, -0.25];
    let lb = vec![0.0, 0.0, 0.0];
    let ub = vec![1.0, 1.0, 1.0];

    let mut options = SolverOptions::default();
    options.assume_symmetric = true;

    let result =
        solve_box_qp(&q, &c, &lb, &ub, &options).expect("failed to solve explicit box QP");

    println!("objective = {:.8}", result.objective);
    println!("x = {:?}", result.x);
}