Module: Gecode::Bool::BoolLinearOperations
- Included in:
- BoolOperand, Linear::ExpressionTree
- Defined in:
- lib/gecoder/interface/constraints/bool/linear.rb
Overview
:nodoc:
Instance Method Summary collapse
-
#*(fixnum) ⇒ Object
Produces an IntOperand representing the value of this boolean operand (0 or 1) times a constant.
-
#+(op2) ⇒ Object
Produces an IntOperand representing the value of this boolean operand (0 or 1) plus
op2
. -
#-(op2) ⇒ Object
Produces an IntOperand representing the value of this boolean operand (0 or 1) minus
op2
.
Instance Method Details
#*(fixnum) ⇒ Object
Produces an IntOperand representing the value of this boolean operand (0 or 1) times a constant.
Examples
# +bool+ times 17
bool * 17
21 22 23 24 25 26 27 |
# File 'lib/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) ⇒ Object
Produces an IntOperand representing the value of this boolean operand (0 or 1) plus op2
.
Examples
# +bool1+ plus +bool2+
bool1 + bool2
10 11 12 |
# File 'lib/gecoder/interface/constraints/bool/linear.rb', line 10 def +(op2) bool_linear_expression_operation(:+, op2) end |
#-(op2) ⇒ Object
Produces an IntOperand representing the value of this boolean operand (0 or 1) minus op2
.
Examples
# +bool1+ minus +bool2+
bool1 - bool2
36 37 38 |
# File 'lib/gecoder/interface/constraints/bool/linear.rb', line 36 def -(op2) bool_linear_expression_operation(:-, op2) end |