Module: Gecode::BoolEnumMethods
- Defined in:
- lib/gecoder/interface/enum_wrapper.rb
Overview
A module containing the methods needed by enumerations containing boolean operands. Requires that it’s included in an enumerable.
Instance Attribute Summary
Attributes included from EnumMethods
Instance Method Summary collapse
-
#bind_array ⇒ Object
Returns a bool variable array with all the bound variables.
-
#to_bool_enum ⇒ Object
Returns the receiver.
Methods included from VariableEnumMethods
Methods included from EnumMethods
Methods included from Gecode::BoolEnum::BoolEnumOperand
#conjunction, #disjunction, #method_missing
Methods included from Operand
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Gecode::BoolEnum::BoolEnumOperand
Instance Method Details
#bind_array ⇒ Object
Returns a bool variable array with all the bound variables.
115 116 117 118 119 120 121 122 123 124 |
# File 'lib/gecoder/interface/enum_wrapper.rb', line 115 def bind_array space = @model.active_space unless @bound_space == space elements = to_a @bound_arr = Gecode::Raw::BoolVarArray.new(active_space, elements.size) elements.each_with_index{ |var, index| @bound_arr[index] = var.bind } @bound_space = space end return @bound_arr end |
#to_bool_enum ⇒ Object
Returns the receiver.
127 128 129 |
# File 'lib/gecoder/interface/enum_wrapper.rb', line 127 def to_bool_enum self end |