+
Point of view
All features
class FAST_ARRAY2 [E_]
Summary
Resizable two dimensional array. Unlike ARRAY2, the lower1 bound and the lower2 bound are frozen to 0. Thus, one can expect better performances.
Direct parents
Inherit list: COLLECTION2
Insert list: NATIVE_ARRAY_COLLECTOR
Class invariant
Overview
Creation features
{ANY}
Features
{ANY}
{FAST_ARRAY2}
{ANY}
Implementation of others feature from COLLECTION2:
{ANY}
Writing:
{ANY}
Looking and comparison:
{ANY}
Resizing:
{ANY}
Looking and Searching:
{ANY}
Other features:
{ANY}
  • replace_all (old_value: E_, new_value: E_)
    Replace all occurrences of the element old_value by new_value using is_equal for comparison.
  • fast_replace_all (old_value: E_, new_value: E_)
    Replace all occurrences of the element old_value by new_value using operator = for comparison.
  • transpose
    Transpose the Current array
  • to_external: POINTER
    Gives C access to the internal storage (may be dangerous).
Garbage collector tuning (very low-level):
{}
  • mark_native_arrays
    For performance reasons, the unused area of storage is always left as it is when some elements are removed.
Implement manifest generic creation (very low-level):
{}
Indexing:
{ANY}
Index validity:
{ANY}
Counting:
{ANY}
{ANY}
Looking and comparison:
{ANY}
Printing:
{ANY}
Miscellaneous features:
{ANY}
Implement manifest generic creation:
{}
{ANY}
  • test (e1: E_, e2: E_): BOOLEAN
    In order to avoid run-time type errors, feature safe_equal calls is_equal only when e1 and e2 have exactly the same dynamic type.
  • safe_equal (e1: E_, e2: E_): BOOLEAN
    In order to avoid run-time type errors, feature safe_equal calls is_equal only when e1 and e2 have exactly the same dynamic type.
{}
upper1: INTEGER_32
writable attribute
{ANY}
Upper index bounds.
count1: INTEGER_32
writable attribute
{ANY}
Size of the first dimension.
upper2: INTEGER_32
writable attribute
{ANY}
Upper index bounds.
count2: INTEGER_32
writable attribute
{ANY}
Size of the second dimension.
count: INTEGER_32
writable attribute
{ANY}
Total number of elements.
storage: NATIVE_ARRAY[E_]
writable attribute
capacity: INTEGER_32
writable attribute
of storage.
lower1: INTEGER_32
is 0
constant attribute
{ANY}
Lower index bounds.
lower2: INTEGER_32
is 0
constant attribute
{ANY}
Lower index bounds.
make (new_count1: INTEGER_32, new_count2: INTEGER_32)
effective procedure
{ANY}
Create or reset Current with new dimensions.
from_collection2 (model: COLLECTION2[E_])
effective procedure
{ANY}
Uses the model to update Current.
from_collection (contents: COLLECTION[E_], new_count1: INTEGER_32, new_count2: INTEGER_32)
effective procedure
{ANY}
Reset all bounds using new_count#i.
from_model (model: COLLECTION[COLLECTION[E_]])
effective procedure
{ANY}
The model is used to fill line by line the COLLECTION2.
sub_collection2 (line_min: INTEGER_32, line_max: INTEGER_32, column_min: INTEGER_32, column_max: INTEGER_32): FAST_ARRAY2 [E_]
effective function
{ANY}
Create a new object using selected area of Current.
item (line: INTEGER_32, column: INTEGER_32): E_
effective function
{ANY}
put (x: E_, line: INTEGER_32, column: INTEGER_32)
effective procedure
{ANY}
force (element: E_, line: INTEGER_32, column: INTEGER_32)
effective procedure
{ANY}
Put element at position (line,column).
copy (other: FAST_ARRAY2 [E_])
effective procedure
{ANY}
set_all_with (x: E_)
effective procedure
{ANY}
All element are set with the value x.
all_default: BOOLEAN
effective function
{ANY}
Do all items have their type's default value?
slice (line_min: INTEGER_32, line_max: INTEGER_32, column_min: INTEGER_32, column_max: INTEGER_32): FAST_ARRAY2 [E_]
effective function
{ANY}
set_slice (element: E_, l1: INTEGER_32, up1: INTEGER_32, l2: INTEGER_32, up2: INTEGER_32)
effective procedure
{ANY}
Set all the elements in the range [(l1,up1),(l2,up2)] of Current with the element 'element'.
swap (line1: INTEGER_32, column1: INTEGER_32, line2: INTEGER_32, column2: INTEGER_32)
effective procedure
{ANY}
Swap the element at index (line1,column1) with the the element at index (line2,column2).
occurrences (elt: E_): INTEGER_32
effective function
{ANY}
Number of occurrences using is_equal.
fast_occurrences (elt: E_): INTEGER_32
effective function
{ANY}
Number of occurrences using =.
resize (new_count1: INTEGER_32, new_count2: INTEGER_32)
effective procedure
{ANY}
has (x: E_): BOOLEAN
effective function
{ANY}
Look for x using equal for comparison.
fast_has (x: E_): BOOLEAN
effective function
{ANY}
Same as has but use = for comparison
replace_all (old_value: E_, new_value: E_)
effective procedure
{ANY}
Replace all occurrences of the element old_value by new_value using is_equal for comparison.
fast_replace_all (old_value: E_, new_value: E_)
effective procedure
{ANY}
Replace all occurrences of the element old_value by new_value using operator = for comparison.
transpose
effective procedure
{ANY}
Transpose the Current array
to_external: POINTER
effective function
{ANY}
Gives C access to the internal storage (may be dangerous).
mark_native_arrays
effective procedure
{}
For performance reasons, the unused area of storage is always left as it is when some elements are removed.
manifest_make (needed_capacity: INTEGER_32, new_count1: INTEGER_32, new_count2: INTEGER_32)
effective procedure
{}
Create a FAST_ARRAY2[E_] with new_count1 lines and new_count2 columns.
manifest_put (index: INTEGER_32, element: E_)
effective procedure
{}
The elements are stored line by line.
line_minimum: INTEGER_32
frozen
effective function
{ANY}
Equivalent of lower1.
column_minimum: INTEGER_32
frozen
effective function
{ANY}
Equivalent of lower2.
line_maximum: INTEGER_32
frozen
effective function
{ANY}
Equivalent of upper1.
column_maximum: INTEGER_32
frozen
effective function
{ANY}
Equivalent of upper2.
valid_line (line: INTEGER_32): BOOLEAN
frozen
effective function
{ANY}
valid_index1 (line: INTEGER_32): BOOLEAN
effective function
{ANY}
valid_column (column: INTEGER_32): BOOLEAN
frozen
effective function
{ANY}
valid_index2 (column: INTEGER_32): BOOLEAN
effective function
{ANY}
valid_index (line: INTEGER_32, column: INTEGER_32): BOOLEAN
frozen
effective function
{ANY}
line_count: INTEGER_32
frozen
effective function
{ANY}
Equivalent of count1.
column_count: INTEGER_32
frozen
effective function
{ANY}
clear_all
frozen
effective procedure
{ANY}
Set all items to default values.
fast_is_equal (other: FAST_ARRAY2 [E_]): BOOLEAN
effective function
{ANY}
Do both collections have the same lower1, lower2, upper1 and upper2, and items?
is_equal (other: FAST_ARRAY2 [E_]): BOOLEAN
effective function
{ANY}
Do both collections have the same lower1, lower2, upper1 and upper2, and items?
is_equal_map (other: FAST_ARRAY2 [E_]): BOOLEAN
effective function
{ANY}
Do both collections have the same lower, upper, and items?
fill_tagged_out_memory
frozen
effective procedure
{ANY}
Append a viewable information in tagged_out_memory in order to affect the behavior of out, tagged_out, etc.
set_area (element: E_, line_min: INTEGER_32, line_max: INTEGER_32, column_min: INTEGER_32, column_max: INTEGER_32)
effective procedure
{ANY}
Set all the elements of the selected area rectangle with element.
manifest_semicolon_check: BOOLEAN
is True
constant attribute
{}
You can use semicolons to make the end of each line more visible.
test (e1: E_, e2: E_): BOOLEAN
effective function
{ANY}
In order to avoid run-time type errors, feature safe_equal calls is_equal only when e1 and e2 have exactly the same dynamic type.
safe_equal (e1: E_, e2: E_): BOOLEAN
effective function
{ANY}
In order to avoid run-time type errors, feature safe_equal calls is_equal only when e1 and e2 have exactly the same dynamic type.
mark_item (native_array: NATIVE_ARRAY[E_], index: INTEGER_32)
{}
To be used _only_ inside the definition of mark_native_arrays.