class STAT < $STAT


Ancestors
$STAT $STR



Public


Features
map_aget(k:K): E
**** Returns the element equal to 'e' from the set. Returns void or T::nil if there is no such element. Self may not be void.
map_aset(k:K,e:E)
**** Over-ride data if 'k' exists. Otherwise grow the bucket chain associated with hash(k)
map_copy: SAME
**** Returns a copy of self with all properties set like self.
count(v:ETP):INT
**** The number of elements that are `elt_eq' to `v'. Self may be void.
count_if( test:ROUT{ETP}:BOOL ):INT
**** The number of elements which satisfy `test'. Self may be void.
create: SAME
delete(k:K)
map_delete(k:K): E
**** Removes an element from the set. Does nothing if there is no such element.
elt_eq(e1,e2:ETP):BOOL
**** The "less than" relation used in the sorting routines. Compares the object "id" by default. May be redefined in descendants.
elt_hash(e:ETP):INT
**** A hash value associated with an element. Must have the property that if "elt_eq(e1,e2)" then "elt_hash(e1)=elt_hash(e2)". Can be defined to always return 0, but many routines will then become quadratic. Uses object "id" by default. May be redefined in descendants.
elt_lt(e1,e2:ETP):BOOL
**** The "less than" relation used in the sorting routines. Compares the object "id" by default. May be redefined in descendants.
elt_nil: ETP
**** Return the nil value. If the element is under $NIL then return e.nil. Otherwise, return void
_
elt_str: STR
**** Prints out a string version of the array of the components that are under $STR, and their associated indices
equals(e: $RO_MAP{ITP,ETP}): BOOL
**** Returns true if all of "e"'s elements are equal to self's elts Ordering is an issue. Should be redefined to be more precise for particular descendants
every( test:ROUT{ETP}:BOOL ):BOOL
**** True if every element of self satisfies `test'. Self may be void.
has(e: ETP): BOOL
has_elt(e:ETP):BOOL
**** True if the self has an element which is `elt_eq' to `e'.
map_has_ind(k:K): BOOL
incr(k:STR)
incr(k:STR,by:INT)
inds: ARRAY{ITP}
**** Return an index array which is the same size as self and is set to the values of the indices
is_elt_nil(e:ETP):BOOL
map(r:ROUT{ETP}:ETP)
**** Set each element of self to the result of applying `r' to it.
notany( test:ROUT{ETP}:BOOL ):BOOL
**** True if none of the elements of self satisfies `test'. Self may be void.
notevery( test:ROUT{ETP}:BOOL ):BOOL
**** True if not every element of self satisfies `test'. Self may be void.
permute_into( new_pos :$RO_MAP{ITP,ITP}, destination: $MAP{ITP,ETP})
**** Copy the entries from orig_arr into self using the permutation array "new_positions"
print
replace(o,n:ETP)
**** Replace elements that are `elt_eq' to `o' by `n' wherever it occurs
replace_if(test:ROUT{ETP}:BOOL, n:ETP)
**** Replace elements that satisfy `test' by `n'.
size: INT
some( test:ROUT{ETP}:BOOL ):BOOL
**** True if some element of self satisfies `test'. Self may be void.
str:STR
test_if(test:ROUT{ETP}:BOOL,out ind: ITP, out elt: ETP):BOOL
**** Return true if an element satisfies test "test" Arg "ind" is set to the index of the element satisfying "test" Arg "elt" is set to the element satisfying "test"

Iters
map_elt!: E
map_key!: K
map_pair!: TUP{K,E}


Private

attr asize: INT;
**** The actual size. Array access beyond this bound is illegal.
attr asize: INT;
**** The actual size. Array access beyond this bound is illegal.
attr bound: INT;
**** Upper bound for split_pos = initial_size * 2.pow(doubles)
attr bound: INT;
**** Upper bound for split_pos = initial_size * 2.pow(doubles)
bucket(i:INT): BUCKET
create_sized(initial_size:INT): SAME
data_nil: E
dbg: STR
**** Returns an interal string representation of the hashtable. For debugging only.
attr doubles: INT;
**** Number of times the initial table size has been doubled.
attr doubles: INT;
**** Number of times the initial table size has been doubled.
elt_eq(e1,e2:ETP):BOOL
**** The "less than" relation used in the sorting routines. Compares the object "id" by default. May be redefined in descendants.
elt_hash(e:ETP):INT
**** A hash value associated with an element. Must have the property that if "elt_eq(e1,e2)" then "elt_hash(e1)=elt_hash(e2)". Can be defined to always return 0, but many routines will then become quadratic. Uses object "id" by default. May be redefined in descendants.
elt_nil: ETP
**** Return the nil value. If the element is under $NIL then return e.nil. Otherwise, return void
_
elt_str(e: ETP): STR
grow
**** Increases the size of the array by one. The functions changing the size of the bucket table: They are split into two parts. 1.) Splitting the next bucket into two. (update_*) 2.) Resizing the storage area. (shrink/grow)
hash(e:E): INT
**** Returns the bucket to store e. This number will be generated from the hash-value and be normailzed through the actual size of the set.
ind_str(i: ITP): STR
shared lower_fill_ratio: FLT := 0.800;
shared lower_fill_ratio: FLT := 0.800;
attr minsize: INT;
**** The initial size is also the minimal size. Further shrinking will not afflict the data storage.
attr minsize: INT;
**** The initial size is also the minimal size. Further shrinking will not afflict the data storage.
attr n_inds: INT;
**** Returns the number of elements in the set.
attr n_inds: INT;
**** Returns the number of elements in the set.
set_bucket(i:INT,l:BUCKET)
shrink
**** Decreases the size of the array by one. Requests to shrink under the initial size will be ignored.
attr split_pos: INT;
**** Position of the next bucket to split.
attr split_pos: INT;
**** Position of the next bucket to split.
attr store: AREF{BUCKET};
**** Here is the data being stored.
attr store: AREF{BUCKET};
**** Here is the data being stored.
update_delete
**** Checks the actual fill ratio of the set. Removes a bucket from the hash table if the ratio is low enough.
update_insert
**** Checks the actual fill ratio of the set. Adds a bucket to the hash table if the ratio is high enough. The functions changing the size of the bucket table are split into two parts. 1.) Splitting the next bucket into two. (update_*) 2.) Resizing the storage area. (shrink/grow)
shared upper_fill_ratio: FLT := 1.000;
**** Limits splitting or merging buckets.
shared upper_fill_ratio: FLT := 1.000;
**** Limits splitting or merging buckets.