File: FAST_ARRAY3.html

package info (click to toggle)
lisaac 1%3A0.13.1-2
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 15,232 kB
  • ctags: 6,386
  • sloc: ansic: 242,479; xml: 635; lisp: 333; makefile: 119; sh: 73; asm: 38
file content (177 lines) | stat: -rwxr-xr-x 15,073 bytes parent folder | download | duplicates (2)
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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
<!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">&nbsp &nbsp +</font></strong> <strong><font color="#0000FF">name</font></strong>    := <a href="FAST_ARRAY3.html"><font color="#008000">FAST_ARRAY3</font></a>[<font color="#008000">E</font>];
  
  <br><br><strong><font color="#FF0000">&nbsp &nbsp -</font></strong> <strong><font color="#0000FF">comment</font></strong> :=<font color="#BC8F8F">"Resizable three dimensional array.\
              \Unlike ARRAY3, the `lower1', `lower2' and `lower3' bounds \
              \are frozen to 0. Thus, one can expect better performances. ."</font>;
    
<br><br><strong><font color="#A020F0">Section</font></strong> <strong><font color="#A020F0">Inherit</font></strong>
  
  <br><br><strong><font color="#FF0000">&nbsp &nbsp +</font></strong> <strong><font color="#0000FF">parent_collection3</font></strong>:<strong><font color="#A020F0">Expanded</font></strong> <a href="COLLECTION3.html"><font color="#008000">COLLECTION3</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">&nbsp &nbsp +</font></strong> <strong><font color="#0000FF">upper1</font></strong>:<a href="INTEGER.html"><font color="#008000">INTEGER</font></a>;
  <br><br><strong><font color="#FF0000">&nbsp &nbsp +</font></strong> <strong><font color="#0000FF">count1</font></strong>:<a href="INTEGER.html"><font color="#008000">INTEGER</font></a>;
  
  <br><br><strong><font color="#FF0000">&nbsp &nbsp +</font></strong> <strong><font color="#0000FF">upper2</font></strong>:<a href="INTEGER.html"><font color="#008000">INTEGER</font></a>;
  <br><br><strong><font color="#FF0000">&nbsp &nbsp +</font></strong> <strong><font color="#0000FF">count2</font></strong>:<a href="INTEGER.html"><font color="#008000">INTEGER</font></a>;
  
  <br><br><strong><font color="#FF0000">&nbsp &nbsp +</font></strong> <strong><font color="#0000FF">upper3</font></strong>:<a href="INTEGER.html"><font color="#008000">INTEGER</font></a>;
  <br><br><strong><font color="#FF0000">&nbsp &nbsp +</font></strong> <strong><font color="#0000FF">count3</font></strong>:<a href="INTEGER.html"><font color="#008000">INTEGER</font></a>;
  
  <br><br><strong><font color="#FF0000">&nbsp &nbsp +</font></strong> <strong><font color="#0000FF">count</font></strong>:<a href="INTEGER.html"><font color="#008000">INTEGER</font></a>;
  
