Performs a binary search of buf, returning true if an element equivalent to pat is found. Comparisons will be performed using the supplied predicate or '<' if none is supplied.
Performs a linear scan of buf from [0 .. buf.length$(RP), returning true if an element matching pat is found. Comparisons will be performed using the supplied predicate or '<' if none is supplied.
Performs a linear scan of buf from [0 .. buf.length$(RP), returning true if a sequence matching pat is found. Comparisons will be performed using the supplied predicate or '<' if none is supplied.
Performs a linear scan of buf from [0 .. buf.length$(RP), returning a count of the number of elements matching pat. Comparisons will be performed using the supplied predicate or '==' if none is supplied.
Performs a linear scan of buf from [0 .. buf.length$(RP), returning a count of the number of elements where pred returns true.
Returns a new array containing all elements in setA which are not present in setB and the elements in setB which are not present in setA. Both setA and setB are required to be sorted. Comparisons will be performed using the supplied predicate or '<' if none is supplied.
Performs a linear scan of buf from [0 .. buf.length$(RP), moving all but the first element of each consecutive group of duplicate elements to the end of the sequence. The relative order of all remaining elements will be preserved. Comparisons will be performed using the supplied predicate or '==' if none is supplied.
Performs a linear scan of buf from [0 .. buf.length$(RP), creating a new array with just the elements that satisfy pred. The relative order of elements will be preserved.
Performs a linear scan of buf from [0 .. buf.length$(RP), returning the index of the first element matching pat, or buf.length if no match was found. Comparisons will be performed using the supplied predicate or '==' if none is supplied.
Performs a linear scan of buf from [0 .. buf.length$(RP), returning the index of the first element matching pat, or buf.length if no match was found. Comparisons will be performed using the supplied predicate or '==' if none is supplied.
Performs a linear scan of buf from [0 .. buf.length$(RP), returning the index of the first element that compares equal to the next element in the sequence. Comparisons will be performed using the supplied predicate or '==' if none is supplied.
Performs a linear scan of buf from [0 .. buf.length$(RP), returning the index of the first element where pred returns true.
Performs a parallel linear scan of setA and setB from [0 .. N$(RP) where N = min(setA.length, setB.length), returning true if setA includes all elements in setB and false if not. Both setA and setB are required to be sorted, and duplicates in setB require an equal number of duplicates in setA. Comparisons will be performed using the supplied predicate or '<' if none is supplied.
Computes the intersection of setA and setB as a set operation and returns the retult in a new sorted array. Both setA and setB are required to be sorted. If either setA or setB contain duplicates, the result will contain the smaller number of duplicates from setA and setB. All entries will be copied from setA. Comparisons will be performed using the supplied predicate or '<' if none is supplied.
Performs a linear scan of buf from [0 .. buf.length$(RP), returning the index of the first element matching pat, or buf.length if no match was found. Comparisons will be performed using the supplied predicate or '==' if none is supplied.
Performs a linear scan of buf from [0 .. buf.length$(RP), returning the index of the first element matching pat, or buf.length if no match was found. Comparisons will be performed using the supplied predicate or '==' if none is supplied.
Performs a linear scan of buf from $(LP)buf.length .. 0], returning the index of the first element matching pat, or buf.length if no match was found. Comparisons will be performed using the supplied predicate or '==' if none is supplied.
Performs a linear scan of buf from $(LP)buf.length .. 0], returning the index of the first element matching pat, or buf.length if no match was found. Comparisons will be performed using the supplied predicate or '==' if none is supplied.
Performs a binary search of buf, returning the index of the first location where pat may be inserted without disrupting sort order. If the sort order of pat precedes all elements in buf then 0 will be returned. If the sort order of pat succeeds the largest element in buf then buf.length will be returned. Comparisons will be performed using the supplied predicate or '<' if none is supplied.
Converts buf to a heap using the supplied predicate or '<' if none is supplied.
Apply a function to each element an array. The function's return values are stored in another array.
Performs a parallel linear scan of bufA and bufB from [0 .. N$(RP) where N = min(bufA.length, bufB.length), returning the index of the first element in bufA which does not match the corresponding element in bufB or N if no mismatch occurs. Comparisons will be performed using the supplied predicate or '==' if none is supplied.
Returns a new array containing all elements in setA which are not present in setB. Both setA and setB are required to be sorted. Comparisons will be performed using the supplied predicate or '<' if none is supplied.
Partitions buf such that all elements that satisfy pred will be placed before the elements that do not satisfy pred. The algorithm is not required to be stable.
Removes the top element from buf by swapping it with the bottom element, adjusting it down the heap, and reducing the length of buf by one.
Adds val to buf by appending it and adjusting it up the heap.
Reduce an array of elements to a single element, using a user-supplied reductor function.
Performs a linear scan of buf from [0 .. buf.length$(RP), moving all elements matching pat to the end of the sequence. The relative order of elements not matching pat will be preserved. Comparisons will be performed using the supplied predicate or '==' if none is supplied.
Performs a linear scan of buf from [0 .. buf.length$(RP), moving all elements matching pat to the end of the sequence. The relative order of elements not matching pat will be preserved. Comparisons will be performed '=='.
Performs a linear scan of buf from [0 .. buf.length$(RP), moving all elements that satisfy pred to the end of the sequence. The relative order of elements that do not satisfy pred will be preserved.
Performs a linear scan of buf from [0 .. buf.length$(RP), replacing occurrences of pat with val. Comparisons will be performed using the supplied predicate or '==' if none is supplied.
Performs a linear scan of buf from [0 .. buf.length$(RP), replacing elements where pred returns true with val.
Performs a linear scan of buf from $(LP)buf.length .. 0], returning the index of the first element matching pat, or buf.length if no match was found. Comparisons will be performed using the supplied predicate or '==' if none is supplied.
Performs a linear scan of buf from $(LP)buf.length .. 0], returning the index of the first element matching pat, or buf.length if no match was found. Comparisons will be performed using the supplied predicate or '==' if none is supplied.
Performs a linear scan of buf from $(LP)buf.length .. 0], returning the index of the first element where pred returns true.
Partitions buf with num - 1 as a pivot such that the first num elements will be less than or equal to the remaining elements in the array. Comparisons will be performed using the supplied predicate or '<' if none is supplied. The algorithm is not required to be stable.
Performs a linear scan of buf from [2 .. buf.length$(RP), exchanging each element with an element in the range [0 .. pos$(RP), where pos represents the current array position.
Sorts buf using the supplied predicate or '<' if none is supplied. The algorithm is not required to be stable. The current implementation is based on quicksort, but uses a three-way partitioning scheme to improve performance for ranges containing duplicate values (Bentley and McIlroy, 1993).
Sorts buf as a heap using the supplied predicate or '<' if none is supplied. Calling makeHeap and sortHeap on an array in succession has the effect of sorting the array using the heapsort algorithm.
Performs a binary search of buf, returning the index of the first location beyond where pat may be inserted without disrupting sort order. If the sort order of pat precedes all elements in buf then 0 will be returned. If the sort order of pat succeeds the largest element in buf then buf.length will be returned. Comparisons will be performed using the supplied predicate or '<' if none is supplied.
Computes the union of setA and setB as a set operation and returns the retult in a new sorted array. Both setA and setB are required to be sorted. If either setA or setB contain duplicates, the result will contain the larger number of duplicates from setA and setB. When an overlap occurs, entries will be copied from setA. Comparisons will be performed using the supplied predicate or '<' if none is supplied.
The array module provides array manipulation routines in a manner that balances performance and flexibility. Operations are provided for sorting, and for processing both sorted and unsorted arrays.