Module: Cbc

Defined in:
lib/ruby-cbc.rb,
lib/ruby-cbc/model.rb,
lib/ruby-cbc/problem.rb,
lib/ruby-cbc/version.rb,
lib/ruby-cbc/conflict_solver.rb,
lib/ruby-cbc/utils/compressed_row_storage.rb

Defined Under Namespace

Modules: Util Classes: ConflictSolver, Model, Problem

Constant Summary collapse

INF =

Useful for ranges

1.0 / 0.0
VERSION =
"0.3.14"

Class Method Summary collapse

Class Method Details

.add_all(variables) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/ruby-cbc/model.rb', line 4

def self.add_all(variables)
  to_add = variables.map do |variable|
    case variable
    when Numeric, Ilp::Term
      variable
    when Ilp::Var
      Ilp::Term.new(variable)
    else
      raise "Not a variable, a term or a numeric"
    end
  end
  Ilp::TermArray.new(to_add)
end