class Gecode::Int::Arithmetic::IntAbsOperand

Public Instance Methods

constrain_equal(int_operand, constrain, propagation_options) click to toggle source
# File doc/tmp/rdoc_dev/gecoder/interface/constraints/int/arithmetic.rb, line 64
def constrain_equal(int_operand, constrain, propagation_options)
  int_op = @int.to_int_var
  if constrain
    bounds = [int_op.min.abs, int_op.max.abs]
    bounds << 0 if int_op.min < 0
    int_operand.must_be.in bounds.min..bounds.max
  end
  
  Gecode::Raw::abs(@model.active_space, int_op.to_int_var.bind, 
    int_operand.to_int_var.bind, *propagation_options)
end

Public Class Methods

new(model, int_op) click to toggle source
# File doc/tmp/rdoc_dev/gecoder/interface/constraints/int/arithmetic.rb, line 59
def initialize(model, int_op)
  super model
  @int = int_op
end