package nx

  1. Overview
  2. Docs

Module Bigarray_ext.Array2Source

include module type of struct include Bigarray.Array2 end
Sourcetype (!'a, !'b, !'c) t = ('a, 'b, 'c) Bigarray.Array2.t

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

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

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

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

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

Sourceval layout : ('a, 'b, 'c) t -> 'c Bigarray.layout

Return the layout of the given Bigarray.

Sourceval change_layout : ('a, 'b, 'c) t -> 'd Bigarray.layout -> ('a, 'b, 'd) t

Array2.change_layout a layout 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 get v [| a; b |] in C layout becomes get v [| b+1; a+1 |] in Fortran layout.

  • since 4.06
Sourceval size_in_bytes : ('a, 'b, 'c) t -> int

size_in_bytes a is the number of elements in a multiplied by a's kind_size_in_bytes.

  • since 4.03
Sourceval sub_left : ('a, 'b, Bigarray.c_layout) t -> int -> int -> ('a, 'b, Bigarray.c_layout) t

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

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

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

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

Extract a row (one-dimensional slice) of the given two-dimensional Bigarray. The integer parameter is the index of the row to extract. See Bigarray.Genarray.slice_left for more details. Array2.slice_left applies only to arrays with C layout.

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

Extract a column (one-dimensional slice) of the given two-dimensional Bigarray. The integer parameter is the index of the column to extract. See Bigarray.Genarray.slice_right for more details. Array2.slice_right applies only to arrays with Fortran layout.

Sourceval create : 'a 'b 'c. ('a, 'b) kind -> 'c layout -> int -> int -> ('a, 'b, 'c) t
Sourceval kind : 'a 'b 'c. ('a, 'b, 'c) t -> ('a, 'b) kind
Sourceval get : ('a, 'b, 'c) Bigarray.Array2.t -> int -> int -> 'a
Sourceval set : ('a, 'b, 'c) Bigarray.Array2.t -> int -> int -> 'a -> unit
Sourceval unsafe_get : ('a, 'b, 'c) Bigarray.Array2.t -> int -> int -> 'a
Sourceval unsafe_set : ('a, 'b, 'c) Bigarray.Array2.t -> int -> int -> 'a -> unit
Sourceval nx_ba_blit : ('a, 'b, 'c) t -> ('a, 'b, 'c) t -> unit
Sourceval blit : ('a, 'b, 'c) t -> ('a, 'b, 'c) t -> unit
Sourceval nx_ba_fill : ('a, 'b, 'c) t -> 'a -> unit
Sourceval fill : ('a, 'b, 'c) t -> 'a -> unit
Sourceval init : ('a, 'b) kind -> 't layout -> int -> int -> (int -> int -> 'a) -> ('a, 'b, 't) t
Sourceval of_array : ('a, 'b) kind -> 't layout -> 'a array array -> ('a, 'b, 't) t