1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161
|
<!DOCTYPE HTML SYSTEM>
<!-- Generated by Lisaac shorter / html style -->
<html>
<head>
<title>
Lisaac prototype interface
</title>
</head>
<body BGCOLOR="#FFFFFF">
<br><br><strong><font color="#A020F0">Section</font></strong> <strong><font color="#A020F0">Header</font></strong>
<br><br><strong><font color="#FF0000">    +</font></strong> <strong><font color="#0000FF">name</font></strong> := <a href="HASHED_SET.html"><font color="#008000">HASHED_SET</font></a>[<font color="#008000">E</font>];
<br><br><strong><font color="#FF0000">    -</font></strong> <strong><font color="#0000FF">comment</font></strong> := <font color="#BC8F8F">"Definition of a mathematical set of hashable objects."</font>;
<br><font FACE="Sans-serif" color="#000000"><B> All common operations on mathematical sets are available.</B></font>
<br><br><strong><font color="#A020F0">Section</font></strong> <strong><font color="#A020F0">Inherit</font></strong>
<br><br><strong><font color="#FF0000">    +</font></strong> <strong><font color="#0000FF">parent_set</font></strong>:<strong><font color="#A020F0">Expanded</font></strong> <a href="SET.html"><font color="#008000">SET</font></a>[<font color="#008000">E</font>];
<br><br><strong><font color="#A020F0">Section</font></strong> <strong><font color="#A020F0">Public</font></strong>
<br><br><strong><font color="#FF0000">    -</font></strong> <strong><font color="#0000FF">default_size</font></strong>:<a href="INTEGER.html"><font color="#008000">INTEGER</font></a> :=
<br><em><strong><font color="#707070">        Minimum size for storage in number of items.</font></strong></em>
<br><br><strong><font color="#A020F0">Section</font></strong> <a href="SET.html"><font color="#008000">SET</font></a>
<br><br><strong><font color="#FF0000">    +</font></strong> <strong><font color="#0000FF">buckets</font></strong>:<a href="NATIVE_ARRAY.html"><font color="#008000">NATIVE_ARRAY</font></a>[<a href="HASHED_SET_NODE.html"><font color="#008000">HASHED_SET_NODE</font></a>[<font color="#008000">E</font>]];
<br><em><strong><font color="#707070">        The `buckets' storage area is the primary hash table of `capacity'</font></strong></em>
<br><em><strong><font color="#707070">        elements. To search some element, the first access is done in</font></strong></em>
<br><em><strong><font color="#707070">        `buckets' using the remainder of the division of the key `hash_code' by</font></strong></em>
<br><em><strong><font color="#707070">        `capacity'. In order to try to avoid clashes, `capacity' is always a</font></strong></em>
<br><em><strong><font color="#707070">        prime number (selected using HASH_TABLE_SIZE).</font></strong></em>
<br><font FACE="Sans-serif" color="#000000"><B></B></font>
<br><font FACE="Sans-serif" color="#000000"><B> Internal cache handling:</B></font>
<br><font FACE="Sans-serif" color="#000000"><B></B></font>
<br><br><strong><font color="#FF0000">    +</font></strong> <strong><font color="#0000FF">cache_user</font></strong>:<a href="INTEGER.html"><font color="#008000">INTEGER</font></a>;
<br><em><strong><font color="#707070">        The last user's external index in range [1 .. `count'] (see `item'</font></strong></em>
<br><em><strong><font color="#707070">        and `valid_index' for example) may be saved in `cache_user' otherwise</font></strong></em>
<br><em><strong><font color="#707070">        -1 to indicate that the cache is not active. When the cache is</font></strong></em>
<br><em><strong><font color="#707070">        active, the corresponding index in `buckets' is save in</font></strong></em>
<br><em><strong><font color="#707070">        `cache_buckets' and the corresponding node in `cache_node'.</font></strong></em>
<br><br><strong><font color="#FF0000">    +</font></strong> <strong><font color="#0000FF">cache_node</font></strong>:<a href="HASHED_SET_NODE.html"><font color="#008000">HASHED_SET_NODE</font></a>[<font color="#008000">E</font>];
<br><em><strong><font color="#707070">        Meaningful only when `cache_user' is not -1.</font></strong></em>
<br><br><strong><font color="#FF0000">    +</font></strong> <strong><font color="#0000FF">cache_buckets</font></strong>:<a href="INTEGER.html"><font color="#008000">INTEGER</font></a>;
<br><em><strong><font color="#707070">        Meaningful only when `cache_user' is not -1.</font></strong></em>
<br><br><strong><font color="#A020F0">Section</font></strong> <strong><font color="#A020F0">Public</font></strong>
<br><br><strong><font color="#FF0000">    -</font></strong> <strong><font color="#0000FF">create</font></strong>:<font color="#008000">SELF</font> <-
<br><em><strong><font color="#707070">        Create an empty set. Internal storage `capacity' of the set is</font></strong></em>
<br><em><strong><font color="#707070">        initialized using the `Default_size' value. Then, tuning of needed</font></strong></em>
<br><em><strong><font color="#707070">        storage size is done automatically according to usage. If you</font></strong></em>
<br><em><strong><font color="#707070">        are really sure that your set is always really bigger than</font></strong></em>
<br><em><strong><font color="#707070">        `Default_size', you may use `with_capacity' to save some execution time.</font></strong></em>
<br><br><strong><font color="#FF0000">    -</font></strong> <strong><font color="#0000FF">make</font></strong> <-
<br><br><strong><font color="#FF0000">    -</font></strong> <strong><font color="#0000FF">create_with_capacity</font></strong> sz:<a href="INTEGER.html"><font color="#008000">INTEGER</font></a> :<font color="#008000">SELF</font> <-
<br><em><strong><font color="#707070">        Create an empty set using `medium_size' as an appropriate value</font></strong></em>
<br><em><strong><font color="#707070">        to help initialization of `capacity'. Thus, this feature may be used</font></strong></em>
<br><em><strong><font color="#707070">        in place of `make' to save some execution time if one is sure that</font></strong></em>
<br><em><strong><font color="#707070">        storage size will rapidly become really bigger than `Default_size' (if</font></strong></em>
<br><em><strong><font color="#707070">        not sure, simply use `make'). Anyway, the initial `medium_size' value</font></strong></em>
<br><em><strong><font color="#707070">        is just an indication and never a limit for the possible</font></strong></em>
<br><em><strong><font color="#707070">        `capacity'. Keep in mind that the `capacity' tuning is done</font></strong></em>
<br><em><strong><font color="#707070">        automatically according to usage.</font></strong></em>
<br><br><strong><font color="#FF0000">    -</font></strong> <strong><font color="#0000FF">with_capacity</font></strong> medium_size:<a href="INTEGER.html"><font color="#008000">INTEGER</font></a> <-
<br><font FACE="Sans-serif" color="#000000"><B></B></font>
<br><font FACE="Sans-serif" color="#000000"><B> Counting:</B></font>
<br><font FACE="Sans-serif" color="#000000"><B></B></font>
<br><br><strong><font color="#FF0000">    +</font></strong> <strong><font color="#0000FF">capacity</font></strong>:<a href="INTEGER.html"><font color="#008000">INTEGER</font></a>; <br><em><strong><font color="#707070">        Of the `buckets' storage area.</font></strong></em>
<br><br><strong><font color="#FF0000">    +</font></strong> <strong><font color="#0000FF">count</font></strong>:<a href="INTEGER.html"><font color="#008000">INTEGER</font></a>;
<br><font FACE="Sans-serif" color="#000000"><B></B></font>
<br><font FACE="Sans-serif" color="#000000"><B> Adding and removing:</B></font>
<br><font FACE="Sans-serif" color="#000000"><B></B></font>
<br><br><strong><font color="#FF0000">    -</font></strong> <strong><font color="#0000FF">add</font></strong> e:<font color="#008000">E</font> <-
<br><em><strong><font color="#707070">        Add a new item to the set:the mathematical definition of</font></strong></em>
<br><em><strong><font color="#707070">        adding in a set is followed.</font></strong></em>
<br><br><strong><font color="#FF0000">    -</font></strong> <strong><font color="#0000FF">fast_add</font></strong> e:<font color="#008000">E</font> <-
<br><em><strong><font color="#707070">        Add a new item to the set:the mathematical definition of</font></strong></em>
<br><em><strong><font color="#707070">        adding in a set is followed.</font></strong></em>
<br><br><strong><font color="#FF0000">    -</font></strong> <strong><font color="#0000FF">remove</font></strong> e:<font color="#008000">E</font> <-
<br><em><strong><font color="#707070">        Remove item `e' from the set:the mathematical definition of</font></strong></em>
<br><em><strong><font color="#707070">        removing from a set is followed.</font></strong></em>
<br><br><strong><font color="#FF0000">    -</font></strong> <strong><font color="#0000FF">fast_remove</font></strong> e:<font color="#008000">E</font> <-
<br><em><strong><font color="#707070">        Remove item `e' from the set:the mathematical definition of</font></strong></em>
<br><em><strong><font color="#707070">        removing from a set is followed.</font></strong></em>
<br><br><strong><font color="#FF0000">    -</font></strong> <strong><font color="#0000FF">clear</font></strong> <-
<br><em><strong><font color="#707070">        Empty the current set.</font></strong></em>
<br><font FACE="Sans-serif" color="#000000"><B></B></font>
<br><font FACE="Sans-serif" color="#000000"><B> Looking and searching:</B></font>
<br><font FACE="Sans-serif" color="#000000"><B></B></font>
<br><br><strong><font color="#FF0000">    -</font></strong> <strong><font color="#0000FF">has</font></strong> e:<font color="#008000">E</font> :<a href="BOOLEAN.html"><font color="#008000">BOOLEAN</font></a> <-
<br><em><strong><font color="#707070">        Is element `e' in the set?</font></strong></em>
<br><br><strong><font color="#FF0000">    -</font></strong> <strong><font color="#0000FF">fast_has</font></strong> e:<font color="#008000">E</font> :<a href="BOOLEAN.html"><font color="#008000">BOOLEAN</font></a> <-
<br><em><strong><font color="#707070">        Is element `e' in the set?</font></strong></em>
<br><br><strong><font color="#FF0000">    -</font></strong> <strong><font color="#0000FF">reference_at</font></strong> e:<font color="#008000">E</font> :<font color="#008000">E</font> <-
<br><font FACE="Sans-serif" color="#000000"><B></B></font>
<br><font FACE="Sans-serif" color="#000000"><B> To provide iterating facilities:</B></font>
<br><font FACE="Sans-serif" color="#000000"><B></B></font>
<br><br><strong><font color="#FF0000">    -</font></strong> <strong><font color="#0000FF">item</font></strong> i:<a href="INTEGER.html"><font color="#008000">INTEGER</font></a> :<font color="#008000">E</font> <-
<br><em><strong><font color="#707070">        Return the item indexed by `index'.</font></strong></em>
<br><font FACE="Sans-serif" color="#000000"><B></B></font>
<br><font FACE="Sans-serif" color="#000000"><B> Mathematical operations:</B></font>
<br><font FACE="Sans-serif" color="#000000"><B></B></font>
<br><br><strong><font color="#FF0000">    -</font></strong> <strong><font color="#0000FF">intersection</font></strong> other:<font color="#008000">SELF</font> <-
<br><em><strong><font color="#707070">        Make the intersection of the `self' set with `other'.</font></strong></em>
<br><br><strong><font color="#FF0000">    -</font></strong> <strong><font color="#0000FF">copy</font></strong> other:<font color="#008000">SELF</font> <-
<br><em><strong><font color="#707070">        Copy 'other' into the current set</font></strong></em>
<br><br><strong><font color="#FF0000">    -</font></strong> <strong><font color="#0000FF">from_collection</font></strong> model:<a href="COLLECTION.html"><font color="#008000">COLLECTION</font></a>[<font color="#008000">E</font>] <-
</body>
</html>
|