Module Sek__.ArrayExtra
val iter : (Sek__.PrivateSignatures.pov -> 'c -> 'a Sek__.PublicTypeAbbreviations.segments) -> Sek__.PrivateSignatures.pov -> ('a -> unit) -> 'c -> unit
iter
transforms aniter_segments
function, which performs per-segment iteration over a collection, into aniter
function, which performs per-element iteration.
val iter2 : (Sek__.PrivateSignatures.pov -> 'c1 -> 'c2 -> ('a1, 'a2) Sek__.PublicTypeAbbreviations.segments2) -> Sek__.PrivateSignatures.pov -> ('a1 -> 'a2 -> unit) -> 'c1 -> 'c2 -> unit
iter2
transforms aniter2_segments
function, which performs per-segment iteration over two collections, into aniter2
function, which performs per-element iteration.
val fill_circularly : 'a array -> Sek__.PublicTypeAbbreviations.index -> Sek__.PublicTypeAbbreviations.length -> 'a -> unit
fill_circularly a i k x
fills the arraya2
, starting at indexi2
, withk
copies of the valuex
. The destination array is regarded as circular, so it is permitted for the destination range to wrap around.
val blit_circularly : 'a array -> Sek__.PublicTypeAbbreviations.index -> 'a array -> Sek__.PublicTypeAbbreviations.index -> Sek__.PublicTypeAbbreviations.length -> unit
blit_circularly a1 i1 a2 i2 k
copiesk
elements from the arraya1
, starting at indexi1
, to the arraya2
, starting at indexi2
. Both the source array and the destination array are regarded as circular, so it is permitted for the source range or destination range to wrap around.i1
must be comprised between 0 included andArray.length a1
excluded.i2
must be comprised between 0 included andArray.length a2
excluded.k
must be comprised between 0 included andArray.length a2
included.
val cut : Sek__.PublicTypeAbbreviations.capacity -> Sek__.PublicTypeAbbreviations.capacity -> Sek__.PublicTypeAbbreviations.length -> (Sek__.PublicTypeAbbreviations.index * Sek__.PublicTypeAbbreviations.length) * ((Sek__.PublicTypeAbbreviations.index -> Sek__.PublicTypeAbbreviations.length -> unit) -> unit) * (Sek__.PublicTypeAbbreviations.index * Sek__.PublicTypeAbbreviations.length)
cut n0 n size
distributessize
elements into a front segment of sizemin n0 size
, followed with a number of segments of sizen
, followed with a last segment of some size no greater thann
. It returns a triple of the front segment, an iterator on the segments in the middle range, and the back segment. Each segment is described by an index and a length.n
must be positive.cut
guarantees that if the front or back segment is empty, then there are no segments in the middle range.
val concat_segments : Sek__.PrivateSignatures.pov -> 'a -> Sek__.PublicTypeAbbreviations.capacity -> 'a Sek__.PublicTypeAbbreviations.segments -> 'a array
concat_segments pov default n segments
creates an array of lengthn
and populates it by copying data from a series of array segments.segments
is an iterator on triples of the forma, i, k
, wherea
is an array,i
is a start offset ina
, andk
is a length. The integern
must be the sum of the lengths of the segments. Whenpov
isBack
, the segments must be produced in reverse order. The data in each segment remains described from left to right. For example, if the first segment isa1, i1, k1
and the second one isa2, i2, k2
then the resulting array stores first the values froma2.(i2)
toa2.(i2+k2-1)
, then the values froma1.(i1)
toa1.(i1+k1-1)
.