class Gecode::Set::Operation::OperationConstraint

Public Instance Methods

post() click to toggle source
# File doc/tmp/rdoc_dev/gecoder/interface/constraints/set/operation.rb, line 99
def post
  op1, op2, operation, relation, rhs, negate = @params.values_at(:op1, 
    :op2, :operation, :relation_type, :rhs, :negate)

  op1, op2, rhs = [op1, op2, rhs].map do |expression|
    # The expressions can either be set operands or constant sets, 
    # convert them appropriately.
    if expression.respond_to? :to_set_var
      expression.to_set_var.bind
    else
      Gecode::Util::constant_set_to_int_set(expression)
    end
  end

  Gecode::Raw::rel(@model.active_space, op1, operation, op2, 
    relation, rhs)
end