Module Bigarray.Array3
Three-dimensional arrays. The Array3 structure provides operations similar to those of Bigarray.Genarray, but specialized to the case of three-dimensional arrays.
type ('a, 'b, 'c) tThe type of three-dimensional Bigarrays whose elements have OCaml type
'a, representation kind'b, and memory layout'c.
val create : ('a, 'b) kind -> 'c layout -> int -> int -> int -> ('a, 'b, 'c) tArray3.create kind layout dim1 dim2 dim3returns a new Bigarray of three dimension, whose size isdim1in the first dimension,dim2in the second dimension, anddim3in the third.kindandlayoutdetermine the array element kind and the array layout as described forBigarray.Genarray.create.
val dim1 : ('a, 'b, 'c) t -> intReturn the first dimension of the given three-dimensional Bigarray.
val dim2 : ('a, 'b, 'c) t -> intReturn the second dimension of the given three-dimensional Bigarray.
val dim3 : ('a, 'b, 'c) t -> intReturn the third dimension of the given three-dimensional Bigarray.
val change_layout : ('a, 'b, 'c) t -> 'd layout -> ('a, 'b, 'd) tArray3.change_layout a layoutreturns a Bigarray with the specifiedlayout, sharing the data witha(and hence having the same dimensions asa). No copying of elements is involved: the new array and the original array share the same storage space. The dimensions are reversed, such thatget v [| a; b; c |]in C layout becomesget v [| c+1; b+1; a+1 |]in Fortran layout.- since
- 4.06.0
val size_in_bytes : ('a, 'b, 'c) t -> intsize_in_bytes ais the number of elements inamultiplied bya'skind_size_in_bytes.- since
- 4.03.0
val get : ('a, 'b, 'c) t -> int -> int -> int -> 'aArray3.get a x y z, also writtena.{x,y,z}, returns the element ofaat coordinates (x,y,z).x,yandzmust be within the bounds ofa, as described forBigarray.Genarray.get; otherwise,Invalid_argumentis raised.
val set : ('a, 'b, 'c) t -> int -> int -> int -> 'a -> unitArray3.set a x y v, or alternativelya.{x,y,z} <- v, stores the valuevat coordinates (x,y,z) ina.x,yandzmust be within the bounds ofa, as described forBigarray.Genarray.set; otherwise,Invalid_argumentis raised.
val sub_left : ('a, 'b, c_layout) t -> int -> int -> ('a, 'b, c_layout) tExtract a three-dimensional sub-array of the given three-dimensional Bigarray by restricting the first dimension. See
Bigarray.Genarray.sub_leftfor more details.Array3.sub_leftapplies only to arrays with C layout.
val sub_right : ('a, 'b, fortran_layout) t -> int -> int -> ('a, 'b, fortran_layout) tExtract a three-dimensional sub-array of the given three-dimensional Bigarray by restricting the second dimension. See
Bigarray.Genarray.sub_rightfor more details.Array3.sub_rightapplies only to arrays with Fortran layout.
val slice_left_1 : ('a, 'b, c_layout) t -> int -> int -> ('a, 'b, c_layout) Array1.tExtract a one-dimensional slice of the given three-dimensional Bigarray by fixing the first two coordinates. The integer parameters are the coordinates of the slice to extract. See
Bigarray.Genarray.slice_leftfor more details.Array3.slice_left_1applies only to arrays with C layout.
val slice_right_1 : ('a, 'b, fortran_layout) t -> int -> int -> ('a, 'b, fortran_layout) Array1.tExtract a one-dimensional slice of the given three-dimensional Bigarray by fixing the last two coordinates. The integer parameters are the coordinates of the slice to extract. See
Bigarray.Genarray.slice_rightfor more details.Array3.slice_right_1applies only to arrays with Fortran layout.
val slice_left_2 : ('a, 'b, c_layout) t -> int -> ('a, 'b, c_layout) Array2.tExtract a two-dimensional slice of the given three-dimensional Bigarray by fixing the first coordinate. The integer parameter is the first coordinate of the slice to extract. See
Bigarray.Genarray.slice_leftfor more details.Array3.slice_left_2applies only to arrays with C layout.
val slice_right_2 : ('a, 'b, fortran_layout) t -> int -> ('a, 'b, fortran_layout) Array2.tExtract a two-dimensional slice of the given three-dimensional Bigarray by fixing the last coordinate. The integer parameter is the coordinate of the slice to extract. See
Bigarray.Genarray.slice_rightfor more details.Array3.slice_right_2applies only to arrays with Fortran layout.
val blit : ('a, 'b, 'c) t -> ('a, 'b, 'c) t -> unitCopy the first Bigarray to the second Bigarray. See
Bigarray.Genarray.blitfor more details.
val fill : ('a, 'b, 'c) t -> 'a -> unitFill the given Bigarray with the given value. See
Bigarray.Genarray.fillfor more details.
val of_array : ('a, 'b) kind -> 'c layout -> 'a array array array -> ('a, 'b, 'c) tBuild a three-dimensional Bigarray initialized from the given array of arrays of arrays.
val unsafe_get : ('a, 'b, 'c) t -> int -> int -> int -> 'aLike
Bigarray.Array3.get, but bounds checking is not always performed.
val unsafe_set : ('a, 'b, 'c) t -> int -> int -> int -> 'a -> unitLike
Bigarray.Array3.set, but bounds checking is not always performed.