[][src]Struct gurobi::Callback

pub struct Callback<'a> { /* fields omitted */ }

The context object for Gurobi callback.

Methods

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

pub fn get_where(&self) -> Where[src]

Retrieve the location where the callback called.

pub fn get_node_rel(&self, vars: &[Var]) -> Result<Vec<f64>>[src]

Retrive node relaxation solution values at the current node.

pub fn get_solution(&self, vars: &[Var]) -> Result<Vec<f64>>[src]

Retrieve values from the current solution vector.

pub fn set_solution(&self, vars: &[Var], solution: &[f64]) -> Result<()>[src]

Provide a new feasible solution for a MIP model.

pub fn get_runtime(&self) -> Result<f64>[src]

Retrieve the elapsed solver runtime [sec].

pub fn add_cut(&self, lhs: LinExpr, sense: ConstrSense, rhs: f64) -> Result<()>[src]

Add a new cutting plane to the MIP model.

pub fn add_lazy(&self, lhs: LinExpr, sense: ConstrSense, rhs: f64) -> Result<()>[src]

Add a new lazy constraint to the MIP model.

Methods from Deref<Target = Model>

pub fn copy(&self) -> Result<Model>[src]

create a copy of the model

pub fn fixed(&self) -> Result<Model>[src]

Create an fixed model associated with the model.

In fixed model, each integer variable is fixed to the value that it takes in the original MIP solution. Note that the model must be MIP and have a solution loaded.

pub fn relax(&self) -> Result<Model>[src]

Create an relaxation of the model (undocumented).

pub fn presolve(&self) -> Result<Model>[src]

Perform presolve on the model.

pub fn feasibility(&self) -> Result<Model>[src]

Create a feasibility model (undocumented).

pub fn get_env(&self) -> &Env[src]

Get immutable reference of an environment object associated with the model.

pub fn sync(&self) -> Result<()>[src]

Wait for a optimization called asynchronously.

pub fn terminate(&self)[src]

Send a request to the model to terminate the current optimization process.

pub fn reset(&self) -> Result<()>[src]

Reset the model to an unsolved state.

All solution information previously computed are discarded.

pub fn tune(&self) -> Result<()>[src]

Perform an automated search for parameter settings that improve performance on the model. See also references on official manual.

pub fn get_tune_result(&self, n: i32) -> Result<()>[src]

Prepare to retrieve the results of tune(). See also references on official manual.

pub fn get_concurrent_env(&self, num: i32) -> Result<Env>[src]

Deprecated

Create/retrieve a concurrent environment for the model

Note that the number of concurrent environments (num) must be contiguously numbered.

Example

This example is not tested
let env1 = model.get_concurrent_env(0).unwrap();
let env2 = model.get_concurrent_env(1).unwrap();
let env3 = model.get_concurrent_env(2).unwrap();
...

pub fn discard_concurrent_envs(&self)[src]

Deprecated

Discard all concurrent environments for the model.

pub fn message(&self, message: &str)[src]

Insert a message into log file.

When message cannot convert to raw C string, a panic is occurred.

pub fn write(&self, filename: &str) -> Result<()>[src]

Export optimization data of the model to a file.

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

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

pub fn get_values<A: AttrArray, P>(
    &self,
    attr: A,
    item: &[P]
) -> Result<Vec<A::Out>> where
    P: Deref<Target = Proxy>, 
[src]

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

pub fn status(&self) -> Result<Status>[src]

Retrieve the status of the model.

pub fn get_vars(&self) -> Iter<Var>[src]

Retrieve an iterator of the variables in the model.

pub fn get_constrs(&self) -> Iter<Constr>[src]

Retrieve an iterator of the linear constraints in the model.

pub fn get_qconstrs(&self) -> Iter<QConstr>[src]

Retrieve an iterator of the quadratic constraints in the model.

pub fn get_sos(&self) -> Iter<SOS>[src]

Retrieve an iterator of the special order set (SOS) constraints in the model.

pub fn get_coeff(&self, var: &Var, constr: &Constr) -> Result<f64>[src]

Retrieve a single constant matrix coefficient of the model.

Trait Implementations

impl<'a> Deref for Callback<'a>[src]

type Target = Model

The resulting type after dereferencing.

Auto Trait Implementations

impl<'a> !RefUnwindSafe for Callback<'a>

impl<'a> !Send for Callback<'a>

impl<'a> !Sync for Callback<'a>

impl<'a> Unpin for Callback<'a>

impl<'a> !UnwindSafe for Callback<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.