logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Bigarray.Array3 - Three-dimensional arrays.

Documentation

       Module Array3
        : sigend

       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)t

       The type of three-dimensional Bigarrays whose elements have OCaml type 'a , representation kind 'b ,  and
       memory layout 'c .

       valcreate : ('a,'b)Bigarray.kind->'cBigarray.layout->int->int->int->('a,'b,'c)tArray3.createkindlayoutdim1dim2dim3 returns a new Bigarray of three dimensions, whose size is dim1
       in the first dimension, dim2 in the second dimension, and dim3 in the third.  kind and  layout  determine
       the array element kind and the array layout as described for Bigarray.Genarray.create .

       valinit : ('a,'b)Bigarray.kind->'cBigarray.layout->int->int->int->(int->int->int->'a)->('a,'b,'c)tArray3.initkindlayoutdim1dim2dim3f returns a new Bigarray b of three dimensions, whose size is dim1
       in  the  first dimension, dim2 in the second dimension, and dim3 in the third.  kind and layout determine
       the array element kind and the array layout as described for Bigarray.Genarray.create .

       Each element Array3.getbijk of the array is initialized to the result of fijk .

       In other words, Array3.initkindlayoutdim1dim2dim3f tabulates  the  results  of  f  applied  to  the
       indices of a new Bigarray whose layout is described by kind , layout , dim1 , dim2 and dim3 .

       Since 4.12

       valdim1 : ('a,'b,'c)t->int

       Return the first dimension of the given three-dimensional Bigarray.

       valdim2 : ('a,'b,'c)t->int

       Return the second dimension of the given three-dimensional Bigarray.

       valdim3 : ('a,'b,'c)t->int

       Return the third dimension of the given three-dimensional Bigarray.

       valkind : ('a,'b,'c)t->('a,'b)Bigarray.kind

       Return the kind of the given Bigarray.

       vallayout : ('a,'b,'c)t->'cBigarray.layout

       Return the layout of the given Bigarray.

       valchange_layout : ('a,'b,'c)t->'dBigarray.layout->('a,'b,'d)tArray3.change_layoutalayout returns a Bigarray with the specified layout , sharing the data with a (and
       hence  having  the  same  dimensions  as  a  ). No copying of elements is involved: the new array and the
       original array share the same storage space.  The dimensions are reversed, such that getv[|a;b;c|]
       in C layout becomes getv[|c+1;b+1;a+1|] in Fortran layout.

       Since 4.06

       valsize_in_bytes : ('a,'b,'c)t->intsize_in_bytesa is the number of elements in a multiplied by a 's Bigarray.kind_size_in_bytes .

       Since 4.03

       valget : ('a,'b,'c)t->int->int->int->'aArray3.getaxyz , also written a.{x,y,z} , returns the element of a at coordinates ( x , y , z ).  x ,
       y  and  z  must  be  within  the  bounds  of  a  ,  as  described  for Bigarray.Genarray.get ; otherwise,
       Invalid_argument is raised.

       valset : ('a,'b,'c)t->int->int->int->'a->unitArray3.setaxyv , 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 , as described  for  Bigarray.Genarray.set  ;  otherwise,
       Invalid_argument is raised.

       valsub_left : ('a,'b,Bigarray.c_layout)t->int->int->('a,'b,Bigarray.c_layout)t

       Extract  a  three-dimensional  sub-array of the given three-dimensional Bigarray by restricting the first
       dimension.  See Bigarray.Genarray.sub_left for more details.  Array3.sub_left applies only to arrays with
       C layout.

       valsub_right : ('a,'b,Bigarray.fortran_layout)t->int->int->('a,'b,Bigarray.fortran_layout)t

       Extract a three-dimensional sub-array of the given three-dimensional Bigarray by restricting  the  second
       dimension.   See  Bigarray.Genarray.sub_right  for more details.  Array3.sub_right applies only to arrays
       with Fortran layout.

       valslice_left_1 :  ('a,'b,Bigarray.c_layout)t->int->int->('a,'b,Bigarray.c_layout)Bigarray.Array1.t

       Extract  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_left for more details.  Array3.slice_left_1 applies only to arrays with C layout.

       valslice_right_1   :   ('a,'b,Bigarray.fortran_layout)t->int->int->('a,'b,Bigarray.fortran_layout)Bigarray.Array1.t

       Extract 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_right for more details.  Array3.slice_right_1 applies only to arrays with Fortran
       layout.

       valslice_left_2 : ('a,'b,Bigarray.c_layout)t->int->('a,'b,Bigarray.c_layout)Bigarray.Array2.t

       Extract 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_left
       for more details.  Array3.slice_left_2 applies only to arrays with C layout.

       valslice_right_2 : ('a,'b,Bigarray.fortran_layout)t->int->('a,'b,Bigarray.fortran_layout)Bigarray.Array2.t

       Extract  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_right  for
       more details.  Array3.slice_right_2 applies only to arrays with Fortran layout.

       valblit : ('a,'b,'c)t->('a,'b,'c)t->unit

       Copy the first Bigarray to the second Bigarray.  See Bigarray.Genarray.blit for more details.

       valfill : ('a,'b,'c)t->'a->unit

       Fill the given Bigarray with the given value.  See Bigarray.Genarray.fill for more details.

       valof_array : ('a,'b)Bigarray.kind->'cBigarray.layout->'aarrayarrayarray->('a,'b,'c)t

       Build a three-dimensional Bigarray initialized from the given array of arrays of arrays.

       valunsafe_get : ('a,'b,'c)t->int->int->int->'a

       Like Bigarray.Array3.get , but bounds checking is not always performed.

       valunsafe_set : ('a,'b,'c)t->int->int->int->'a->unit

       Like Bigarray.Array3.set , but bounds checking is not always performed.

OCamldoc                                           2025-06-12                                Bigarray.Array3(3o)

Module

       Module   Bigarray.Array3

Name

       Bigarray.Array3 - Three-dimensional arrays.

See Also