Module Bitarray


module Bitarray: sig .. end
Very small implementation for binary arrays (or "bitarrays"). These require a lot less memory than boolean arrays (the latter use 32 or 64 bits representation for each value depending on the system).


type t = {
   array : (int, Bigarray.int16_unsigned_elt, Bigarray.c_layout) Bigarray.Array1.t;
   length : int;
}
Internal type for the representation of binary arrays.
val length : t -> int
Return the length of a binary array.
val make : int -> bool -> t
Create a fresh binary array of given length and with given boolean value.
val set : t -> int -> bool -> unit
Set the indexed cell in a binary array to the specified value.
val get : t -> int -> bool
Get the value of the indexed cell in a binary array.
val iteri : (int -> bool -> unit) -> t -> unit
Iterator with index for binary arrays.
val iter : (bool -> unit) -> t -> unit
Iterator for binary arrays.
val init : int -> (int -> bool) -> t
Create a fresh binary array of given length and using given indexed function to fill cells.
val append : t -> t -> t
Append two binary arrays to a fresh one.
val concat : t list -> t
Concat a list of binary arrays.
val sub : t -> int -> int -> t
Return a sub array from starting index and with given length.
val copy : t -> t
Return a fresh copy of a binary array.
val fill : t -> int -> int -> bool -> unit
Fill bitarray from given index and for given length with specified value.