Skip to main content

LPModel

Trait LPModel 

Source
pub trait LPModel<Constr, Var, Env: LPEnv>: Sized {
    // Required methods
    fn new(name: &str, env: &mut Env) -> Self;
    fn get_dual_list(&self, constrs: &[Constr]) -> Vec<f64>;
    fn get_x_list(&self, vars: &[Var]) -> Vec<f64>;
    fn get_objective(&self) -> f64;
    fn get_runtime(&self) -> f64;
    fn get_num_solutions(&self) -> i32;
    fn optimize(&mut self);
}
Expand description

Trait for a linear programming model Panics on errors

Required Methods§

Source

fn new(name: &str, env: &mut Env) -> Self

Source

fn get_dual_list(&self, constrs: &[Constr]) -> Vec<f64>

Source

fn get_x_list(&self, vars: &[Var]) -> Vec<f64>

Source

fn get_objective(&self) -> f64

Source

fn get_runtime(&self) -> f64

Source

fn get_num_solutions(&self) -> i32

Source

fn optimize(&mut self)

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl LPModel<Constr, Var, GurobiEnv> for Model

Source§

fn new(name: &str, env: &mut GurobiEnv) -> Self

Source§

fn get_dual_list(&self, constrs: &[Constr]) -> Vec<f64>

Source§

fn get_x_list(&self, vars: &[Var]) -> Vec<f64>

Source§

fn get_objective(&self) -> f64

Source§

fn get_runtime(&self) -> f64

Source§

fn get_num_solutions(&self) -> i32

Source§

fn optimize(&mut self)

Implementors§