<commit_before>= Gurobi

This is a Gurobi Ruby binding based on C++ Gurobi API.

== Prerequisites

* Gurobi 5.5 installed and
  environment variable GUROBI_HOME is set (e.g. /opt/gurobi550/linux64).

== Installation

This package has not yet been registered at gem site so that
please do as follows:

1. download or 'git clone' like this:
    $ mkdir [YOUR_WORK_DIR]
    $ cd [YOUR_WORK_DIR]
    $ git clone https://github.com/fuminori-ido/gurobi.git
1. rake build
    $ cd gurobi
    $ rake build
1. install it
    $ gem install pkg/gurobi-N.NN.NN.gem      # replace N to actual version 

== Usage

Following model:

        x1, x2, x3 >=  0
                x3 <= 30
  2*x1 +   x2 + x3 <= 60
    x1 + 2*x2 + x3 <= 60
  maximize 15*x1 + 18*x2 + 30*x3

is written in following ruby code:

  require 'gurobi'
  
  model = Gurobi::Model.new(Gurobi::Env.new)
  x1    = model.addVar(0, Gurobi::INFINITY, 0, Gurobi::CONTINUOUS, 'x1')
  x2    = model.addVar(0, Gurobi::INFINITY, 0, Gurobi::CONTINUOUS, 'x2')
  x3    = model.addVar(0, 30,               0, Gurobi::CONTINUOUS, 'x3')
  model.update
  model.addConstr(2*x1 +   x2 + x3 <= 60)
  model.addConstr(  x1 + 2*x2 + x3 <= 60)
  model.setObjective(15*x1 + 18*x2 + 30*x3, Gurobi::MAXIMIZE)
  model.optimize
  print "val = ", model.get_double(Gurobi::DoubleAttr::OBJ_VAL), "\n"
  print "x1  = ", x1.get_double(Gurobi::DoubleAttr::X), "\n"
  print "x2  = ", x2.get_double(Gurobi::DoubleAttr::X), "\n"
  print "x3  = ", x3.get_double(Gurobi::DoubleAttr::X), "\n"

See {spec/}[../spec/] and {sample/}[../sample/] for more examples.

== Document

1. generate document by:
    $ rake yard
1. browse doc/frames.html

== TODO

* Some known memory leak exist.
* Client/Server model is not implemented.


== Contributing

1. Fork it ( https://github.com/[my-github-username]/gurobi/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request<commit_msg>update README.rdoc<commit_after>= Gurobi

This is a Gurobi Ruby binding based on C++ Gurobi API.

== Prerequisites

* C++(g++) is installed.
* Gurobi 5.5 is installed.
* Environment variable GUROBI_HOME is set (e.g. /opt/gurobi550/linux64).

== Installation

This package has not yet been registered at gem site so that
please do as follows:

1. download or 'git clone' like this:
    $ mkdir [YOUR_WORK_DIR]
    $ cd [YOUR_WORK_DIR]
    $ git clone https://github.com/fuminori-ido/gurobi.git
1. rake build
    $ cd gurobi
    $ rake build
1. install it
    $ gem install pkg/gurobi-N.NN.NN.gem      # replace N to actual version 

== Usage

Following model:

        x1, x2, x3 >=  0
                x3 <= 30
  2*x1 +   x2 + x3 <= 60
    x1 + 2*x2 + x3 <= 60
  maximize 15*x1 + 18*x2 + 30*x3

is written in following ruby code:

  require 'gurobi'
  
  model = Gurobi::Model.new(Gurobi::Env.new)
  x1    = model.addVar(0, Gurobi::INFINITY, 0, Gurobi::CONTINUOUS, 'x1')
  x2    = model.addVar(0, Gurobi::INFINITY, 0, Gurobi::CONTINUOUS, 'x2')
  x3    = model.addVar(0, 30,               0, Gurobi::CONTINUOUS, 'x3')
  model.update
  model.addConstr(2*x1 +   x2 + x3 <= 60)
  model.addConstr(  x1 + 2*x2 + x3 <= 60)
  model.setObjective(15*x1 + 18*x2 + 30*x3, Gurobi::MAXIMIZE)
  model.optimize
  print "val = ", model.get_double(Gurobi::DoubleAttr::OBJ_VAL), "\n"
  print "x1  = ", x1.get_double(Gurobi::DoubleAttr::X), "\n"
  print "x2  = ", x2.get_double(Gurobi::DoubleAttr::X), "\n"
  print "x3  = ", x3.get_double(Gurobi::DoubleAttr::X), "\n"

See {spec/}[../spec/] and {sample/}[../sample/] for more examples.

== Document

1. generate document by:
    $ rake yard
1. browse doc/frames.html

== TODO

* Some known memory leak exist.
* Client/Server model is not implemented.


== Contributing

1. Fork it ( https://github.com/fuminori-ido/gurobi/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request
{'fraction_non_alphanumeric': 0.14334305150631682, 'fraction_numerical': 0.04178814382896016, 'mean_word_length': 3.1128871128871127, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 5, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3889895', 'n_tokens_mistral': 1708, 'n_tokens_neox': 1596, 'n_words': 445}