package partition_map
Module Partition_map.Ascending
val empty : 'a tEmpty constructor.
val is_empty : 'a t -> boolTest whether a ascending partition map is empty.
val of_descending : eq:'a equality -> 'a Descending.t -> 'a tConvert a descending partition map into an ascending.
of_ascending_interval_list converts ascending pairs of intervals into an ascending partition map. For example: (0,100),'a'; (101,200), 'b'.
val init : size:int -> 'a -> 'a tInitialize a partition map of the given size with one value.
val to_string : 'a t -> ('a -> string) -> stringConvert to a string.
val get : 'a t -> int -> 'aget t i returns the value associated with the i'th domain element.
Map the values, the size of the domain does not change.
Merge partition maps.
One can think of this as a "map2", but please see the note for why I chose to call them merges instead.
Merge takes a specific equality predicate because it compresses new values generated by the mapping. When we compute a new value from the 2 intersecting elements, we will scan an accumulator and add it if it is not equal to the other elements in the accumulator. Specifying, a good predicate for such an operation is important as it is intended to constrain the size of the final result.
Merge 3 partition maps, see merge.
val merge4 :
'a t ->
'b t ->
'c t ->
'd t ->
eq:('e -> 'e -> bool) ->
f:('a -> 'b -> 'c -> 'd -> 'e) ->
'e tMerge 5 partition maps, see merge.
val fold_values : 'a t -> f:('b -> 'a -> 'b) -> init:'b -> 'bval fold_indices_and_values :
'a t ->
f:('b -> int -> 'a -> 'b) ->
init:'b ->
'bFold over the indices 0,size) and values.
val iter_indices_and_values : 'a t -> f:(int -> 'a -> unit) -> unitval to_array : 'a t -> 'a arrayval size : 'a t -> intval length : 'a t -> intval descending : 'a t -> 'a Descending.t