module Gecode::Bool::BoolLinearOperations

Public Instance Methods

*(fixnum) click to toggle source

Produces an IntOperand representing the value of this boolean operand (0 or 1) times a constant.

Examples

# +bool+ times 17
bool * 17
# File doc/tmp/rdoc_dev/gecoder/interface/constraints/bool/linear.rb, line 21
def *(fixnum)
  if fixnum.kind_of? Fixnum
    bool_linear_expression_operation(:*, fixnum)
  else
    raise TypeError, "Expected fixnum, got #{fixnum.class}."
  end
end
+(op2) click to toggle source

Produces an IntOperand representing the value of this boolean operand (0 or 1) plus op2.

Examples

# +bool1+ plus +bool2+
bool1 + bool2
# File doc/tmp/rdoc_dev/gecoder/interface/constraints/bool/linear.rb, line 10
def +(op2)
  bool_linear_expression_operation(:+, op2)
end
-(op2) click to toggle source

Produces an IntOperand representing the value of this boolean operand (0 or 1) minus op2.

Examples

# +bool1+ minus +bool2+
bool1 - bool2
# File doc/tmp/rdoc_dev/gecoder/interface/constraints/bool/linear.rb, line 36
def -(op2)
  bool_linear_expression_operation(:-, op2)
end