Module: Gecode::Util::VarStoreMethods

Included in:
BoolVarStore, IntVarStore
Defined in:
lib/gecoder/interface/binding_changes.rb

Overview

Provides common methods to the variable stores. The stores must provide @next_index, @var_array, @size, ARRAY_IDENTIFIER and #new_storage_array .

Instance Method Summary collapse

Instance Method Details

#[](index) ⇒ Object

Returns the int var with the specified index, nil if none exists.



79
80
81
82
83
84
# File 'lib/gecoder/interface/binding_changes.rb', line 79

def [](index)
  if index < 0 or index >= @next_index
    return nil
  end
  return @var_array.at(index)
end