1Bigarray.Array3(3) OCaml library Bigarray.Array3(3)
2
3
4
6 Bigarray.Array3 - Three-dimensional arrays.
7
9 Module Bigarray.Array3
10
12 Module Array3
13 : sig end
14
15
16 Three-dimensional arrays. The Array3 structure provides operations sim‐
17 ilar to those of Bigarray.Genarray , but specialized to the case of
18 three-dimensional arrays.
19
20
21
22
23
24 type ('a, 'b, 'c) t
25
26
27 The type of three-dimensional big arrays whose elements have OCaml type
28 'a , representation kind 'b , and memory layout 'c .
29
30
31
32 val create : ('a, 'b) Bigarray.kind -> 'c Bigarray.layout -> int -> int
33 -> int -> ('a, 'b, 'c) t
34
35
36 Array3.create kind layout dim1 dim2 dim3 returns a new bigarray of
37 three dimension, whose size is dim1 in the first dimension, dim2 in the
38 second dimension, and dim3 in the third. kind and layout determine the
39 array element kind and the array layout as described for Bigar‐
40 ray.Genarray.create .
41
42
43
44 val dim1 : ('a, 'b, 'c) t -> int
45
46 Return the first dimension of the given three-dimensional big array.
47
48
49
50 val dim2 : ('a, 'b, 'c) t -> int
51
52 Return the second dimension of the given three-dimensional big array.
53
54
55
56 val dim3 : ('a, 'b, 'c) t -> int
57
58 Return the third dimension of the given three-dimensional big array.
59
60
61
62 val kind : ('a, 'b, 'c) t -> ('a, 'b) Bigarray.kind
63
64 Return the kind of the given big array.
65
66
67
68 val layout : ('a, 'b, 'c) t -> 'c Bigarray.layout
69
70 Return the layout of the given big array.
71
72
73
74 val change_layout : ('a, 'b, 'c) t -> 'd Bigarray.layout -> ('a, 'b,
75 'd) t
76
77
78 Array3.change_layout a layout returns a bigarray with the specified
79 layout , sharing the data with a (and hence having the same dimensions
80 as a ). No copying of elements is involved: the new array and the orig‐
81 inal array share the same storage space. The dimensions are reversed,
82 such that get v [| a; b; c |] in C layout becomes get v [| c+1; b+1;
83 a+1 |] in Fortran layout.
84
85
86 Since 4.06.0
87
88
89
90 val size_in_bytes : ('a, 'b, 'c) t -> int
91
92
93 size_in_bytes a is the number of elements in a multiplied by a 's
94 Bigarray.kind_size_in_bytes .
95
96
97 Since 4.03.0
98
99
100
101 val get : ('a, 'b, 'c) t -> int -> int -> int -> 'a
102
103
104 Array3.get a x y z , also written a.{x,y,z} , returns the element of a
105 at coordinates ( x , y , z ). x , y and z must be within the bounds of
106 a , as described for Bigarray.Genarray.get ; otherwise, Invalid_argu‐
107 ment is raised.
108
109
110
111 val set : ('a, 'b, 'c) t -> int -> int -> int -> 'a -> unit
112
113
114 Array3.set a x y v , or alternatively a.{x,y,z} <- v , stores the value
115 v at coordinates ( x , y , z ) in a . x , y and z must be within the
116 bounds of a , as described for Bigarray.Genarray.set ; otherwise,
117 Invalid_argument is raised.
118
119
120
121 val sub_left : ('a, 'b, Bigarray.c_layout) t -> int -> int -> ('a, 'b,
122 Bigarray.c_layout) t
123
124 Extract a three-dimensional sub-array of the given three-dimensional
125 big array by restricting the first dimension. See Bigarray.Genar‐
126 ray.sub_left for more details. Array3.sub_left applies only to arrays
127 with C layout.
128
129
130
131 val sub_right : ('a, 'b, Bigarray.fortran_layout) t -> int -> int ->
132 ('a, 'b, Bigarray.fortran_layout) t
133
134 Extract a three-dimensional sub-array of the given three-dimensional
135 big array by restricting the second dimension. See Bigarray.Genar‐
136 ray.sub_right for more details. Array3.sub_right applies only to
137 arrays with Fortran layout.
138
139
140
141 val slice_left_1 : ('a, 'b, Bigarray.c_layout) t -> int -> int -> ('a,
142 'b, Bigarray.c_layout) Bigarray.Array1.t
143
144 Extract a one-dimensional slice of the given three-dimensional big
145 array by fixing the first two coordinates. The integer parameters are
146 the coordinates of the slice to extract. See Bigarray.Genar‐
147 ray.slice_left for more details. Array3.slice_left_1 applies only to
148 arrays with C layout.
149
150
151
152 val slice_right_1 : ('a, 'b, Bigarray.fortran_layout) t -> int -> int
153 -> ('a, 'b, Bigarray.fortran_layout) Bigarray.Array1.t
154
155 Extract a one-dimensional slice of the given three-dimensional big
156 array by fixing the last two coordinates. The integer parameters are
157 the coordinates of the slice to extract. See Bigarray.Genar‐
158 ray.slice_right for more details. Array3.slice_right_1 applies only to
159 arrays with Fortran layout.
160
161
162
163 val slice_left_2 : ('a, 'b, Bigarray.c_layout) t -> int -> ('a, 'b,
164 Bigarray.c_layout) Bigarray.Array2.t
165
166 Extract a two-dimensional slice of the given three-dimensional big
167 array by fixing the first coordinate. The integer parameter is the
168 first coordinate of the slice to extract. See Bigarray.Genar‐
169 ray.slice_left for more details. Array3.slice_left_2 applies only to
170 arrays with C layout.
171
172
173
174 val slice_right_2 : ('a, 'b, Bigarray.fortran_layout) t -> int -> ('a,
175 'b, Bigarray.fortran_layout) Bigarray.Array2.t
176
177 Extract a two-dimensional slice of the given three-dimensional big
178 array by fixing the last coordinate. The integer parameter is the
179 coordinate of the slice to extract. See Bigarray.Genarray.slice_right
180 for more details. Array3.slice_right_2 applies only to arrays with
181 Fortran layout.
182
183
184
185 val blit : ('a, 'b, 'c) t -> ('a, 'b, 'c) t -> unit
186
187 Copy the first big array to the second big array. See Bigarray.Genar‐
188 ray.blit for more details.
189
190
191
192 val fill : ('a, 'b, 'c) t -> 'a -> unit
193
194 Fill the given big array with the given value. See Bigarray.Genar‐
195 ray.fill for more details.
196
197
198
199 val of_array : ('a, 'b) Bigarray.kind -> 'c Bigarray.layout -> 'a array
200 array array -> ('a, 'b, 'c) t
201
202 Build a three-dimensional big array initialized from the given array of
203 arrays of arrays.
204
205
206
207 val unsafe_get : ('a, 'b, 'c) t -> int -> int -> int -> 'a
208
209 Like Bigarray.Array3.get , but bounds checking is not always performed.
210
211
212
213 val unsafe_set : ('a, 'b, 'c) t -> int -> int -> int -> 'a -> unit
214
215 Like Bigarray.Array3.set , but bounds checking is not always performed.
216
217
218
219
220
221OCamldoc 2018-07-14 Bigarray.Array3(3)