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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
//! # russcip
//! Safe Rust interface for SCIP.
//!
//! # Example
//! Model and solve an integer program.
//! ```rust
//! use russcip::prelude::*;
//!
//! // 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.status();
//! println!("Solved with status {:?}", status);
//!
//! let obj_val = solved_model.obj_val();
//! println!("Objective value: {}", obj_val);
//!
//! let sol = solved_model.best_sol().expect("No solution found");
//! let vars = solved_model.vars();
//!
//! for var in vars {
//! println!("{} = {}", &var.name(), sol.val(var));
//! }
extern crate core;
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.
pub use *;
/// Contains the `Constraint` struct, which represents a constraint in an optimization problem.
pub use *;
/// The main module, it contains the `Model` struct, which represents an optimization problem.
pub use *;
/// Contains the `Pricer` trait used to define custom variable pricing strategies.
pub use *;
/// Contains the `Retcode` enum, which represents the return codes of SCIP functions.
pub use *;
/// Contains the `Solution` struct, which represents a solution to an optimization problem.
pub use *;
/// Contains the `Status` enum, which represents the status of an optimization problem.
pub use *;
/// Contains the `Variable` struct, which represents a variable in an optimization problem.
pub use *;
/// Contains the `Node` struct, which represents a node in the branch-and-bound tree.
pub use *;
/// Contains the `EventHdlr` trait used to define custom event handlers.
pub use *;
/// Contains the `Heur` trait used to define custom primal heuristics.
pub use *;
/// Contains all the traits and structs that are re-exported by default.
/// 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`.