module CCBV:sig..end
BREAKING CHANGES since 1.2: size is now stored along with the bitvector. Some functions have a new signature.
The size of the bitvector used to be rounded up to the multiple of 30 or 62.
In other words some functions such as CCBV.iter would iterate on more
bits than what was originally asked for. This is not the case anymore.
type t
val empty : unit -> tval create : size:int -> bool -> tval copy : t -> tval cardinal : t -> intval length : t -> intval capacity : t -> intval resize : t -> int -> unitInvalid_arg on negative sizes.val is_empty : t -> boolval set : t -> int -> unitval get : t -> int -> boolval reset : t -> int -> unitval flip : t -> int -> unitval clear : t -> unitval iter : t -> (int -> bool -> unit) -> unitval iter_true : t -> (int -> unit) -> unitval to_list : t -> int listval to_sorted_list : t -> int listCCBV.to_list, but also guarantees the list is sorted in
increasing orderval of_list : int list -> t
The bits are interpreted as indices into the returned bitvector, so the final
bitvector will have length t equal to 1 more than max of list indices.
val first : t -> int optionval first_exn : t -> intNot_found if all bits are 0val filter : t -> (int -> bool) -> unitfilter bv p only keeps the true bits of bv whose index
satisfies p indexval negate_self : t -> unitnegate_self t flips all of the bits in t.val negate : t -> tnegate t returns a copy of t with all of the bits flipped.val union_into : into:t -> t -> unitunion ~into bv sets into to the union of itself and bv.
Also updates the length of into to be at least length bv.
val inter_into : into:t -> t -> unitinter ~into bv sets into to the intersection of itself and bv
Also updates the length of into to be at most length bv.
val union : t -> t -> tunion bv1 bv2 returns the union of the two setsval inter : t -> t -> tinter bv1 bv2 returns the intersection of the two setsval diff_into : into:t -> t -> unitdiff ~into t Modify into with only the bits set but not in t.val diff : t -> t -> tdiff t1 t2 Return those bits found t1 but not in t2.val select : t -> 'a array -> 'a listselect arr bv selects the elements of arr whose index
corresponds to a true bit in bv. If bv is too short, elements of arr
with too high an index cannot be selected and are therefore not
selected.val selecti : t -> 'a array -> ('a * int) listCCBV.select, but selected elements are paired with their indextype'asequence =('a -> unit) -> unit
val to_seq : t -> int sequence
val of_seq : int sequence -> t
val print : Format.formatter -> t -> unit