<br><br><strong><font color="#A020F0">Section</font></strong> <a href="FAST_ARRAY3.html"><font color="#008000">FAST_ARRAY3</font></a>
    
  <br><br><strong><font color="#FF0000">&nbsp &nbsp +</font></strong> <strong><font color="#0000FF">storage</font></strong>:<a href="NATIVE_ARRAY.html"><font color="#008000">NATIVE_ARRAY</font></a>[<font color="#008000">E</font>];
  
  <br><br><strong><font color="#FF0000">&nbsp &nbsp +</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">&nbsp &nbsp &nbsp &nbsp  of `storage'.</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">&nbsp &nbsp -</font></strong> <strong><font color="#0000FF">lower1</font></strong>:<a href="INTEGER.html"><font color="#008000">INTEGER</font></a> := 
  
  <br><br><strong><font color="#FF0000">&nbsp &nbsp -</font></strong> <strong><font color="#0000FF">lower2</font></strong>:<a href="INTEGER.html"><font color="#008000">INTEGER</font></a> := 
  
  <br><br><strong><font color="#FF0000">&nbsp &nbsp -</font></strong> <strong><font color="#0000FF">lower3</font></strong>:<a href="INTEGER.html"><font color="#008000">INTEGER</font></a> := 
  
  <br><br><strong><font color="#FF0000">&nbsp &nbsp -</font></strong> <strong><font color="#0000FF">create</font></strong> (new_count1, new_count2, new_count3:<a href="INTEGER.html"><font color="#008000">INTEGER</font></a>) :<font color="#008000">SELF</font><-
  <br><em><strong><font color="#707070">&nbsp &nbsp &nbsp &nbsp  Create or reset `Current' with new dimensions.</font></strong></em>
  <br><em><strong><font color="#707070">&nbsp &nbsp &nbsp &nbsp  All elements are set to the default value of type E.</font></strong></em>
    
  <br><br><strong><font color="#FF0000">&nbsp &nbsp -</font></strong> <strong><font color="#0000FF">make</font></strong> (new_count1, new_count2, new_count3 :<a href="INTEGER.html"><font color="#008000">INTEGER</font></a>) <-
  <br><em><strong><font color="#707070">&nbsp &nbsp &nbsp &nbsp  Create or reset `self' with new dimensions.</font></strong></em>
  <br><em><strong><font color="#707070">&nbsp &nbsp &nbsp &nbsp  All elements are set to the default value of type E.</font></strong></em>
      
  <br><br><strong><font color="#FF0000">&nbsp &nbsp -</font></strong> <strong><font color="#0000FF">from_collection3</font></strong> model:<a href="COLLECTION3.html"><font color="#008000">COLLECTION3</font></a>[<font color="#008000">E</font>] <-
  <br><em><strong><font color="#707070">&nbsp &nbsp &nbsp &nbsp  Uses the `model' to update self.</font></strong></em>
      
  <br><br><strong><font color="#FF0000">&nbsp &nbsp -</font></strong> <strong><font color="#0000FF">from_collection</font></strong> contents:<a href="COLLECTION.html"><font color="#008000">COLLECTION</font></a>[<font color="#008000">E</font>] <strong><font color="#0000FF">size</font></strong> (new_count1, new_count2, new_count3:<a href="INTEGER.html"><font color="#008000">INTEGER</font></a>) <-
  <br><em><strong><font color="#707070">&nbsp &nbsp &nbsp &nbsp   Reset all bounds using `new_count#i'.</font></strong></em>
  <br><em><strong><font color="#707070">&nbsp &nbsp &nbsp &nbsp   Copy all elements of `contents', line by line into self.</font></strong></em>
    
  
  <br><br><strong><font color="#FF0000">&nbsp &nbsp -</font></strong> <strong><font color="#0000FF">from_model</font></strong> model:<a href="COLLECTION.html"><font color="#008000">COLLECTION</font></a>[<a href="COLLECTION.html"><font color="#008000">COLLECTION</font></a>[<a href="COLLECTION.html"><font color="#008000">COLLECTION</font></a>[<font color="#008000">E</font>]]] <-
  <br><em><strong><font color="#707070">&nbsp &nbsp &nbsp &nbsp  The `model' is used to fill line by line the COLLECTION3.</font></strong></em>
  <br><em><strong><font color="#707070">&nbsp &nbsp &nbsp &nbsp  Assume all sub-collections of have the same indexing.</font></strong></em>
    
  <br><font FACE="Sans-serif" color="#000000"><B></B></font>
  <br><font FACE="Sans-serif" color="#000000"><B> Implementation of others feature from COLLECTION3:</B></font>
  <br><font FACE="Sans-serif" color="#000000"><B></B></font>
  
  <br><br><strong><font color="#FF0000">&nbsp &nbsp -</font></strong> <strong><font color="#0000FF">item</font></strong> (line, column, depth:<a href="INTEGER.html"><font color="#008000">INTEGER</font></a>) :<font color="#008000">E</font> <-
      
  <br><br><strong><font color="#FF0000">&nbsp &nbsp -</font></strong> <strong><font color="#0000FF">put</font></strong> element:<font color="#008000">E</font> <strong><font color="#0000FF">to</font></strong> (line, column, depth:<a href="INTEGER.html"><font color="#008000">INTEGER</font></a>) <-
    
  
  <br><br><strong><font color="#FF0000">&nbsp &nbsp -</font></strong> <strong><font color="#0000FF">force</font></strong> element:<font color="#008000">E</font> <strong><font color="#0000FF">to</font></strong> (line, column, depth :<a href="INTEGER.html"><font color="#008000">INTEGER</font></a>) <-
    
  
  <br><br><strong><font color="#FF0000">&nbsp &nbsp -</font></strong> <strong><font color="#0000FF">copy</font></strong> other:<font color="#008000">SELF</font> <-
    
  <br><br><strong><font color="#FF0000">&nbsp &nbsp -</font></strong> <strong><font color="#0000FF">sub_collection3</font></strong> (line_min,column_min,depth_min:<a href="INTEGER.html"><font color="#008000">INTEGER</font></a>) 
  <strong><font color="#0000FF">to</font></strong> (line_max,column_max,depth_max:<a href="INTEGER.html"><font color="#008000">INTEGER</font></a>) :<font color="#008000">SELF</font> <-
    
  <br><font FACE="Sans-serif" color="#000000"><B></B></font>
  <br><font FACE="Sans-serif" color="#000000"><B> Writing:</B></font>
  <br><font FACE="Sans-serif" color="#000000"><B></B></font>
  
  <br><br><strong><font color="#FF0000">&nbsp &nbsp -</font></strong> <strong><font color="#0000FF">set_all_with</font></strong> x:<font color="#008000">E</font> <-
  <br><em><strong><font color="#707070">&nbsp &nbsp &nbsp &nbsp   All element are set with the value x.</font></strong></em>
      
  <br><br><strong><font color="#FF0000">&nbsp &nbsp -</font></strong> <strong><font color="#0000FF">all_default</font></strong>:<a href="BOOLEAN.html"><font color="#008000">BOOLEAN</font></a> <-
      
  <br><br><strong><font color="#FF0000">&nbsp &nbsp -</font></strong> <strong><font color="#0000FF">slice</font></strong> (l1,up1:<a href="INTEGER.html"><font color="#008000">INTEGER</font></a>) <strong><font color="#0000FF">to</font></strong> (l2,up2:<a href="INTEGER.html"><font color="#008000">INTEGER</font></a>) <strong><font color="#0000FF">to</font></strong> (l3,up3:<a href="INTEGER.html"><font color="#008000">INTEGER</font></a>) :<font color="#008000">SELF</font> <-
  <br><em><strong><font color="#707070">&nbsp &nbsp &nbsp &nbsp  Create a new collection initialized with elements of</font></strong></em>
  <br><em><strong><font color="#707070">&nbsp &nbsp &nbsp &nbsp  range `low'..`up'. result has the same dynamic type</font></strong></em>
  <br><em><strong><font color="#707070">&nbsp &nbsp &nbsp &nbsp  as self collection.</font></strong></em>
      
  <br><br><strong><font color="#FF0000">&nbsp &nbsp -</font></strong> <strong><font color="#0000FF">set_slice</font></strong> (l1,up1:<a href="INTEGER.html"><font color="#008000">INTEGER</font></a>) <strong><font color="#0000FF">to</font></strong> (l2,up2:<a href="INTEGER.html"><font color="#008000">INTEGER</font></a>) <strong><font color="#0000FF">to</font></strong> (l3,up3:<a href="INTEGER.html"><font color="#008000">INTEGER</font></a>) <strong><font color="#0000FF">with</font></strong> element:<font color="#008000">E</font> <-
  <br><em><strong><font color="#707070">&nbsp &nbsp &nbsp &nbsp  Set all the elements in the</font></strong></em>
  <br><em><strong><font color="#707070">&nbsp &nbsp &nbsp &nbsp  range [(l1,up1),(l2,up2),(l3,up3)] of</font></strong></em>
  <br><em><strong><font color="#707070">&nbsp &nbsp &nbsp &nbsp  self with the element 'element'.</font></strong></em>
    
  <br><br><strong><font color="#FF0000">&nbsp &nbsp -</font></strong> <strong><font color="#0000FF">swap</font></strong> (line1, column1, depth1:<a href="INTEGER.html"><font color="#008000">INTEGER</font></a>) <strong><font color="#0000FF">with</font></strong> (line2, column2, depth2:<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> Looking and comparison:</B></font>
  <br><font FACE="Sans-serif" color="#000000"><B></B></font>
  
  <br><br><strong><font color="#FF0000">&nbsp &nbsp -</font></strong> <strong><font color="#0000FF">occurrences</font></strong> elt:<font color="#008000">E</font> :<a href="INTEGER.html"><font color="#008000">INTEGER</font></a> <-
      
  <br><br><strong><font color="#FF0000">&nbsp &nbsp -</font></strong> <strong><font color="#0000FF">fast_occurrences</font></strong> elt:<font color="#008000">E</font> :<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> Resizing:</B></font>
  <br><font FACE="Sans-serif" color="#000000"><B></B></font>
  
  <br><br><strong><font color="#FF0000">&nbsp &nbsp -</font></strong> <strong><font color="#0000FF">resize</font></strong> (new_count1,new_count2,new_count3:<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> Looking and Searching:</B></font>
  <br><font FACE="Sans-serif" color="#000000"><B></B></font>
  
  <br><br><strong><font color="#FF0000">&nbsp &nbsp -</font></strong> <strong><font color="#0000FF">has</font></strong> x:<font color="#008000">E</font> :<a href="BOOLEAN.html"><font color="#008000">BOOLEAN</font></a> <-
  <br><em><strong><font color="#707070">&nbsp &nbsp &nbsp &nbsp  Look for `x' using `equal' for comparison.</font></strong></em>
    
  <br><br><strong><font color="#FF0000">&nbsp &nbsp -</font></strong> <strong><font color="#0000FF">fast_has</font></strong> x:<font color="#008000">E</font> :<a href="BOOLEAN.html"><font color="#008000">BOOLEAN</font></a> <-
  <br><em><strong><font color="#707070">&nbsp &nbsp &nbsp &nbsp  Same as `has' but use `=' for comparison</font></strong></em>
    
  <br><font FACE="Sans-serif" color="#000000"><B></B></font>
  <br><font FACE="Sans-serif" color="#000000"><B> Other features:</B></font>
  <br><font FACE="Sans-serif" color="#000000"><B></B></font>
  
  <br><br><strong><font color="#FF0000">&nbsp &nbsp -</font></strong> <strong><font color="#0000FF">replace_all</font></strong> old_value:<font color="#008000">E</font> <strong><font color="#0000FF">with</font></strong> new_value:<font color="#008000">E</font> <-
    
  
  <br><br><strong><font color="#FF0000">&nbsp &nbsp -</font></strong> <strong><font color="#0000FF">fast_replace_all</font></strong> old_value:<font color="#008000">E</font> <strong><font color="#0000FF">with</font></strong> new_value:<font color="#008000">E</font> <-
    
  <br><font FACE="Sans-serif" color="#000000"><B></B></font>
  <br><font FACE="Sans-serif" color="#000000"><B> Invariant.</B></font>
  <br><font FACE="Sans-serif" color="#000000"><B></B></font>
  
<br><font FACE="Sans-serif" color="#000000"><B>  [ ...</B></font>
<br><font FACE="Sans-serif" color="#000000"><B>    -? {count1 = upper1 + 1};</B></font>
<br><font FACE="Sans-serif" color="#000000"><B>    -? {count2 = upper2 + 1}; </B></font>
<br><font FACE="Sans-serif" color="#000000"><B>    -? {count3 = upper3 + 1};</B></font>
<br><font FACE="Sans-serif" color="#000000"><B>    -? {count = count1 * count2 * count3};</B></font>
<br><font FACE="Sans-serif" color="#000000"><B>    -? {count2x3 = count2 * count3};</B></font>
<br><font FACE="Sans-serif" color="#000000"><B>    -? {capacity >= count};</B></font>
<br><font FACE="Sans-serif" color="#000000"><B>  ];</B></font>
  

</body>
</html>