Class: Gecode::SelectedSet::Element::SelectedSetUnionOperand
- Inherits:
-
Gecode::Set::ShortCircuitEqualityOperand
- Object
- Gecode::Set::ShortCircuitEqualityOperand
- Gecode::SelectedSet::Element::SelectedSetUnionOperand
- 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) ⇒ SelectedSetUnionOperand
constructor
A new instance of SelectedSetUnionOperand.
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) ⇒ SelectedSetUnionOperand
Returns a new instance of SelectedSetUnionOperand.
68 69 70 71 |
# File 'lib/gecoder/interface/constraints/selected_set/select.rb', line 68 def initialize(model, selected_set) super model @selected_set = selected_set 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
73 74 75 76 77 78 79 80 81 82 |
# File 'lib/gecoder/interface/constraints/selected_set/select.rb', line 73 def constrain_equal(set_operand, constrain, ) enum, indices = @selected_set.to_selected_set if constrain set_operand.must_be.subset_of enum.upper_bound_range end Gecode::Raw::elementsUnion(@model.active_space, enum.to_set_enum.bind_array, indices.to_set_var.bind, set_operand.to_set_var.bind) end |