Module Utils.BoolvectorSource

A vector of bools implemented as compact byte array (8 bools per byte) for efficient storage

Sourcetype 'n t
Sourceval make : 'n Fix.Indexing.cardinal -> bool -> 'n t

make c default creates a new vector of cardinal c, with all bools initialized to default.

  • parameter c

    The domain of the vector.

  • parameter default

    The initial value for all bools.

Sourceval init : 'n Fix.Indexing.cardinal -> ('n Fix.Indexing.index -> bool) -> 'n t

init c f creates a new vector of cardinal c, where each bool is determined by the function f.

Sourceval test : 'n t -> 'n Fix.Indexing.index -> bool

test b n returns the value of the bool at index n in vector b.

Sourceval set : 'n t -> 'n Fix.Indexing.index -> unit

set b n sets the bool at index n in vector b to true.

Sourceval clear : 'n t -> 'n Fix.Indexing.index -> unit

clear b n clears the bool at index n in vector b (sets it to false).

Sourceval from_vector : ('n, 'a) Fix.Indexing.vector -> ('a -> bool) -> 'n t

from_vector vec f creates a new vector where each bool is set to true if the corresponding element in vec satisfies predicate f.