pub trait ModelWithProblem {
// Required methods
fn vars(&self) -> Vec<Variable>;
fn orig_vars(&self) -> Vec<Variable>;
fn var(&self, var_id: VarId) -> Option<Variable>;
fn n_vars(&self) -> usize;
fn n_conss(&self) -> usize;
fn find_cons(&self, name: &str) -> Option<Constraint>;
fn conss(&self) -> Vec<Constraint>;
fn cons_is_modifiable(&self, cons: &Constraint) -> bool;
fn cons_is_removable(&self, cons: &Constraint) -> bool;
fn cons_is_separated(&self, cons: &Constraint) -> bool;
fn write(&self, path: &str, ext: &str) -> Result<(), Retcode>;
}Expand description
A trait for optimization models with a problem created.
Required Methods§
Sourcefn orig_vars(&self) -> Vec<Variable>
fn orig_vars(&self) -> Vec<Variable>
Returns a vector of all original variables in the optimization model.
Sourcefn var(&self, var_id: VarId) -> Option<Variable>
fn var(&self, var_id: VarId) -> Option<Variable>
Returns the variable with the given ID, if it exists.
Sourcefn find_cons(&self, name: &str) -> Option<Constraint>
fn find_cons(&self, name: &str) -> Option<Constraint>
Finds a constraint by name
Sourcefn conss(&self) -> Vec<Constraint>
fn conss(&self) -> Vec<Constraint>
Returns a vector of all constraints in the optimization model.
Sourcefn cons_is_modifiable(&self, cons: &Constraint) -> bool
fn cons_is_modifiable(&self, cons: &Constraint) -> bool
Returns the modifiable flag of the given constraint
Sourcefn cons_is_removable(&self, cons: &Constraint) -> bool
fn cons_is_removable(&self, cons: &Constraint) -> bool
Returns the removable flag of the given constraint
Sourcefn cons_is_separated(&self, cons: &Constraint) -> bool
fn cons_is_separated(&self, cons: &Constraint) -> bool
Returns whether the constraint should be separated during LP processing