module Gecode::BoolEnumMethods

A module containing the methods needed by enumerations containing boolean operands. Requires that it’s included in an enumerable.

Public Instance Methods

bind_array() click to toggle source

Returns a bool variable array with all the bound variables.

# File doc/tmp/rdoc_dev/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() click to toggle source

Returns the receiver.

# File doc/tmp/rdoc_dev/gecoder/interface/enum_wrapper.rb, line 127
def to_bool_enum
  self
end