. Val-map2, c array Array.map2 f a b applies function f to all the elements of a and b, and builds an array with the results returned by f: [| f a.(0) b.(0); ...; f a.(Array.length a -1) b.(Array.length b -1)|], Raise Invalid_argument if the arrays are not the same size. Since: 4.03

. Array, > 'a array -> bool Array.for_all p [|a1; ...; an|] checks if all elements of the array satisfy the predicate p. That is, it returns, a1) && (p a2) && ... && (p an)

. Val, > 'a array -> bool Array.exists p [|a1; ...; an|] checks if at least one element of the array satisfies the predicate p. That is, it returns, a1) || (p a2) || ... || (p an)

V. Mem, array -> bool mem a l is true if and only if a is equal to an element of l

V. Memq, array -> bool Same as Array.mem[21.2], but uses physical equality instead of structural equality to compare array elements

. Val-check_key1, ('k1, 'k2, 'd) t -> bool Same as Ephemeron

. Val-unset_key2, ('k1, 'k2, 'd) t -> unit Same as Ephemeron

. Val-check_key2, ('k1, 'k2, 'd) t -> bool Same as Ephemeron

. Val-blit_key1, b) t -> ('k1, 'c, 'd) t -> unit Same as Ephemeron

. Val-blit_key2, k2, 'b) t -> ('c, 'k2, 'd) t -> unit Same as Ephemeron

. Val-blit_key12, ('k1, 'k2, 'a) t -> ('k1, 'k2, 'b) t -> unit Same as Ephemeron

V. Unset_data, ('k1, 'k2, 'd) t -> unit Same as Ephemeron

V. Nth, Return the n-th element of the given list. The first element (head of the list) is at position 0. Raise Failure "nth" if the list is too short

. Val-rev_append, rev_append l1 l2 reverses l1 and concatenates it to l2. This is equivalent to List.rev[21.19] l1 @ l2, but rev_append is tail-recursive and more efficient

V. Concat, The elements of the argument are all concatenated together (in the same order) to give the result. Not tail-recursive (length of the argument + length of the longest sub-list)

. Iterators-val-iter, > 'a list -> unit List.iter f [a1; ...; an] applies function f in turn to a1; ...; an. It is equivalent to begin f a1; f a2

V. Iteri, > 'a list -> unit Same as List.iter[21.19], but the function is applied to the index of the element as first argument (counting from 0), and the element itself as second argument

. Val-map, > 'a list -> 'b list List.map f [a1; ...; an] applies function f to a1, ..., an, and builds the list [f a1

V. Mapi, > 'a list -> 'b list Same as List.map[21.19], but the function is applied to the index of the element as first argument (counting from 0), and the element itself as second argument

V. Rev_map, > 'a list -> 'b list List.rev_map f l gives the same result as List.rev[21.19] (List.map[21.19] f l), but is tail-recursive and more efficient

V. Fold_right, Not tail-recursive

. Val-map2, > 'a list -> 'b list -> 'c list List.map2 f [a1; ...; an] [b1; ...; bn] is [f a1 b1

. Val-fold_right2, > 'a list -> 'b list -> 'c -> 'c List.fold_right2 f [a1; ...; an] [b1, pp.1-1

. Val-chown, string -> int -> int -> unit Change the owner uid and owner gid of the named file. On Windows: not implemented (make no sense on a DOS file system)

. Val-fchown, file_descr -> int -> int -> unit Change the owner uid and owner gid of an opened file. On Windows: not implemented (make no sense on a DOS file system)

V. Clear_close_on_exec, close-on-exec " flag on the given descriptor. See Unix.set_close_on_exec[23.1]. Similar to Unix.open_process[23.1], but the second argument specifies the environment passed to the command. The result is a triple of channels connected respectively to the standard output, standard input, and standard error of the command

. Val-establish_server, (Pervasives.in_channel -> Pervasives.out_channel -> unit) -> sockaddr -> unit Arithmetic operations val (+/) : num -> num -> num Same as Num

. Val, num -> num -> num Same as Num

. Val-power_num:-num->-num->-num, Exponentiation val abs_num : num -> num val le_num : num -> num -> bool val gt_num : num -> num -> bool val ge_num : num -> num -> bool val compare_num : num -> num -> int Return -1, 0 or 1 if the first argument is less than, equal to, or greater than the second argument

. Val and . Unix, file_descr -> bytes -> int -> int -> float -> int Behave as ThreadUnix.read[26.5] and ThreadUnix.write[26.5], except that Unix_error(ETIMEDOUT,_,_) is raised if no data is available for reading or ready for writing after d seconds. The delay d is given in the fifth argument

. Val and . Unix, file_descr -> string -> int -> int -> float -> int See ThreadUnix

V. Rgb, int -> int -> int -> color rgb r g b returns the integer encoding the color with red component r, green component g, and blue component b. r, g and b are in the range 0

. Val-char, Extract a sub-array of lower dimension from the given big array by fixing one or several of the first (left-most) coordinates. Genarray.slice_left a [|i1; ... ; iM|] returns the 'slice' of a obtained by setting the first M coordinates to i1, . . ., iM. If a has N dimensions, the slice has dimension N -M, and the element at coordinates [|j1; ...; j(N-M)|] in the slice is identical to the element at coordinates [|i1; ...; iM; j1, the original array a. No copying of elements is involved: the slice and the original array share the same storage space

. Genarray, slice_left applies only to big arrays in C layout Raise Invalid_argument if M >= N, or if [|i1; ... ; iM|] is outside the bounds of a

V. Slice_right, Bigarray.fortran_layout) t -> int array -> ('a

. Genarray, slice_right applies only to big arrays in Fortran layout Raise Invalid_argument if M >= N, or if [|i1; ... ; iM|] is outside the bounds of a

V. Blit, c) t -> unit Copy all elements of a big array in another big array. Genarray.blit src dst copies all elements of src into dst. Both arrays src and dst must have the same number of dimensions and equal dimensions. Copying a sub-array of src to a sub-array of dst can be achieved by applying Genarray

. Val-map_file, Bigarray.kind -> 'c Bigarray.layout -> bool -> int array -> ('a, 'b, 'c) t Memory mapping of a file as a big array. Genarray.map_file fd kind layout shared dims returns a big array of kind kind, layout layout, and dimensions as specified in dims. The data contained in this big array are the contents of the file referred to by the file descriptor fd (as opened previously with Unix.openfile, for val dim, p.64

. Val-size_in_bytes, c) t -> int size_in_bytes a is the number of elements in a multiplied by a's Bigarray

V. Blit, c) t -> ('a, 'b, 'c) t -> unit Copy the first big array to the second big array

. Val-dim2, c) t -> int Return the second dimension of the given two-dimensional big array

. Val-size_in_bytes, c) t -> int size_in_bytes a is the number of elements in a multiplied by a's Bigarray

V. Sub_left, Bigarray.c_layout) t -> int -> int -> ('a

V. Sub_right, Bigarray.fortran_layout) t -> int -> int -> ('a

V. Slice_left, Bigarray.c_layout) t -> int -> ('a, 'b, Bigarray.c_layout) Bigarray.Array1.t Extract a row (one-dimensional slice) of the given two-dimensional big array. The integer parameter is the index of the row to extract

V. Slice_right, Bigarray.fortran_layout) t -> int -> ('a, 'b, Bigarray.fortran_layout) Bigarray.Array1.t Extract a column (one-dimensional slice) of the given two-dimensional big array. The integer parameter is the index of the column to extract

