papilo-rs

Crates.iopapilo-rs
lib.rspapilo-rs
version0.1.1
created_at2025-07-24 16:22:45.393794+00
updated_at2025-07-24 16:48:37.733364+00
descriptionRust bindings for the PaPILO library
homepage
repositoryhttps://github.com/mmghannam/papilo-sys
max_upload_size
id1766265
size31,514
Mohammed Ghannam (mmghannam)

documentation

README

papilo-rs

Rust bindings for the PaPILO (Parallel Presolve for Integer and Linear Optimization) library.

Usage

Add this crate to your project by running:

cargo add papilo-rs

Example

Then, you can use it in your Rust code as follows:

use papilo_rs::{Solver, Problem};

fn main() {
    let mut problem = Problem::new();
    let x = problem.add_col(1.0, 10.0, true, 10.0, "x1");
    problem.add_row("r1", &[(x, 1.0)], 2.5, f64::INFINITY);

    let mut solver = Solver::new();
    solver.load_problem(problem);
    assert!(
        !solver.raw.is_null(),
        "Solver instance should not be null after loading problem with integer columns"
    );
    let res = solver.start();
    assert_eq!(res.dualbound, 30.0);
}

License

This project is licensed under the Apache License 2.0. See the LICENSE file for details.

Commit count: 0

cargo fmt