gurobi 0.1.8

An unofficial Rust API for Gurobi optimizer
docs.rs failed to build gurobi-0.1.8
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: gurobi-0.3.4

rust-gurobi

An unofficial Rust API for Gurobi optimizer.

Notices

  • This wrapper library is not officially supported by Gurobi.
  • Too many works have not finished yet.

Installation

Fix your Cargo.toml as follows:

[dependencies]
gurobi = "0.1.7"

Example

extern crate gurobi;
use gurobi::*;

fn main() {
  let env = Env::new("logfile.log").unwrap();

  // create an empty model which associated with `env`:
  let mut model = env.new_model("model1").unwrap();

  // add decision variables.
  let x = model.add_var("x", Binary).unwrap();
  let y = model.add_var("y", Continuous(-10,0, 10.0)).unwrap();
  // ...

  // integrate all the variables into the model.
  model.update().unwrap();

  // add a linear constraint
  model.add_constr("c0", x - y + 2.0*z, Equal, 0.0).unwrap();
  // ...

  // optimize the model. 
  model.optimize().unwrap();

  let status = model.get(attr::Status).unwrap();

  let x = x.get(&model, attr::X).unwrap();
  let y = y.get(&model, attr::X).unwrap();
  // ...
}

License

Copyright (c) 2016, Yusuke Sasaki

This software is released under the MIT license, see LICENSE.