Class: Gecode::SelectedSet::Element::SelectedSetIntersectionOperand
- Inherits:
-
Gecode::Set::ShortCircuitEqualityOperand
- Object
- Gecode::Set::ShortCircuitEqualityOperand
- Gecode::SelectedSet::Element::SelectedSetIntersectionOperand
- Defined in:
- lib/gecoder/interface/constraints/selected_set/select.rb
Overview
:nodoc:
Instance Attribute Summary
Attributes inherited from Gecode::Set::ShortCircuitEqualityOperand
Instance Method Summary collapse
- #constrain_equal(set_operand, constrain, propagation_options) ⇒ Object
-
#initialize(model, selected_set, universe) ⇒ SelectedSetIntersectionOperand
constructor
A new instance of SelectedSetIntersectionOperand.
Methods inherited from Gecode::Set::ShortCircuitEqualityOperand
#construct_receiver, #to_set_var
Methods included from Gecode::Set::SetOperand
#disjoint_union, #elements, #intersection, #method_missing, #minus, #size, #union
Methods included from Operand
Constructor Details
#initialize(model, selected_set, universe) ⇒ SelectedSetIntersectionOperand
Returns a new instance of SelectedSetIntersectionOperand.
86 87 88 89 90 |
# File 'lib/gecoder/interface/constraints/selected_set/select.rb', line 86 def initialize(model, selected_set, universe) super model @selected_set = selected_set @universe = universe end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Gecode::Set::SetOperand
Instance Method Details
#constrain_equal(set_operand, constrain, propagation_options) ⇒ Object
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 |
# File 'lib/gecoder/interface/constraints/selected_set/select.rb', line 92 def constrain_equal(set_operand, constrain, ) enum, indices = @selected_set.to_selected_set universe = @universe # We can't do any useful constraining here since the empty intersection # is the universe. if universe.nil? Gecode::Raw::elementsInter(@model.active_space, enum.to_set_enum.bind_array, indices.to_set_var.bind, set_operand.to_set_var.bind) else Gecode::Raw::elementsInter(@model.active_space, enum.to_set_enum.bind_array, indices.to_set_var.bind, set_operand.to_set_var.bind, Gecode::Util.constant_set_to_int_set(universe)) end end |