Page
Library
Module
Module type
Parameter
Class
Class type
Source
Brr.TarraySourceTyped arrays.
DataView objects (byte-level typed data access on ArrayBuffers).
type ('a, 'b) type' = | Int8 : (int, Bigarray.int8_signed_elt) type'| Int16 : (int, Bigarray.int16_signed_elt) type'| Int32 : (int32, Bigarray.int32_elt) type'| Uint8 : (int, Bigarray.int8_unsigned_elt) type'| Uint8_clamped : (int, Bigarray.int8_unsigned_elt) type'| Uint16 : (int, Bigarray.int16_unsigned_elt) type'| Uint32 : (int32, Bigarray.int32_elt) type'| Float32 : (float, Bigarray.float32_elt) type'| Float64 : (float, Bigarray.float64_elt) type'The type for typed array whose elements are of type 'b and are accessed with type 'a.
type_size_in_bytes t is the number of bytes used to store an element of type 'b.
Note. In the functions below.
length. This means that -1 denotes the last element of the buffer.start defaults to 0.stop defaults to length b.The type for ArrayBufferView objects (typed access to ArrayBuffer objects) whose elements are of type 'b and accessed with type 'a. See the type aliases.
create n t is an array of type t with n elements of type 'b initialised to their zero. See also converting.
of_buffer t ~byte_offset ~length b is an array of type t with length elements of type 'b starting at the byte offset byte_offset of b. byte_offset defaults to 0 and length so as to get to the end of the buffer.
byte_offset a is the byte index where a starts in buffer a.
set_tarray a ~dst b sets the values of a starting at index dst with those of b which are converted to match the type of a (unclear how exactly).
fill ~start ~stop v a sets the elements in range [start];[stop-1] to v.
copy_within ~start ~stop ~dst a copies at at dst the elements in range [start];[stop-1].
slice ~start ~stop a is a new array holding a copy of the bytes of a in range [start;stop-1]. This is a copy, use sub to share the data.
sub ~start ~stop a is an array that spans the bytes of b in range [start;stop-1]. This is not a copy, use slice to make a copy.
find sat a is the first index a.i for which sat i a.[i] is true.
find sat a is the first index i for which sat i a.[i] is true.
for_all sat a is true iff all elements a.[i] of b satisfy sat i a.[i].
exists sat a is true iff one elements a.[i] of b satisfies sat i a.[i].
filter sat a is an array with the elements a.[i] of a for which sat i a.[i] is true.
iter f a calls f i a.[i] on each element of a.
map f a is a new typed array with elements of a mapped by f.
fold_left f acc a folds f over the elements of a starting with acc.
fold_right f acc a folds f over the elements of a starting with acc.
Use these in interfaces.
of_tarray t a is an array of type t with the elements of a converted accordingly (unclear how exactly).
of_int_array t arr is an array of type t whose elements are the values of arr, values exceeding the range for the type are taken modulo the range bounds (except for Uint8_clamped).
of_int_array t arr is an array of type t whose elements are the values of arr, values exceeding the range for the type are taken modulo the range bounds (except for Uint8_clamped).
of_jstr s is an unsigned byte array with s as UTF-8 encoded data.
to_jstr a is the UTF-8 encoded data a as a string. Errors if a holds invalid UTF-8.
of_binary_jstr s is an unsigned byte array with the bytes of the JavaScript binary string s. Errors if a code unit of s is greater than 255.
to_binary_jstr a is a JavaScript binary string with the unsigned bytes of a.
to_int_jstr ~sep a is a string with the elements of a printed and separated by sep (defaults to Jstr.sp).
to_hex_jstr ?sep a is a string with the bytes of a printed in lowercase hex and separated by sep (defaults to Jstr.empty).
type_to_bigarray_kind t is t as a bigarray kind. Uint32 is mapped on Bigarray.int32.
type_of_bigarray_kind k is k as a type array type or None if there is no corresponding one.
bigarray_kind a is the bigarray kind of a.
of_bigarray1 b is a typed array with the data of bigarray b. The data buffer is shared.
to_bigarray b is a bigarray with the data of bigarray b. The data buffer is shared.
of_bigarray b is a typed array with the data of bigarray b. The data buffer is shared. XXX. How is the data laid out ?