V. Blit, c) t -> ('a, 'b, 'c) t -> unit Copy the first big array to the second big array

V. Of_array, b) Bigarray.kind -> 'c Bigarray.layout -> 'a array array -> ('a

. Val-map_file, b) Bigarray.kind -> 'c Bigarray.layout -> bool -> int -> int -> ('a, 'b, 'c) t Memory mapping of a file as a two-dimensional big array, p.64

V. Unsafe_set, c) t -> int -> int -> 'a -> unit Like Bigarray.Array2.set[29.1], but bounds checking is not always performed. end Two-dimensional arrays. The Array2 structure provides operations similar to those of Bigarray

. Val-dim1, c) t -> int Return the first dimension of the given three-dimensional big array

. Val-dim2, c) t -> int Return the second dimension of the given three-dimensional big array

. Val-dim3, c) t -> int Return the third dimension of the given three-dimensional big array

. Val-size_in_bytes, c) t -> int size_in_bytes a is the number of elements in a multiplied by a's Bigarray

. Val, c) t -> int -> int -> int -> 'a -> unit Array3.set a x y v, or alternatively a.{x,y,z} <-v, stores the value v at coordinates (x, y, z) in a. x, y and z must be within the bounds of a

V. Sub_left, Bigarray.c_layout) t -> int -> int -> ('a

V. Sub_right, Bigarray.fortran_layout) t -> int -> int -> ('a

. Val-slice_left_1, Bigarray.c_layout) t -> int -> int -> ('a, 'b, Bigarray.c_layout) Bigarray.Array1.t Extract a one-dimensional slice of the given three-dimensional big array by fixing the first two coordinates. The integer parameters are the coordinates of the slice to extract

. Val-slice_right_1, Bigarray.fortran_layout) t -> int -> int -> ('a, 'b, Bigarray.fortran_layout) Bigarray.Array1.t Extract a one-dimensional slice of the given three-dimensional big array by fixing the last two coordinates. The integer parameters are the coordinates of the slice to extract

S. Bigarray and . Genarray, slice_right[29.1] for more details. Array3.slice_right_1 applies only to arrays with Fortran layout

. Val-slice_left_2, Bigarray.c_layout) t -> int -> ('a, 'b, Bigarray.c_layout) Bigarray.Array2.t Extract a two-dimensional slice of the given three-dimensional big array by fixing the first coordinate. The integer parameter is the first coordinate of the slice to extract

S. Bigarray and . Genarray, slice_left[29.1] for more details. Array3.slice_left_2 applies only to arrays with C layout

. Val-slice_right_2, Bigarray.fortran_layout) t -> int -> ('a, 'b, Bigarray.fortran_layout) Bigarray.Array2.t Extract a two-dimensional slice of the given three-dimensional big array by fixing the last coordinate. The integer parameter is the coordinate of the slice to extract

V. Blit, c) t -> ('a, 'b, 'c) t -> unit Copy the first big array to the second big array

V. Of_array, b) Bigarray.kind -> 'c Bigarray.layout -> 'a array array array -> ('a

. Val and . Unix, file_descr -> ?pos:int64 -> ('a, 'b) Bigarray.kind -> 'c Bigarray.layout -> bool -> int -> int -> int -> ('a

V. Unsafe_set, c) t -> int -> int -> int -> 'a -> unit Like Bigarray.Array3.set[29.1], but bounds checking is not always performed. end Three-dimensional arrays. The Array3 structure provides operations similar to those of Bigarray

. Val-genarray_of_array2, c) Array2.t -> ('a, 'b, 'c) Genarray.t Return the generic big array corresponding to the given two-dimensional big array

. Val-genarray_of_array3, c) Array3.t -> ('a, 'b, 'c) Genarray.t Return the generic big array corresponding to the given three-dimensional big array

. Val-reshape_1, c) Genarray.t -> int -> ('a, 'b, 'c) Array1.t Specialized version of Bigarray

. Val-reshape_2, c) Genarray.t -> int -> int -> ('a