package hdf5

  1. Overview
  2. Docs
type e = t
type t
val create : ?capacity:int -> ?growth_factor:float -> unit -> t

Create a vector with the given initial capacity and growth factor.

val capacity : t -> int

Returns the current capacity of the given vector.

val ensure_capacity : t -> int -> unit

Ensures that the vector has at least the given capacity.

val growth_factor : t -> float

Returns the growth factor of the given vector.

val set_growth_factor : t -> float -> unit

Sets the growth factor to the given value.

val length : t -> int

Returns the length of the given vector.

val end_ : t -> e

Returns the end of the given vector or raises an exception if the vector is empty

val realloc : t -> int -> unit

Sets the capacity of the vector to the given size.

val append : t -> e

Appends an element to the end of the vector and returns a pointer to the end.

val clear : t -> unit

Removes all the elements in the vector.

val unsafe_get : t -> int -> e

Unsafely returns the element with the given index in the vector.

val get : t -> int -> e

Returns the element with the given index in the vector.

val iter : t -> f:(e -> unit) -> unit

Iterates through all the element of the vector.

val iteri : t -> f:(int -> e -> unit) -> unit

Iterates through all the element of the vector.

val of_array : ?growth_factor:float -> Array.t -> t

Creates a vector of the given array.

val to_array : t -> Array.t

Creates an array of the given vector.

val on_realloc : t -> (t -> unit) -> unit

Sets a function to be called then whe vector is reallocated.