Functor that creates resizable float arrays from reallocation strategies.
val length : t ‑> int
length ra
ra
excluding the reserved space.val lix : t ‑> int
lix ra
ra
excluding the reserved space.val real_length : t ‑> int
real_length ra
ra
including the reserved space.val real_lix : t ‑> int
real_lix ra
ra
including the reserved space.screate s n
Returns a resizable array with strategy s
containing n
arbitrary elements.
Attention: the contents is not specified!
sinit s n f
n
containing
elements that were created by applying function f
to the index,
using strategy s
.set_strategy ra s
sets the reallocation strategy of
resizable array ra
to s
, possibly causing an immediate
reallocation.
put_strategy ra s
sets the reallocation strategy of
resizable array ra
to s
. Reallocation is only done at later
changes in size.
val enforce_strategy : t ‑> unit
enforce_strategy ra
forces a reallocation if necessary
(e.g. after a put_strategy
.
sub ra ofs len
len
from resizable array ra
starting at offset ofs
using the
default strategy.fill ra ofs len el
fills resizable array ra
from offset
ofs
with len
elements el
, possibly adding elements at the
end. Raises Invalid_argument
if offset ofs
is larger than the
length of the array.
blit ra1 ofs1 ra2 ofs2 len
blits resizable array ra1
onto
ra2
reading len
elements from offset ofs1
and writing them
to ofs2
, possibly adding elements at the end of ra2. Raises
Invalid_argument
if ofs1
and len
do not designate a valid
subarray of ra1
or if ofs2
is larger than the length of
ra2
.
append ra1 ra2
ra1
and ra2
in this order onto
it.concat l
l
in their respective
order onto it.val remove_one : t ‑> unit
remove_one ra
removes the last element of resizable array
ra
, possibly causing a reallocation.
val remove_n : t ‑> int ‑> unit
remove_n ra n
removes the last n elements of resizable
array ra
, possibly causing a reallocation.
n < 0
.val remove_range : t ‑> int ‑> int ‑> unit
remove_range ra ofs len
removes len
elements from resizable
array ra
starting at ofs
and possibly causing a
reallocation.
val clear : t ‑> unit
clear ra
removes all elements from resizable array ra
,
possibly causing a reallocation.
val swap : t ‑> int ‑> int ‑> unit
swap ra n m
swaps elements at indices n
and m
.
val swap_in_last : t ‑> int ‑> unit
swap_in_last ra n
swaps the last element with the one at
position n
.
n
is out of range.map f ra
ra
and mapping each element in ra
to its corresponding position
in the new array using function f
.mapi f ra
ra
and mapping each element in ra
to its corresponding
position in the new array using function f
and the index
position.fold_right f a ra
right-folds values in resizable array ra
using function f
and start accumulator a
.
for_all p ra
true
if all elements in resizable
array ra
satisfy the predicate p
, false
otherwise.exists p ra
true
if at least one element in
resizable array ra
satisfies the predicate p
, false
otherwise.mem el ra
true
if element el
is logically equal
to any element in resizable array ra
, false
otherwise.memq el ra
true
if element el
is physically equal
to any element in resizable array ra
, false
otherwise.pos el ra
Some index
if el
is logically
equal to the element at index
in ra
, None
otherwise. index
is the index of the first element that matches.posq el ra
Some index
if el
is physically
equal to the element at index
in ra
, None
otherwise. index
is the index of the first element that matches.find p ra
ra
that satisfies predicate p
.find_index p ra pos
p
in resizable array ra
, starting
search at index pos
.pos
is larger
than the highest index.pos
is negative.filter p ra
ra
that satisfy predicate p
using the same
strategy as ra
.partition p ra
ra
that satisfy predicate
p
, the right one only those that do not satisfy it. Both returned
arrays are created using the strategy of ra
.val unsafe_remove_one : t ‑> unit
val unsafe_remove_n : t ‑> int ‑> unit
val unsafe_swap : t ‑> int ‑> int ‑> unit
val unsafe_swap_in_last : t ‑> int ‑> unit