Lisaac prototype interface

Section Header
+ name := COLLECTION3[E];
- comment := "Abstract definition of a 3 dimensional collection of elements of type E.";
The Lisaac standard library provides two implementations of COLLECTION3: ARRAY3
and FAST_ARRAY3. All implementations have exactly the same behavior.
Switching from one implementation to another only change the memory
used and the execution time.
Section Inherit
- parent_safe_equal:SAFE_EQUAL[E] :=
Section Public
- lower1:INTEGER <-
Lower index bound for dimension 1.
- lower2:INTEGER <-
Lower index bound for dimension 2.
- lower3:INTEGER <-
Lower index bound for dimension 3.
- line_minimum:INTEGER <-
Equivalent of `lower1'.
- column_minimum:INTEGER <-
Equivalent of `lower2'.
- depth_minimum:INTEGER <-
Equivalent of `lower3'.
- upper1:INTEGER <-
Upper index bound for dimension 1.
- upper2:INTEGER <-
Upper index bound for dimension 2.
- upper3:INTEGER <-
Upper index bound for dimension 3.
- line_maximum:INTEGER <-
Equivalent of `upper1'.
- column_maximum:INTEGER <-
Equivalent of `upper2'.
- depth_maximum:INTEGER <-
Equivalent of `upper3'.
Reading:
- item (line, column, depth:INTEGER) :E <-
Writing:
- put element:E to (line, column, depth:INTEGER) <-
- force element:E to (line, column, depth:INTEGER) <-
Put `element' at position (`line',`column',`depth').
Collection is resized first when (`line',`column',`depth')
is not inside current bounds.
New bounds are initialized with default values.
Index validity:
- valid_line line:INTEGER :BOOLEAN <-
- valid_index1 line:INTEGER :BOOLEAN <-
- valid_column column:INTEGER :BOOLEAN <-
- valid_index2 column:INTEGER :BOOLEAN <-
- valid_depth depth:INTEGER :BOOLEAN <-
- valid_index3 depth:INTEGER :BOOLEAN <-
- valid_index (line, column, depth:INTEGER) :BOOLEAN <-
Counting:
- count1:INTEGER <-
Size of the first dimension.
- line_count:INTEGER <-
Equivalent of `count1'.
- count2:INTEGER <-
Size of the second dimension.
- column_count:INTEGER <-
Equivalent of `count2'.
- count3:INTEGER <-
Size of the third dimension.
- depth_count:INTEGER <-
Equivalent of `count3'.
- count:INTEGER <-
Total number of elements.
- swap (line1, column1, depth1:INTEGER) with (line2, column2, depth2:INTEGER) <-
Swap the element at index (`line1',`column1',`depth1')
with the element at index (`line2',`column2',`depth2').
- set_all_with v:E <-
Set all item with value `v'.
- clear_all <-
Set all items to default values.
Creating or initializing:
- from_collection3 model:COLLECTION3[E] <-
Uses `model' to initialize self.
- from_model model:COLLECTION[COLLECTION[COLLECTION[E]]] <-
The `model' is used to fill line by line self.
Assume all sub-collections have the same
dimension.
Looking and comparison:
- all_default:BOOLEAN <-
Do all items have their type's default value?
- '==' other:COLLECTION3[E] :BOOLEAN <-
Do both collections have the same `lower1', `lower2', `lower3', `upper1', `upper2' and
`upper3', and items?
The basic `=' is used for comparison of items.
See also `is_equal_map'.
- is_equal_map other: COLLECTION3[E] :BOOLEAN <-
Do both collections have the same `lower1', `lower2', `lower3', `upper1', `upper2' and `upper3',
and items?
See also `=='.
Printing:
- fill_tagged_out_memory <-
Miscellaneous features:
- occurrences elt:E :INTEGER <-
Number of occurrences using `equal'.
See also `fast_occurrences' to choose the apropriate one.
- fast_occurrences elt:E :INTEGER <-
Number of occurrences using `='.
See also `occurrences' to choose the apropriate one.
- has x:E :BOOLEAN <-
Search if a element x is in the array using `equal'.
See also `fast_has' to choose the apropriate one.
- fast_has x:E :BOOLEAN <-
Search if a element x is in the array using `='.
- replace_all old_value:E with new_value:E <-
Replace all occurences of the element `old_value' by `new_value'
using `equal' for comparison.
See also `fast_replace_all' to choose the apropriate one.
- fast_replace_all old_value:E with new_value:E <-
Replace all occurences of the element `old_value' by `new_value'
using operator `=' for comparison.
See also `replace_all' to choose the apropriate one.
- sub_collection3 (line_min, column_min, depth_min:INTEGER) to (line_max, column_max, depth_max:INTEGER) :SELF <-
Create a new object using selected area of `self'.
- set_area (line_min, column_min, depth_min:INTEGER) to (line_max, column_max, depth_max:INTEGER) with element:E <-
Set all the elements of the selected area rectangle with `element'.