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
//! Optimization algebraic modeling tools.
//!
//! These tools facilitate the construction, solution, and extraction of results
//! of optimization models.
//!
//! ## Example
//! ```
//! use numopt::model::*;
//! use numopt::solver::*;
//!
//! // Variables
//! let x = VariableScalar::new_continuous("x");
//! let y = VariableScalar::new_continuous("y");
//!
//! // Objective function
//! let f = 2.*&x - 5.*&y;
//!
//! // Constraints
//! let c1 = x.geq(100.);
//! let c2 = x.leq(200.);
//! let c3 = y.geq(80.);
//! let c4 = y.leq(170.);
//! let c5 = (&y + 2.*&x).equal(&x + 200.);
//!
//! // Model
//! let mut m = Model::new();
//! m.set_objective(Objective::minimize(&f));
//! m.add_constraint(&c1);
//! m.add_constraint(&c2);
//! m.add_constraint(&c3);
//! m.add_constraint(&c4);
//! m.add_constraint(&c5);
//!
//! // Solver
//! let mut s = SolverClpCmd::new();
//! s.set_param("logLevel", SolverParam::IntParam(0)).unwrap();
//! m.solve(&s).unwrap();
//!
//! // Status
//! assert_eq!(*m.solver_status().unwrap(), SolverStatus::Solved);
//!
//! // Primal results
//! let final_primals = m.final_primals();
//! assert_eq!(*final_primals.get(&x).unwrap(), 100.);
//! assert_eq!(f.evaluate(&final_primals), -300.);
//!
//! // Dual results
//! let final_duals = m.final_duals();
//! assert_eq!(*final_duals.get(&c1).unwrap(), 7.);
//! assert_eq!(*final_duals.get(&c5).unwrap(), -5.);
//! ```
pub use Node;
pub use NodeCmp;
pub use NodeBase;
pub use NodeFunc;
pub use NodeDiff;
pub use VariableScalar;
pub use ConstantScalar;
pub use Constraint;
pub use Model;
pub use Objective;