Module type Parallel_arrays.Inplace

type 'a t
val map_inplace : Parallel_kernel.t @ local -> ('a t -> (f:(Parallel_kernel.t @ local -> ('a -> 'a) @ local) @ shareable -> Base.unit) @ local) @ local @@ portable

map_inplace parallel t ~f overwrites an array with the result of f applied to each of its elements.

val mapi_inplace : Parallel_kernel.t @ local -> ('a t -> (f: (Parallel_kernel.t @ local -> (Base.int -> ('a -> 'a) @ local) @ local) @ shareable -> Base.unit) @ local) @ local @@ portable

mapi_inplace parallel t ~f overwrites an array with the result of f applied to each of its elements and their indices.

val init_inplace : Parallel_kernel.t @ local -> ('a t -> (f:(Parallel_kernel.t @ local -> (Base.int -> 'a) @ local) @ shareable -> Base.unit) @ local) @ local @@ portable

init_inplace parallel t ~f overwrites an array with the result of f applied to each array index. This can be much faster than using mapi_inplace since it does not need to read the array.

val sort_inplace : Parallel_kernel.t @ local -> ('a t -> (compare: (Parallel_kernel.t @ local -> ('a @ local shared -> ('a @ local shared -> Base.int) @ local) @ local) @ shareable -> Base.unit) @ local) @ local @@ portable

sort_inplace parallel t ~compare unstably sorts t with respect to compare.

val stable_sort_inplace : Parallel_kernel.t @ local -> ('a t -> (compare: (Parallel_kernel.t @ local -> ('a @ local shared -> ('a @ local shared -> Base.int) @ local) @ local) @ shareable -> Base.unit) @ local) @ local @@ portable

stable_sort_inplace parallel t ~compare stably sorts t with respect to compare.

val scan_inplace : Parallel_kernel.t @ local -> ('a t -> (init:'a -> (f: (Parallel_kernel.t @ local -> ('a @ shared -> ('a @ shared -> 'a) @ local) @ local) @ shareable -> 'a) @ local) @ local) @ local @@ portable

scan_inplace parallel t ~init ~f overwrites t to contain the its exclusive prefix sums with respect to f. The first element becomes init and the full reduction of t is returned. f must be associative and f init x must equal x.

val scan_inclusive_inplace : Parallel_kernel.t @ local -> ('a t -> (init:'a -> (f: (Parallel_kernel.t @ local -> ('a @ shared -> ('a @ shared -> 'a) @ local) @ local) @ shareable -> Base.unit) @ local) @ local) @ local @@ portable

scan_inclusive_inplace parallel t ~init ~f overwrites t to contain its inclusive prefix sums with respect to f. The first element is unchanged. f must be associative and f init x must equal x.