Class: Array

Instance Method Summary collapse

Methods included from SetFuMixinBinaryProperOperator

#<

Methods included from SetFuMixinBinarySubsetOperator

#<=

Methods included from SetFuMixinTrippleEqualsOperator

#===, #old_triple_equal4Set

Methods included from SetFuMixinToSetMethod

#to_bset

Methods included from SetFuMixinBinaryIntersectionOperator

#**

Instance Method Details

#&(item) ⇒ Object



1020
1021
1022
1023
1024
1025
# File 'lib/setfu.rb', line 1020

def &(item)
  return old_and_method4set(item) if (item.type_of? Array)
  a = BitSet.new(self)
  b = BitSet.new(item)
  return a & b 
end

#-(item) ⇒ Object



1014
1015
1016
1017
1018
1019
# File 'lib/setfu.rb', line 1014

def -(item)
  return old_subtract_method4set(item) if (item.type_of? Array)
  a = BitSet.new(self)
  b = BitSet.new(item)
  return a - b 
end

#^(item) ⇒ Object



1004
1005
1006
1007
1008
1009
1010
1011
1012
# File 'lib/setfu.rb', line 1004

def ^(item)
  if item.type_of? Array
    return (self | item) - (self & item)
  else
    a = BitSet.new(self)
    b = BitSet.new(item)
    return a ^ b
  end
end

#members_to_bsetObject



193
194
195
196
# File 'lib/setfu.rb', line 193

def members_to_bset
  Setfu::bset_elements(self)
  self
end

#old_and_method4setObject



994
# File 'lib/setfu.rb', line 994

alias_method :old_and_method4set, :&

#old_or_method4setObject



995
# File 'lib/setfu.rb', line 995

alias_method :old_or_method4set, :|

#old_subtract_method4setObject



993
# File 'lib/setfu.rb', line 993

alias_method :old_subtract_method4set, :-

#reduce_tuples(passes = 1) ⇒ Object



208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
# File 'lib/setfu.rb', line 208

def reduce_tuples(passes = 1)
  Setfu::bset_elements(self)
  Setfu::untag_bset_elements(self)
  total_count = 0
  loop do
    tc = Setfu::reduce(self)
    if tc < 0
      total_count = -1
      break
    end
    break if tc == 0
    total_count += tc
    passes -= 1
    break if passes <= 0
  end
  total_count
end

#tupleObject



205
206
207
# File 'lib/setfu.rb', line 205

def tuple
  Setfu::tuple(self)
end

#tuple?Boolean

Returns:

  • (Boolean)


202
203
204
# File 'lib/setfu.rb', line 202

def tuple?
  Setfu::tuple?(self)
end

#tuplesObject



197
198
199
200
201
# File 'lib/setfu.rb', line 197

def tuples
  members_to_bset
  rtn = Setfu::tuples(self)
  rtn
end

#untag_bset_elementsObject



225
226
227
# File 'lib/setfu.rb', line 225

def untag_bset_elements
  Setfu::untag_bset_elements(self)
end

#|(item) ⇒ Object



1026
1027
1028
1029
1030
1031
# File 'lib/setfu.rb', line 1026

def |(item)
  return old_or_method4set(item) if (item.type_of? Array)
  a = BitSet.new(self)
  b = BitSet.new(item)
  return a | b 
end