pub struct Model { /* private fields */ }
Expand description
Representation of a linear program.
Implementations§
Source§impl Model
impl Model
Sourcepub fn new(name: &str, objective: Objective) -> Self
pub fn new(name: &str, objective: Objective) -> Self
Creates a new Model
. A representation of a linear program.
Sourcepub fn update(&mut self) -> &mut Self
pub fn update(&mut self) -> &mut Self
Submits the registered variables or constraints to the Model
and changes it’s phase to the next.
This method can be called implicitly by calling reg_constr
or optimize
.
The Model
’s lifetime follows three strictly seperated phases:
- In the first phase, variables can be registered.
- In the second phase, constraints can be registered.
- In the third phase, the
Model
can be optimized.
After the variables or constraints are submitted to the Model
, they can not be changed again (The phases can not be reverted or modified).
Sourcepub fn reg_var_with_name(&mut self, objective_value: f64, name: &str) -> Var
pub fn reg_var_with_name(&mut self, objective_value: f64, name: &str) -> Var
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Model
impl RefUnwindSafe for Model
impl Send for Model
impl Sync for Model
impl Unpin for Model
impl UnwindSafe for Model
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more