Module Base.Uniform_arraySource
Same semantics as 'a Array.t, except it's guaranteed that the representation array is not tagged with Double_array_tag, the tag for float arrays.
This means it's safer to use in the presence of Obj.magic, but it's slower than normal Array if you use it with floats.
It can often be faster than Array if you use it with non-floats.
See Base.Array for comments.
val t_sexp_grammar :
'a Sexplib0.Sexp_grammar.t ->
'a Base.Uniform_array.t Sexplib0.Sexp_grammar.tunsafe_set_omit_phys_equal_check is like unsafe_set, except it doesn't do a phys_equal check to try to skip caml_modify. It is safe to call this even if the values are phys_equal.
unsafe_set_with_caml_modify always calls caml_modify before setting and never gets the old value. This is like unsafe_set_omit_phys_equal_check except it doesn't check whether the old value and the value being set are integers to try to skip caml_modify.
Same as unsafe_set_with_caml_modify, but with bounds check.
Like iter, but the function is applied to the index of the element as first argument, and the element itself as second argument.
unsafe_to_array_inplace__promise_not_a_float converts from a t to an array in place. This function is unsafe if the underlying type is a float.
of_array and to_array return fresh arrays with the same contents rather than returning a reference to the underlying array.
include Base.Blit.S1 with type 'a t := 'a Base.Uniform_array.t
val blit :
src:'a Base.Uniform_array.t ->
src_pos:int ->
dst:'a Base.Uniform_array.t ->
dst_pos:int ->
len:int ->
unitval blito :
src:'a Base.Uniform_array.t ->
?src_pos:int ->
?src_len:int ->
dst:'a Base.Uniform_array.t ->
?dst_pos:int ->
unit ->
unitval unsafe_blit :
src:'a Base.Uniform_array.t ->
src_pos:int ->
dst:'a Base.Uniform_array.t ->
dst_pos:int ->
len:int ->
unitval concat_map :
'a Base.Uniform_array.t ->
f:('a -> 'b Base.Uniform_array.t) ->
'b Base.Uniform_array.tval concat_mapi :
'a Base.Uniform_array.t ->
f:(int -> 'a -> 'b Base.Uniform_array.t) ->
'b Base.Uniform_array.tval partition_map :
'a Base.Uniform_array.t ->
f:('a -> ('b, 'c) Base.Either.t) ->
'b Base.Uniform_array.t * 'c Base.Uniform_array.tval filter_mapi :
'a Base.Uniform_array.t ->
f:(int -> 'a -> 'b option) ->
'b Base.Uniform_array.tval map2_exn :
'a Base.Uniform_array.t ->
'b Base.Uniform_array.t ->
f:('a -> 'b -> 'c) ->
'c Base.Uniform_array.tFunctions with the 2 suffix raise an exception if the lengths of the two given arrays aren't the same.
val fold2_exn :
'a Base.Uniform_array.t ->
'b Base.Uniform_array.t ->
init:'acc ->
f:('acc -> 'a -> 'b -> 'acc) ->
'accval sort :
?pos:int ->
?len:int ->
'a Base.Uniform_array.t ->
compare:('a -> 'a -> int) ->
unitsort uses constant heap space.
To sort only part of the array, specify pos to be the index to start sorting from and len indicating how many elements to sort.
include Base.Binary_searchable.S1 with type 'a t := 'a Base.Uniform_array.t
val binary_search :
?pos:int ->
?len:int ->
'a Base.Uniform_array.t ->
compare:('a -> 'key -> int) ->
[ `Last_strictly_less_than
| `Last_less_than_or_equal_to
| `Last_equal_to
| `First_equal_to
| `First_greater_than_or_equal_to
| `First_strictly_greater_than ] ->
'key ->
int optionval binary_search_segmented :
?pos:int ->
?len:int ->
'a Base.Uniform_array.t ->
segment_of:('a -> [ `Left | `Right ]) ->
[ `Last_on_left | `First_on_right ] ->
int optionExtra lowlevel and unsafe functions
The behavior is undefined if you access an element before setting it.
New obj array filled with Obj.repr 0
val unsafe_set_assuming_currently_int :
Stdlib.Obj.t Base.Uniform_array.t ->
int ->
Stdlib.Obj.t ->
unitunsafe_set_assuming_currently_int t i obj sets index i of t to obj, but only works correctly if the value there is an immediate, i.e. Stdlib.Obj.is_int (get t i). This precondition saves a dynamic check.
unsafe_set_int_assuming_currently_int is similar, except the value being set is an int.
unsafe_set_int is similar but does not assume anything about the target.
val unsafe_set_int_assuming_currently_int :
Stdlib.Obj.t Base.Uniform_array.t ->
int ->
int ->
unitunsafe_clear_if_pointer t i prevents t.(i) from pointing to anything to prevent space leaks. It does this by setting t.(i) to Stdlib.Obj.repr 0. As a performance hack, it only does this when not (Stdlib.Obj.is_int t.(i)). It is an error to access the cleared index before setting it again.