Sha256: d51e5252ce34154d802e442c83ec312db2d83c04bafced5b9f97538687e1f524
Contents?: true
Size: 847 Bytes
Versions: 15
Compression:
Stored size: 847 Bytes
Contents
module Gecode class FreeBoolVar # Creates a linear expression where the bool variables are summed. def +(var) Gecode::Constraints::Int::Linear::ExpressionNode.new(self, @model) + var end alias_method :pre_linear_mult, :* if instance_methods.include? '*' # Creates a linear expression where the bool variable is multiplied with # a constant integer. def *(int) if int.kind_of? Fixnum Gecode::Constraints::Int::Linear::ExpressionNode.new(self, @model) * int else pre_linear_mult(int) if respond_to? :pre_linear_mult end end # Creates a linear expression where the specified variable is subtracted # from this one. def -(var) Gecode::Constraints::Int::Linear::ExpressionNode.new(self, @model) - var end end end
Version data entries
15 entries across 15 versions & 2 rubygems