papilo_rs/lib.rs
1#![deny(missing_docs)]
2//! Rust bindings for the PaPILO presolving library.
3//! # Example
4//! ```rust
5//! use papilo_rs::solver::{SolveResult, Solver};
6//! use papilo_rs::problem::Problem;
7//!
8//! let mut problem = Problem::new();
9//! let x = problem.add_col(1.0, 10.0, true, 10.0, "x1");
10//! problem.add_row("r1", &[(x, 1.0)], 2.5, f64::INFINITY);
11//!
12//! let mut solver = Solver::new();
13//! solver.load_problem(problem);
14//! let res = solver.start();
15//! assert_eq!(res.best_solution_objective(), 30.0);
16//! assert_eq!(res.solve_result(), SolveResult::Optimal);
17//! ```
18
19
20/// Contains wrappers for the Papilo_Problem struct and its methods.
21pub mod problem;
22/// Contains wrappers for the Papilo_Solver struct and its methods.
23pub mod solver;
24/// Re-export the FFI bindings to allow direct access to the underlying C functions.
25pub use papilo_sys as ffi;