class ARRAY{TYP} < $ARR{TYP}
****

________This_class_implements_one-dimensional_arrays_of_elements_of_type_TYP.
___The_operations_provided_include_sorting,_searching,_etc._Array_indices
___start_at_0_and_go_up_to_`asize-1'.

________Most_features_here_work_when_self_is_void._The_intent_is_that
___a_void_array_behaves_just_like_a_zero-sized_array._Thus_self_may_be_void
___on_operations_which_don't_try_to_directly_access_specific_elements_since
___any_such_access_would_be_out_of_range.


Flattened version is here

Ancestors
$ARR{_} $RO_ARR{_} $CONTAINER{_} $STR
$COPY $FILTERS{_} $ELT{_} $ELT
AREF{_}



Public


Features
append(arr : SAME) : SAME
append(arr1,arr2 : SAME) : SAME
append(arr1,arr2,arr3 : SAME) : SAME
append(elem:TYP):SAME
binary_search(elem : TYP) : CARD
binary_search_by(elem : TYP,order : ROUT{TYP,TYP} : BOOL) : CARD
clear
**** This routine sets each array element to void. Built-in to this
___implementation._Self_may_be_void.
contains(elem : TYP) : BOOL
**** This predicate returns true if and only if self contains an element
___for_which_elt_eq_returns_true,_otherwise_false.
copy(src : SAME)
copy(beg : CARD, src : SAME )
copy(beg,num : CARD, src : SAME )
copy(beg, num, srcbeg : CARD, src : SAME)
copy : SAME
count(val : TYP) : CARD
create(arr : ARRAY{TYP}) : SAME
**** This routine creates a new array which has exactly the same contents as arr.
create(sz : CARD) : SAME
**** This routine creates a new array of the given size, all of whose
___elements_are_void.
create : SAME
**** This routine creates an empty array.
create_from(elems : $ELT{TYP}) : SAME
**** This routine creates an array out of the elements of "elems". It is
___expensive_-_first_converts_the_argument_into_an_FLIST_to_determine_the
___number_of_elements_and_then_converts_the_FLIST_into_an_array.
equals(arr : $CONTAINER{TYP}) : BOOL
**** This predicate returns true if and only if all elements of self are
___the_same_as_the_corresponding_elements_of_arr.
find_if(test : ROUT{TYP} : BOOL) : TYP
has(elem : TYP ) : BOOL
**** This predicate is a renaming of contains.
has_ind(val : CARD) : BOOL
**** This predicate returns true if and only if val is a valid index for the array.
index_if(test : ROUT{TYP} : BOOL) : CARD
index_of(elem : TYP) : CARD
inds : ARRAY{CARD}
insertion_sort_by(order : ROUT{TYP,TYP} : BOOL)
insertion_sort_range(lower,upper : CARD)
is_sorted : BOOL
**** This predicate returns true if and only if the elements of self are
___sorted_according_to_the_relation_elt_lt.___Self_may_be_void.
is_sorted_by(order : ROUT{TYP,TYP} : BOOL) : BOOL
map(operation : ROUT{TYP} : TYP)
median : TYP
merge_with_by(arr : SAME,order : ROUT{TYP,TYP} : BOOL) : SAME
mismatch(arr : SAME) : CARD
quicksort_range(lower,upper : CARD)
reduce(operation : ROUT{TYP,TYP} : TYP) : TYP
remove(elem : TYP) : SAME
remove_duplicates : SAME
remove_if(test : ROUT{TYP} : BOOL) : SAME
resize(new_size : CARD) : SAME
reverse : SAME
**** This routine returns a copy of self with all elements in reverse order. Self may be void.
scan(operation : ROUT{TYP,TYP} : TYP)
search(arr : SAME) : CARD
search(beg : CARD, arr : SAME) : CARD
select( index : CARD)
select_by(order : ROUT{TYP,TYP} : BOOL,index : CARD)
size : CARD
**** This routine returns the number of elements in the array. Self may
___be_void.__Built-in_to_this_implementation.
slice(beg,num : CARD) : SAME
sort
stable_sort
to(src : SAME)
to_replace(old, new_val : TYP)
to_replace_if(test : ROUT{TYP} : BOOL, new_val : TYP)
to_reverse
**** This routine reverses the order of the elements in self. Self may be void.
to_val(val : TYP)

Iters
elt!(once beg : CARD) : TYP
elt!(once beg,once num : CARD) : TYP
elt!(once beg,once num : CARD,once step : INT) : TYP
elt! : TYP
****
elt_rev! :TYP
****
__This_iter_yields_each_element_of_self_in_reversed_order._Self_may_be_void.
ind! : CARD
ind1! : CARD
ind_rev! :CARD
**** This iter yields the indices of self in reversed order. Self may be void.
set!(val : TYP)
set!( once beg : CARD, val : TYP)
set!( once beg,once num : CARD,val : TYP)
set!( once beg,once num : CARD,once step : INT,val : TYP)


Private

is_sorted(lower : CARD, upper : CARD ) : BOOL
**** This predicate returns true if and only if the elements of self are
___sorted_according_to_the_relation_elt_lt.___Self_may_be_void.
const quicksort_limit : CARD := 10 ;

The Sather Home Page