Sha256: 2864c544563f4a64493044ba7edb3cddefd2ca58916c5712ef8023ba8ecf7d2d

Contents?: true

Size: 1.27 KB

Versions: 9

Compression:

Stored size: 1.27 KB

Contents

module Gecode
  module IntEnumMethods
    include Gecode::Constraints::LeftHandSideMethods
    
    private
    
    # Produces an expression for the lhs module.
    def expression(params)
      params.update(:lhs => self)
      Constraints::IntEnum::Expression.new(@model, params)
    end
  end
  
  # A module containing constraints that have enumerations of integer 
  # variables as left hand side.
  module Constraints::IntEnum
    # Expressions with int enums as left hand sides.
    class Expression < Gecode::Constraints::Expression #:nodoc:
      # Raises TypeError unless the left hand side is an int enum.
      def initialize(model, params)
        super
        
        unless params[:lhs].respond_to? :to_int_var_array
          raise TypeError, 'Must have int enum as left hand side.'
        end
      end
    end
  end
end

require 'gecoder/interface/constraints/int_enum/distinct'
require 'gecoder/interface/constraints/int_enum/equality'
require 'gecoder/interface/constraints/int_enum/channel'
require 'gecoder/interface/constraints/int_enum/element'
require 'gecoder/interface/constraints/int_enum/count'
require 'gecoder/interface/constraints/int_enum/sort'
require 'gecoder/interface/constraints/int_enum/arithmetic'
require 'gecoder/interface/constraints/int_enum/extensional'

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
gecoder-with-gecode-0.8.3-mswin32 lib/gecoder/interface/constraints/int_enum_constraints.rb
gecoder-with-gecode-0.8.2-mswin32 lib/gecoder/interface/constraints/int_enum_constraints.rb
gecoder-with-gecode-0.8.1-mswin32 lib/gecoder/interface/constraints/int_enum_constraints.rb
gecoder-0.8.1 lib/gecoder/interface/constraints/int_enum_constraints.rb
gecoder-0.8.3 lib/gecoder/interface/constraints/int_enum_constraints.rb
gecoder-0.8.2 lib/gecoder/interface/constraints/int_enum_constraints.rb
gecoder-with-gecode-0.8.1 lib/gecoder/interface/constraints/int_enum_constraints.rb
gecoder-with-gecode-0.8.2 lib/gecoder/interface/constraints/int_enum_constraints.rb
gecoder-with-gecode-0.8.3 lib/gecoder/interface/constraints/int_enum_constraints.rb