lib/gecoder/interface/constraints/int/arithmetic.rb in gecoder-0.5.0 vs lib/gecoder/interface/constraints/int/arithmetic.rb in gecoder-0.6.0
- old
+ new
@@ -27,11 +27,13 @@
lhs, strength = @params.values_at(:lhs, :strength)
if variable.nil?
variable = @model.int_var(lhs.min..lhs.max)
end
- Gecode::Raw::abs(@model.active_space, lhs.bind, variable.bind, strength)
+ @model.add_interaction do
+ Gecode::Raw::abs(@model.active_space, lhs.bind, variable.bind, strength)
+ end
return variable
end
end
# Describes an expression stub started with an integer variable followed by
@@ -44,11 +46,13 @@
b_min = lhs2.min; b_max = lhs2.max
products = [a_min*b_min, a_min*b_max, a_max*b_min, a_max*b_max]
variable = @model.int_var(products.min..products.max)
end
- Gecode::Raw::mult(@model.active_space, lhs.bind, lhs2.bind,
- variable.bind, strength)
+ @model.add_interaction do
+ Gecode::Raw::mult(@model.active_space, lhs.bind, lhs2.bind,
+ variable.bind, strength)
+ end
return variable
end
end
end