1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
//! # Rustplex
//!
//! `rustplex` is a linear programming (LP) solver written in Rust, designed with ergonomics and correctness in mind.
//! It provides a type-safe API for modeling optimization problems and solving them using the Simplex algorithm.
//!
//! ## Key Features
//!
//! * **Ergonomic API:** Use standard Rust operators (`+`, `-`, `*`) to build linear expressions naturally.
//! * **Type Safety:** Strongly typed keys (`VariableKey`, `ConstraintKey`) prevent mixing up variables and constraints.
//! * **Builder Pattern:** Fluent interface for defining variables and constraints.
//! * **Encapsulation:** Solvers are isolated from the model definition, allowing for future expansion (e.g., Integer Programming).
//!
//! ## Quick Start
//!
//! Add `rustplex` to your `Cargo.toml`. Then, you can define and solve a problem like this:
//!
//! ```rust
//! use rustplex::prelude::*;
//!
//! fn main() -> Result<(), SolverError> {
//! // 1. Create a model
//! let mut model = Model::new();
//!
//! // 2. Define variables
//! let x1 = model.add_variable().name("x1").non_negative().continuous();
//! let x2 = model.add_variable().name("x2").bounds(0.0..=10.0).continuous();
//!
//! // 3. Set objective: Maximize x1 + x2
//! model.set_objective(Maximize, x1 + x2);
//!
//! // 4. Add constraints
//! // 2*x1 + x2 <= 10
//! model.add_constraint(2.0 * x1 + x2).le(10.0);
//!
//! // 5. Solve
//! let solution = model.solve()?;
//!
//! if solution.status() == &SolverStatus::Optimal {
//! println!("Objective Value: {}", solution.objective_value().unwrap());
//! println!("x1: {}", solution[x1]);
//! println!("x2: {}", solution[x2]);
//! }
//!
//! Ok(())
//! }
//! ```
// --- Internal Modules ---
// --- Public Modules ---
// --- API Re-exports ---
pub use crateLinearExpr;
pub use crate;
pub use crateModel;
pub use crate;
pub use crate;
pub use crateSolverConfig;
pub use crateSolverSolution;
pub use crateSolverStatus;