AltErgoLib.Vecval make : int -> dummy:'a -> 'a tmake cap dummy creates a new vector filled with dummy. The vector is initially empty but its underlying array has capacity cap. dummy will stay alive as long as the vector
val create : dummy:'a -> 'a tcreate ~dummy creates an empty vector using dummy as dummy values.
val to_list : 'a t -> 'a listReturns the list of elements of the vector.
val to_rev_list : 'a t -> 'a listReturns the list of elements of the vector in reversed order.
val to_array : 'a t -> 'a arrayval of_list : 'a list -> dummy:'a -> 'a tval clear : 'a t -> unitclear vec sets the size of vec to zero and free the elements.
val shrink : 'a t -> int -> unitshrink vec sz resets size of vec to sz and frees its elements. Assumes sz >=0 && sz <= size vec.
val pop : 'a t -> 'aPop last element, free and return it.
val last : 'a t -> 'aReturn the last element.
val grow_to_by_double : 'a t -> int -> unitgrow_to_by_double vec c grow the capacity of the vector by double it.
val size : 'a t -> intReturns the size of the vector.
val is_empty : 'a t -> boolReturns true if and only if the vector is of size 0.
val is_full : 'a t -> boolIs the capacity of the vector equal to the number of its elements?
val push : 'a t -> 'a -> unitPush element into the vector.
val get : 'a t -> int -> 'aGet the element at the given index, or
val set : 'a t -> int -> 'a -> unitSet the element at the given index, either already set or the first free slot if not (is_full vec), or
val replace : ('a -> 'a) -> 'a t -> int -> unitreplace f vec n is equalivalent to set vec n (f (get vec n)), but with a single bound check.
val fast_remove : 'a t -> int -> unitRemove element at index i without preserving order (swap with last element).
val filter_in_place : ('a -> bool) -> 'a t -> unitfilter_in_place p vec removes from vec the elements that do not satisfy p.
val sort : 'a t -> ('a -> 'a -> int) -> unitSort in place the vector.
val iter : ('a -> unit) -> 'a t -> unitIterate on elements.
val iteri : (int -> 'a -> unit) -> 'a t -> unitIterate on elements with their index.
val fold : ('b -> 'a -> 'b) -> 'b -> 'a t -> 'bFold over elements.
val exists : ('a -> bool) -> 'a t -> boolDoes there exist an element that satisfies the predicate?
val for_all : ('a -> bool) -> 'a t -> boolDo all elements satisfy the predicate?
val pp : 'a Fmt.t -> 'a t Fmt.tpp pp_elt ppf vec prints on the formatter ppf all the elements of vec using the printer pp_elt. Dummy values are also printed.