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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
//! # russcip
//! Safe Rust interface for SCIP.
//!
//! # Example
//! Model and solve an integer program.
//! ```rust
//! use russcip::model::Model;
//! use russcip::model::ObjSense;
//! use russcip::status::Status;
//! use russcip::variable::VarType;
//! use crate::russcip::model::ModelWithProblem;
//!
//!
//! // Create model
//! let mut model = Model::new()
//! .hide_output()
//! .include_default_plugins()
//! .create_prob("test")
//! .set_obj_sense(ObjSense::Maximize);
//!
//! // Add variables
//! let x1 = model.add_var(0., f64::INFINITY, 3., "x1", VarType::Integer);
//! let x2 = model.add_var(0., f64::INFINITY, 4., "x2", VarType::Integer);
//!
//! // Add constraints
//! model.add_cons(vec![x1.clone(), x2.clone()], &[2., 1.], -f64::INFINITY, 100., "c1");
//! model.add_cons(vec![x1.clone(), x2.clone()], &[1., 2.], -f64::INFINITY, 80., "c2");
//!
//! let solved_model = model.solve();
//!
//! let status = solved_model.get_status();
//! println!("Solved with status {:?}", status);
//!
//! let obj_val = solved_model.get_obj_val();
//! println!("Objective value: {}", obj_val);
//!
//! let sol = solved_model.get_best_sol().expect("No solution found");
//! let vars = solved_model.get_vars();
//!
//! for var in vars {
//! println!("{} = {}", &var.get_name(), sol.get_var_val(&var));
//! }
extern crate doc_comment;
doctest!;
/// Re-exports the `scip_sys` crate, which provides low-level bindings to the SCIP library.
pub use scip_sys as ffi;
/// Contains the `BranchRule` trait used to define custom branching rules.
/// Contains the `Constraint` struct, which represents a constraint in an optimization problem.
/// The main module, it contains the `Model` struct, which represents an optimization problem.
/// Contains the `Pricer` trait used to define custom variable pricing strategies.
/// Contains the `Retcode` enum, which represents the return codes of SCIP functions.
/// Contains the `Solution` struct, which represents a solution to an optimization problem.
/// Contains the `Status` enum, which represents the status of an optimization problem.
/// Contains the `Variable` struct, which represents a variable in an optimization problem.
/// Contains the `Node` struct, which represents a node in the branch-and-bound tree.
/// A macro for calling a `SCIP` function and returning an error if the return code is not `SCIP_OKAY`.
/// A macro for calling a `SCIP` function and panicking if the return code is not `SCIP_OKAY`.
/// A macro for calling a `SCIP` function and panicking with a custom message if the return code is not `SCIP_OKAY`.