Class: ORTools::SatLinearExpr

Inherits:
Object
  • Object
show all
Includes:
ComparisonOperators
Defined in:
lib/or_tools/sat_linear_expr.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(vars = []) ⇒ SatLinearExpr

Returns a new instance of SatLinearExpr.



7
8
9
# File 'lib/or_tools/sat_linear_expr.rb', line 7

def initialize(vars = [])
  @vars = vars
end

Instance Attribute Details

#varsObject (readonly)

Returns the value of attribute vars.



5
6
7
# File 'lib/or_tools/sat_linear_expr.rb', line 5

def vars
  @vars
end

Instance Method Details

#+(other) ⇒ Object



11
12
13
# File 'lib/or_tools/sat_linear_expr.rb', line 11

def +(other)
  add(other, 1)
end

#-(other) ⇒ Object



15
16
17
# File 'lib/or_tools/sat_linear_expr.rb', line 15

def -(other)
  add(other, -1)
end