Struct gurobi::model::Model [] [src]

pub struct Model<'a> {
    // some fields omitted
}

Gurobi Model

Methods

impl<'a> Model<'a>
[src]

fn new(env: &'a Env, model: *mut GRBmodel) -> Model<'a>

create an empty model which associated with certain environment.

fn update(&mut self) -> Result<()>

apply all modification of the model to process.

fn copy(&self) -> Result<Model>

create a copy of the model

fn optimize(&mut self) -> Result<()>

optimize the model.

fn write(&self, filename: &str) -> Result<()>

write information of the model to file.

fn add_var(&mut self, name: &str, vtype: VarType) -> Result<Var>

add a decision variable to the model.

fn add_constr(&mut self, name: &str, expr: LinExpr, sense: ConstrSense, rhs: f64) -> Result<Constr>

add a linear constraint to the model.

fn add_qconstr(&mut self, constrname: &str, expr: QuadExpr, sense: ConstrSense, rhs: f64) -> Result<QConstr>

add a quadratic constraint to the model.

fn add_sos(&mut self, vars: &[i32], weights: &[f64], sostype: SOSType) -> Result<SOS>

add Special Order Set (SOS) constraint to the model.

fn set_objective<Expr: Into<QuadExpr>>(&mut self, expr: Expr, sense: ModelSense) -> Result<()>

Set the objective function of the model.

fn get<A: Attr>(&self, attr: A) -> Result<A::Out>

Query the value of attributes which associated with variable/constraints.

fn set<A: Attr>(&mut self, attr: A, val: A::Out) -> Result<()>

Set the value of attributes which associated with variable/constraints.

fn get_values<A: AttrArray, P: Proxy>(&self, attr: A, item: &[P]) -> Result<Vec<A::Out>>

Query the value of attributes which associated with variable/constraints.

fn set_values<A: AttrArray, P: Proxy>(&mut self, attr: A, item: &[P], val: &[A::Out]) -> Result<()>

Set the value of attributes which associated with variable/constraints.

Trait Implementations

impl<'a> Drop for Model<'a>
[src]

fn drop(&mut self)

A method called when the value goes out of scope. Read more