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

Defined Under Namespace

Classes: ConflictSolver, Model, Problem

Constant Summary collapse

INF =

Useful for ranges

1.0 / 0.0
VERSION =
"0.3.9"

Class Method Summary collapse

Class Method Details

.add_all(variables) ⇒ Object



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

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