diff6-10.chapter29.txtこのページは最後に更新されてから1年以上経過しています。情報が古い可能性がありますので、ご注意ください。 last mod. 2008-08-28 (木) 09:59:18
5,7c5,7 < These arrays are called ``big arrays'' to distinguish them from the standard < Caml arrays described in section 20.2. The main differences between ``big < arrays'' and standard Caml arrays are as follows: --- > These arrays are called "big arrays" to distinguish them from the standard Caml > arrays described in section 20.2. The main differences between "big arrays" > and standard Caml arrays are as follows: 18c18 < particular because they support ``small'' types such as single-precision --- > particular because they support "small" types such as single-precision 25c25 < not provide efficiently, such as extracting sub-arrays and ``slicing'' a --- > not provide efficiently, such as extracting sub-arrays and "slicing" a 46c46 < floating-point numbers, thereafter referred to as ``big arrays''. The --- > floating-point numbers, thereafter referred to as "big arrays". The 62a63 > 84,85c85,86 < - platform-native signed integers (32 bits on 32-bit architectures, 64 bits < on 64-bit architectures) (Bigarray.nativeint_elt[29.1]). --- > - platform-native signed integers (32 bits on 32-bit architectures, 64 bits on > 64-bit architectures) (Bigarray.nativeint_elt[29.1]). 89d89 < 94d93 < 99d97 < 104d101 < 109d105 < 114d109 < 119d113 < 124d117 < 129d121 < 134d125 < 139d129 < 144d133 < 149d137 < 154,169c142,152 < To each element kind is associated a Caml type, which is the < type of Caml values that can be stored in the big array or read < back from it. This type is not necessarily the same as the type < of the array elements proper: for instance, a big array whose < elements are of kind float32_elt contains 32-bit single < precision floats, but reading or writing one of its elements < from Caml uses the Caml type float, which is 64-bit double < precision floats. < The abstract type ('a, 'b) kind captures this association of a < Caml type 'a for values read or written in the big array, and < of an element kind 'b which represents the actual contents of < the big array. The following predefined values of type kind < list all possible associations of Caml types with element < kinds: < < --- > To each element kind is associated a Caml type, which is the type of Caml > values that can be stored in the big array or read back from it. This type > is not necessarily the same as the type of the array elements proper: for > instance, a big array whose elements are of kind float32_elt contains 32-bit > single precision floats, but reading or writing one of its elements from > Caml uses the Caml type float, which is 64-bit double precision floats. > The abstract type ('a, 'b) kind captures this association of a Caml type 'a > for values read or written in the big array, and of an element kind 'b which > represents the actual contents of the big array. The following predefined > values of type kind list all possible associations of Caml types with > element kinds: 177,178d159 < < 185,186d165 < < 193,194d171 < < 201,202d177 < < 209,210d183 < < 217,218d189 < < 225,226d195 < < 233,234d201 < < 241,242d207 < < 249,250d213 < < 257,258d219 < < 265,266d225 < < 271,282c230,239 < As shown by the types of the values above, big arrays of kind < float32_elt and float64_elt are accessed using the Caml type < float. Big arrays of complex kinds complex32_elt, complex64_elt < are accessed with the Caml type Complex.t[20.6]. Big arrays of < integer kinds are accessed using the smallest Caml integer type < large enough to represent the array elements: int for 8- and < 16-bit integer bigarrays, as well as Caml-integer bigarrays; < int32 for 32-bit integer bigarrays; int64 for 64-bit integer < bigarrays; and nativeint for platform-native integer bigarrays. < Finally, big arrays of kind int8_unsigned_elt can also be < accessed as arrays of characters instead of arrays of small < integers, by using the kind value char instead of --- > As shown by the types of the values above, big arrays of kind float32_elt > and float64_elt are accessed using the Caml type float. Big arrays of > complex kinds complex32_elt, complex64_elt are accessed with the Caml type > Complex.t[20.6]. Big arrays of integer kinds are accessed using the smallest > Caml integer type large enough to represent the array elements: int for 8- > and 16-bit integer bigarrays, as well as Caml-integer bigarrays; int32 for > 32-bit integer bigarrays; int64 for 64-bit integer bigarrays; and nativeint > for platform-native integer bigarrays. Finally, big arrays of kind > int8_unsigned_elt can also be accessed as arrays of characters instead of > arrays of small integers, by using the kind value char instead of 290d246 < 297,298d252 < < 303,323c257,271 < To facilitate interoperability with existing C and Fortran < code, this library supports two different memory layouts for < big arrays, one compatible with the C conventions, the other < compatible with the Fortran conventions. < In the C-style layout, array indices start at 0, and < multi-dimensional arrays are laid out in row-major format. That < is, for a two-dimensional array, all elements of row 0 are < contiguous in memory, followed by all elements of row 1, etc. < In other terms, the array elements at (x,y) and (x, y+1) are < adjacent in memory. < In the Fortran-style layout, array indices start at 1, and < multi-dimensional arrays are laid out in column-major format. < That is, for a two-dimensional array, all elements of column 0 < are contiguous in memory, followed by all elements of column 1, < etc. In other terms, the array elements at (x,y) and (x+1, y) < are adjacent in memory. < Each layout style is identified at the type level by the < abstract types Bigarray.c_layout[29.1] and fortran_layout < respectively. < < --- > To facilitate interoperability with existing C and Fortran code, this > library supports two different memory layouts for big arrays, one compatible > with the C conventions, the other compatible with the Fortran conventions. > In the C-style layout, array indices start at 0, and multi-dimensional > arrays are laid out in row-major format. That is, for a two-dimensional > array, all elements of row 0 are contiguous in memory, followed by all > elements of row 1, etc. In other terms, the array elements at (x,y) and (x, > y+1) are adjacent in memory. > In the Fortran-style layout, array indices start at 1, and multi-dimensional > arrays are laid out in column-major format. That is, for a two-dimensional > array, all elements of column 0 are contiguous in memory, followed by all > elements of column 1, etc. In other terms, the array elements at (x,y) and > (x+1, y) are adjacent in memory. > Each layout style is identified at the type level by the abstract types > Bigarray.c_layout[29.1] and fortran_layout respectively. 329,331c277,279 < The type 'a layout represents one of the two supported memory < layouts: C-style if 'a is Bigarray.c_layout[29.1], Fortran-style < if 'a is Bigarray.fortran_layout[29.1]. --- > The type 'a layout represents one of the two supported memory layouts: > C-style if 'a is Bigarray.c_layout[29.1], Fortran-style if 'a is > Bigarray.fortran_layout[29.1]. 340d287 < 345d291 < 350a297 > 355,482c302 < module Genarray : sig end < >> < [29.1.1] < < One-dimensional arrays < ====================== < < << < module Array1 : sig end < >> < [29.1.2] < < Two-dimensional arrays < ====================== < < << < module Array2 : sig end < >> < [29.1.3] < < Three-dimensional arrays < ======================== < < << < module Array3 : sig end < >> < [29.1.4] < < Coercions between generic big arrays and fixed-dimension big arrays < =================================================================== < < < << < val genarray_of_array1 : < ('a, 'b, 'c) Array1.t -> ('a, 'b, 'c) Genarray.t < >> < < Return the generic big array corresponding to the given < one-dimensional big array. < < < < << < val genarray_of_array2 : < ('a, 'b, 'c) Array2.t -> ('a, 'b, 'c) Genarray.t < >> < < Return the generic big array corresponding to the given < two-dimensional big array. < < < < << < val genarray_of_array3 : < ('a, 'b, 'c) Array3.t -> ('a, 'b, 'c) Genarray.t < >> < < Return the generic big array corresponding to the given < three-dimensional big array. < < < < << < val array1_of_genarray : < ('a, 'b, 'c) Genarray.t -> ('a, 'b, 'c) Array1.t < >> < < Return the one-dimensional big array corresponding to the given < generic big array. Raise Invalid_arg if the generic big array < does not have exactly one dimension. < < < < << < val array2_of_genarray : < ('a, 'b, 'c) Genarray.t -> ('a, 'b, 'c) Array2.t < >> < < Return the two-dimensional big array corresponding to the given < generic big array. Raise Invalid_arg if the generic big array < does not have exactly two dimensions. < < < < << < val array3_of_genarray : < ('a, 'b, 'c) Genarray.t -> ('a, 'b, 'c) Array3.t < >> < < Return the three-dimensional big array corresponding to the < given generic big array. Raise Invalid_arg if the generic big < array does not have exactly three dimensions. < < < < Re-shaping big arrays < ===================== < < < << < val reshape : < ('a, 'b, 'c) Genarray.t -> < int array -> ('a, 'b, 'c) Genarray.t < >> < < reshape b [|d1;...;dN|] converts the big array b to a < N-dimensional array of dimensions d1...dN. The returned array < and the original array b share their data and have the same < layout. For instance, assuming that b is a one-dimensional < array of dimension 12, reshape b [|3;4|] returns a < two-dimensional array b' of dimensions 3 and 4. If b has C < layout, the element (x,y) of b' corresponds to the element x * < 3 + y of b. If b has Fortran layout, the element (x,y) of b' < corresponds to the element x + (y - 1) * 4 of b. The returned < big array must have exactly the same number of elements as the < original big array b. That is, the product of the dimensions of < b must be equal to i1 * ... * iN. Otherwise, Invalid_arg is < raised. < < < < << < val reshape_1 : < ('a, 'b, 'c) Genarray.t -> int -> ('a, 'b, 'c) Array1.t < >> < < Specialized version of Bigarray.reshape[29.1] for reshaping to < one-dimensional arrays. --- > module Genarray : >> 483a304 > sig 486,520c307 < << < val reshape_2 : < ('a, 'b, 'c) Genarray.t -> < int -> int -> ('a, 'b, 'c) Array2.t < >> < < Specialized version of Bigarray.reshape[29.1] for reshaping to < two-dimensional arrays. < < < < << < val reshape_3 : < ('a, 'b, 'c) Genarray.t -> < int -> int -> int -> ('a, 'b, 'c) Array3.t < >> < < Specialized version of Bigarray.reshape[29.1] for reshaping to < three-dimensional arrays. < < < < < 29.1.1 Module Bigarray.Genarray < ================================ < < << < module Genarray : sig < >> < < < < < < << --- > << 522,541c309 < >> < < The type Genarray.t is the type of big arrays with variable < numbers of dimensions. Any number of dimensions between 1 and 16 < is supported. < The three type parameters to Genarray.t identify the array < element kind and layout, as follows: < < - the first parameter, 'a, is the Caml type for accessing array < elements (float, int, int32, int64, nativeint); < - the second parameter, 'b, is the actual kind of array < elements (float32_elt, float64_elt, int8_signed_elt, < int8_unsigned_elt, etc); < - the third parameter, 'c, identifies the array layout < (c_layout or fortran_layout). < < For instance, (float, float32_elt, fortran_layout) Genarray.t < is the type of generic big arrays containing 32-bit floats in < Fortran layout; reads and writes in this array use the Caml < type float. --- > >> 542a311,325 > The type Genarray.t is the type of big arrays with variable numbers of > dimensions. Any number of dimensions between 1 and 16 is supported. > The three type parameters to Genarray.t identify the array element kind > and layout, as follows: > > - the first parameter, 'a, is the Caml type for accessing array elements > (float, int, int32, int64, nativeint); > - the second parameter, 'b, is the actual kind of array elements > (float32_elt, float64_elt, int8_signed_elt, int8_unsigned_elt, etc); > - the third parameter, 'c, identifies the array layout (c_layout or > fortran_layout). > > For instance, (float, float32_elt, fortran_layout) Genarray.t is the type > of generic big arrays containing 32-bit floats in Fortran layout; reads > and writes in this array use the Caml type float. 544,545c327 < < << --- > << 549c331 < >> --- > >> 551,557c333,338 < Genarray.create kind layout dimensions returns a new big array < whose element kind is determined by the parameter kind (one of < float32, float64, int8_signed, etc) and whose layout is < determined by the parameter layout (one of c_layout or < fortran_layout). The dimensions parameter is an array of < integers that indicate the size of the big array in each < dimension. The length of dimensions determines the number of --- > Genarray.create kind layout dimensions returns a new big array whose > element kind is determined by the parameter kind (one of float32, > float64, int8_signed, etc) and whose layout is determined by the > parameter layout (one of c_layout or fortran_layout). The dimensions > parameter is an array of integers that indicate the size of the big array > in each dimension. The length of dimensions determines the number of 559,567c340,346 < For instance, Genarray.create int32 c_layout [|4;6;8|] returns < a fresh big array of 32-bit integers, in C layout, having three < dimensions, the three dimensions being 4, 6 and 8 respectively. < Big arrays returned by Genarray.create are not initialized: the < initial values of array elements is unspecified. < Genarray.create raises Invalid_arg if the number of dimensions < is not in the range 1 to 16 inclusive, or if one of the < dimensions is negative. < --- > For instance, Genarray.create int32 c_layout [|4;6;8|] returns a fresh > big array of 32-bit integers, in C layout, having three dimensions, the > three dimensions being 4, 6 and 8 respectively. > Big arrays returned by Genarray.create are not initialized: the initial > values of array elements is unspecified. > Genarray.create raises Invalid_arg if the number of dimensions is not in > the range 1 to 16 inclusive, or if one of the dimensions is negative. 569,570c348 < < << --- > << 572c350 < >> --- > >> 576,578c354 < < < << --- > << 580,583c356 < >> < < Genarray.dims a returns all dimensions of the big array a, as < an array of integers of length Genarray.num_dims a. --- > >> 584a358,359 > Genarray.dims a returns all dimensions of the big array a, as an array > of integers of length Genarray.num_dims a. 586,587c361 < < << --- > << 589,595c363 < >> < < Genarray.nth_dim a n returns the n-th dimension of the big < array a. The first dimension corresponds to n = 0; the second < dimension corresponds to n = 1; the last dimension, to n = < Genarray.num_dims a - 1. Raise Invalid_arg if n is less than 0 < or greater or equal than Genarray.num_dims a. --- > >> 596a365,369 > Genarray.nth_dim a n returns the n-th dimension of the big array a. The > first dimension corresponds to n = 0; the second dimension corresponds to > n = 1; the last dimension, to n = Genarray.num_dims a - 1. Raise > Invalid_arg if n is less than 0 or greater or equal than > Genarray.num_dims a. 598,599c371 < < << --- > << 601c373 < >> --- > >> 605,607c377 < < < << --- > << 609c379 < >> --- > >> 613,615c383 < < < << --- > << 617,634c385 < >> < < Read an element of a generic big array. Genarray.get a [|i1; < ...; iN|] returns the element of a whose coordinates are i1 in < the first dimension, i2 in the second dimension, ..., iN in the < N-th dimension. < If a has C layout, the coordinates must be greater or equal than < 0 and strictly less than the corresponding dimensions of a. If < a has Fortran layout, the coordinates must be greater or equal < than 1 and less or equal than the corresponding dimensions of a. < Raise Invalid_arg if the array a does not have exactly N < dimensions, or if the coordinates are outside the array bounds. < If N > 3, alternate syntax is provided: you can write a.{i1, < i2, ..., iN} instead of Genarray.get a [|i1; ...; iN|]. (The < syntax a.{...} with one, two or three coordinates is reserved < for accessing one-, two- and three-dimensional arrays as < described below.) < --- > >> 635a387,399 > Read an element of a generic big array. Genarray.get a [|i1; ...; iN|] > returns the element of a whose coordinates are i1 in the first dimension, > i2 in the second dimension, ..., iN in the N-th dimension. > If a has C layout, the coordinates must be greater or equal than 0 and > strictly less than the corresponding dimensions of a. If a has Fortran > layout, the coordinates must be greater or equal than 1 and less or equal > than the corresponding dimensions of a. Raise Invalid_arg if the array a > does not have exactly N dimensions, or if the coordinates are outside the > array bounds. > If N > 3, alternate syntax is provided: you can write a.{i1, i2, ..., iN} > instead of Genarray.get a [|i1; ...; iN|]. (The syntax a.{...} with one, > two or three coordinates is reserved for accessing one-, two- and > three-dimensional arrays as described below.) 637c401 < << --- > << 639,653c403 < >> < < Assign an element of a generic big array. Genarray.set a [|i1; < ...; iN|] v stores the value v in the element of a whose < coordinates are i1 in the first dimension, i2 in the second < dimension, ..., iN in the N-th dimension. < The array a must have exactly N dimensions, and all coordinates < must lie inside the array bounds, as described for Genarray.get; < otherwise, Invalid_arg is raised. < If N > 3, alternate syntax is provided: you can write a.{i1, < i2, ..., iN} <- v instead of Genarray.set a [|i1; ...; iN|] v. < (The syntax a.{...} <- v with one, two or three coordinates is < reserved for updating one-, two- and three-dimensional arrays < as described below.) < --- > >> 654a405,415 > Assign an element of a generic big array. Genarray.set a [|i1; ...; iN|] > v stores the value v in the element of a whose coordinates are i1 in the > first dimension, i2 in the second dimension, ..., iN in the N-th > dimension. > The array a must have exactly N dimensions, and all coordinates must lie > inside the array bounds, as described for Genarray.get; otherwise, > Invalid_arg is raised. > If N > 3, alternate syntax is provided: you can write a.{i1, i2, ..., iN} > <- v instead of Genarray.set a [|i1; ...; iN|] v. (The syntax a.{...} <- > v with one, two or three coordinates is reserved for updating one-, two- > and three-dimensional arrays as described below.) 656c417 < << --- > << 660c421 < >> --- > >> 662,671c423,431 < Extract a sub-array of the given big array by restricting the < first (left-most) dimension. Genarray.sub_left a ofs len < returns a big array with the same number of dimensions as a, < and the same dimensions as a, except the first dimension, which < corresponds to the interval [ofs ... ofs + len - 1] of the < first dimension of a. No copying of elements is involved: the < sub-array and the original array share the same storage space. < In other terms, the element at coordinates [|i1; ...; iN|] of < the sub-array is identical to the element at coordinates < [|i1+ofs; ...; iN|] of the original array a. --- > Extract a sub-array of the given big array by restricting the first > (left-most) dimension. Genarray.sub_left a ofs len returns a big array > with the same number of dimensions as a, and the same dimensions as a, > except the first dimension, which corresponds to the interval [ofs ... > ofs + len - 1] of the first dimension of a. No copying of elements is > involved: the sub-array and the original array share the same storage > space. In other terms, the element at coordinates [|i1; ...; iN|] of the > sub-array is identical to the element at coordinates [|i1+ofs; ...; iN|] > of the original array a. 673,676c433,434 < Invalid_arg if ofs and len do not designate a valid sub-array < of a, that is, if ofs < 0, or len < 0, or ofs + len > < Genarray.nth_dim a 0. < --- > Invalid_arg if ofs and len do not designate a valid sub-array of a, that > is, if ofs < 0, or len < 0, or ofs + len > Genarray.nth_dim a 0. 678,679c436 < < << --- > << 683,698c440 < >> < < Extract a sub-array of the given big array by restricting the < last (right-most) dimension. Genarray.sub_right a ofs len < returns a big array with the same number of dimensions as a, < and the same dimensions as a, except the last dimension, which < corresponds to the interval [ofs ... ofs + len - 1] of the last < dimension of a. No copying of elements is involved: the < sub-array and the original array share the same storage space. < In other terms, the element at coordinates [|i1; ...; iN|] of < the sub-array is identical to the element at coordinates [|i1; < ...; iN+ofs|] of the original array a. < Genarray.sub_right applies only to big arrays in Fortran layout. < Raise Invalid_arg if ofs and len do not designate a valid < sub-array of a, that is, if ofs < 1, or len < 0, or ofs + len > < Genarray.nth_dim a (Genarray.num_dims a - 1). --- > >> 699a442,454 > Extract a sub-array of the given big array by restricting the last > (right-most) dimension. Genarray.sub_right a ofs len returns a big array > with the same number of dimensions as a, and the same dimensions as a, > except the last dimension, which corresponds to the interval [ofs ... ofs > + len - 1] of the last dimension of a. No copying of elements is > involved: the sub-array and the original array share the same storage > space. In other terms, the element at coordinates [|i1; ...; iN|] of the > sub-array is identical to the element at coordinates [|i1; ...; iN+ofs|] > of the original array a. > Genarray.sub_right applies only to big arrays in Fortran layout. Raise > Invalid_arg if ofs and len do not designate a valid sub-array of a, that > is, if ofs < 1, or len < 0, or ofs + len > Genarray.nth_dim a > (Genarray.num_dims a - 1). 701,702c456 < < << --- > << 706c460 < >> --- > >> 708,716c462,469 < Extract a sub-array of lower dimension from the given big array < by fixing one or several of the first (left-most) coordinates. < Genarray.slice_left a [|i1; ... ; iM|] returns the ``slice'' of < a obtained by setting the first M coordinates to i1, ..., iM. < If a has N dimensions, the slice has dimension N - M, and the < element at coordinates [|j1; ...; j(N-M)|] in the slice is < identical to the element at coordinates [|i1; ...; iM; j1; ...; < j(N-M)|] in the original array a. No copying of elements is < involved: the slice and the original array share the same --- > Extract a sub-array of lower dimension from the given big array by > fixing one or several of the first (left-most) coordinates. > Genarray.slice_left a [|i1; ... ; iM|] returns the "slice" of a obtained > by setting the first M coordinates to i1, ..., iM. If a has N dimensions, > the slice has dimension N - M, and the element at coordinates [|j1; ...; > j(N-M)|] in the slice is identical to the element at coordinates [|i1; > ...; iM; j1; ...; j(N-M)|] in the original array a. No copying of > elements is involved: the slice and the original array share the same 718,721c471,472 < Genarray.slice_left applies only to big arrays in C layout. < Raise Invalid_arg if M >= N, or if [|i1; ... ; iM|] is outside < the bounds of a. < --- > Genarray.slice_left applies only to big arrays in C layout. Raise > Invalid_arg if M >= N, or if [|i1; ... ; iM|] is outside the bounds of a. 723,724c474 < < << --- > << 728c478 < >> --- > >> 730,738c480,487 < Extract a sub-array of lower dimension from the given big array < by fixing one or several of the last (right-most) coordinates. < Genarray.slice_right a [|i1; ... ; iM|] returns the ``slice'' < of a obtained by setting the last M coordinates to i1, ..., iM. < If a has N dimensions, the slice has dimension N - M, and the < element at coordinates [|j1; ...; j(N-M)|] in the slice is < identical to the element at coordinates [|j1; ...; j(N-M); i1; < ...; iM|] in the original array a. No copying of elements is < involved: the slice and the original array share the same --- > Extract a sub-array of lower dimension from the given big array by > fixing one or several of the last (right-most) coordinates. > Genarray.slice_right a [|i1; ... ; iM|] returns the "slice" of a obtained > by setting the last M coordinates to i1, ..., iM. If a has N dimensions, > the slice has dimension N - M, and the element at coordinates [|j1; ...; > j(N-M)|] in the slice is identical to the element at coordinates [|j1; > ...; j(N-M); i1; ...; iM|] in the original array a. No copying of > elements is involved: the slice and the original array share the same 740,750c489,490 < Genarray.slice_right applies only to big arrays in Fortran < layout. Raise Invalid_arg if M >= N, or if [|i1; ... ; iM|] is < outside the bounds of a. < < < < << < val blit : < ('a, 'b, 'c) t -> < ('a, 'b, 'c) t -> unit < >> --- > Genarray.slice_right applies only to big arrays in Fortran layout. Raise > Invalid_arg if M >= N, or if [|i1; ... ; iM|] is outside the bounds of a. 752,757c492,500 < Copy all elements of a big array in another big array. < Genarray.blit src dst copies all elements of src into dst. Both < arrays src and dst must have the same number of dimensions and < equal dimensions. Copying a sub-array of src to a sub-array of < dst can be achieved by applying Genarray.blit to sub-array or < slices of src and dst. --- > << > val blit : ('a, 'b, 'c) t -> ('a, 'b, 'c) t -> unit > >> > > Copy all elements of a big array in another big array. Genarray.blit src > dst copies all elements of src into dst. Both arrays src and dst must > have the same number of dimensions and equal dimensions. Copying a > sub-array of src to a sub-array of dst can be achieved by applying > Genarray.blit to sub-array or slices of src and dst. 759,761c502 < < < << --- > << 763c504 < >> --- > >> 765,768c506,509 < Set all elements of a big array to a given value. < Genarray.fill a v stores the value v in all elements of the big < array a. Setting only some elements of a to v can be achieved < by applying Genarray.fill to a sub-array or a slice of a. --- > Set all elements of a big array to a given value. Genarray.fill a v > stores the value v in all elements of the big array a. Setting only some > elements of a to v can be achieved by applying Genarray.fill to a > sub-array or a slice of a. 770,772c511 < < < << --- > << 774a514 > ?pos:int64 -> 777c517 < >> --- > >> 779,799c519,538 < Memory mapping of a file as a big array. Genarray.map_file fd < kind layout shared dims returns a big array of kind kind, < layout layout, and dimensions as specified in dims. The data < contained in this big array are the contents of the file < referred to by the file descriptor fd (as opened previously < with Unix.openfile, for example). If shared is true, all < modifications performed on the array are reflected in the file. < This requires that fd be opened with write permissions. If < shared is false, modifications performed on the array are done < in memory only, using copy-on-write of the modified pages; the < underlying file is not affected. < Genarray.map_file is much more efficient than reading the whole < file in a big array, modifying that big array, and writing it < afterwards. < To adjust automatically the dimensions of the big array to the < actual size of the file, the major dimension (that is, the < first dimension for an array with C layout, and the last < dimension for an array with Fortran layout) can be given as -1. < Genarray.map_file then determines the major dimension from the < size of the file. The file must contain an integral number of < sub-arrays as determined by the non-major dimensions, otherwise --- > Memory mapping of a file as a big array. Genarray.map_file fd kind > layout shared dims returns a big array of kind kind, layout layout, and > dimensions as specified in dims. The data contained in this big array are > the contents of the file referred to by the file descriptor fd (as opened > previously with Unix.openfile, for example). The optional pos parameter > is the byte offset in the file of the data being mapped; it default to 0 > (map from the beginning of the file). > If shared is true, all modifications performed on the array are reflected > in the file. This requires that fd be opened with write permissions. If > shared is false, modifications performed on the array are done in memory > only, using copy-on-write of the modified pages; the underlying file is > not affected. > Genarray.map_file is much more efficient than reading the whole file in a > big array, modifying that big array, and writing it afterwards. > To adjust automatically the dimensions of the big array to the actual > size of the file, the major dimension (that is, the first dimension for > an array with C layout, and the last dimension for an array with Fortran > layout) can be given as -1. Genarray.map_file then determines the major > dimension from the size of the file. The file must contain an integral > number of sub-arrays as determined by the non-major dimensions, otherwise 801,806c540,545 < If all dimensions of the big array are given, the file size is < matched against the size of the big array. If the file is larger < than the big array, only the initial portion of the file is < mapped to the big array. If the file is smaller than the big < array, the file is automatically grown to the size of the big < array. This requires write permissions on fd. --- > If all dimensions of the big array are given, the file size is matched > against the size of the big array. If the file is larger than the big > array, only the initial portion of the file is mapped to the big array. > If the file is smaller than the big array, the file is automatically > grown to the size of the big array. This requires write permissions on > fd. 808,809d546 < < << 811d547 < >> 814,815d549 < 29.1.2 Module Bigarray.Array1 : One-dimensional arrays. < ======================================================== 817,819c551,552 < << < module Array1 : sig < >> --- > One-dimensional arrays > ====================== 821,826c554,555 < The Array1 structure provides operations similar to those of < Bigarray.Genarray[29.1.1], but specialized to the case of one-dimensional < arrays. (The Array2 and Array3 structures below provide operations < specialized for two- and three-dimensional arrays.) Statically knowing the < number of dimensions of the array allows faster operations, and more precise < static type-checking. --- > << > module Array1 : >> 827a557 > sig 830c560 < << --- > << 832,836c562 < >> < < The type of one-dimensional big arrays whose elements have < Caml type 'a, representation kind 'b, and memory layout 'c. < --- > >> 837a564,565 > The type of one-dimensional big arrays whose elements have Caml type 'a, > representation kind 'b, and memory layout 'c. 839c567 < << --- > << 843,849c571 < >> < < Array1.create kind layout dim returns a new bigarray of one < dimension, whose size is dim. kind and layout determine the < array element kind and the array layout as described for < Genarray.create. < --- > >> 850a573,575 > Array1.create kind layout dim returns a new bigarray of one dimension, > whose size is dim. kind and layout determine the array element kind and > the array layout as described for Genarray.create. 852c577 < << --- > << 854,857c579 < >> < < Return the size (dimension) of the given one-dimensional big < array. --- > >> 858a581 > Return the size (dimension) of the given one-dimensional big array. 860,861c583 < < << --- > << 863c585 < >> --- > >> 867,869c589 < < < << --- > << 871c591 < >> --- > >> 875,877c595 < < < << --- > << 879,886c597 < >> < < Array1.get a x, or alternatively a.{x}, returns the element < of a at index x. x must be greater or equal than 0 and strictly < less than Array1.dim a if a has C layout. If a has Fortran < layout, x must be greater or equal than 1 and less or equal < than Array1.dim a. Otherwise, Invalid_arg is raised. < --- > >> 887a599,603 > Array1.get a x, or alternatively a.{x}, returns the element of a at > index x. x must be greater or equal than 0 and strictly less than > Array1.dim a if a has C layout. If a has Fortran layout, x must be > greater or equal than 1 and less or equal than Array1.dim a. Otherwise, > Invalid_arg is raised. 889c605 < << --- > << 891,897c607 < >> < < Array1.set a x v, also written a.{x} <- v, stores the value v < at index x in a. x must be inside the bounds of a as described < in Bigarray.Array1.get[29.1.2]; otherwise, Invalid_arg is < raised. < --- > >> 898a609,611 > Array1.set a x v, also written a.{x} <- v, stores the value v at index x > in a. x must be inside the bounds of a as described in > Bigarray.Array1.get[29.1]; otherwise, Invalid_arg is raised. 900,902c613,614 < << < val sub : < ('a, 'b, 'c) t -> --- > << > val sub : ('a, 'b, 'c) t -> 904,914c616 < >> < < Extract a sub-array of the given one-dimensional big array. < See Genarray.sub_left for more details. < < < < << < val blit : < ('a, 'b, 'c) t -> ('a, 'b, 'c) t -> unit < >> --- > >> 916,917c618,619 < Copy the first big array to the second big array. See < Genarray.blit for more details. --- > Extract a sub-array of the given one-dimensional big array. See > Genarray.sub_left for more details. 918a621,623 > << > val blit : ('a, 'b, 'c) t -> ('a, 'b, 'c) t -> unit > >> 919a625,626 > Copy the first big array to the second big array. See Genarray.blit for > more details. 921c628 < << --- > << 923,927c630 < >> < < Fill the given big array with the given value. See < Genarray.fill for more details. < --- > >> 928a632,633 > Fill the given big array with the given value. See Genarray.fill for > more details. 930c635 < << --- > << 934,937c639 < >> < < Build a one-dimensional big array initialized from the given < array. --- > >> 938a641 > Build a one-dimensional big array initialized from the given array. 940,941c643 < < << --- > << 943a646 > ?pos:int64 -> 946c649 < >> --- > >> 949,950c652 < Bigarray.Genarray.map_file[29.1.1] for more details. < --- > Bigarray.Genarray.map_file[29.1] for more details. 952d653 < << 954d654 < >> 955a656,661 > One-dimensional arrays. The Array1 structure provides operations similar to > those of Bigarray.Genarray[29.1], but specialized to the case of > one-dimensional arrays. (The Array2 and Array3 structures below provide > operations specialized for two- and three-dimensional arrays.) Statically > knowing the number of dimensions of the array allows faster operations, and > more precise static type-checking. 957,966d662 < 29.1.3 Module Bigarray.Array2 : Two-dimensional arrays. < ======================================================== < < << < module Array2 : sig < >> < < The Array2 structure provides operations similar to those of < Bigarray.Genarray[29.1.1], but specialized to the case of two-dimensional < arrays. 968a665,666 > Two-dimensional arrays > ====================== 971,972c669 < type ('a, 'b, 'c) t < >> --- > module Array2 : >> 974,975c671 < The type of two-dimensional big arrays whose elements have < Caml type 'a, representation kind 'b, and memory layout 'c. --- > sig 977a674,676 > << > type ('a, 'b, 'c) t > >> 979c678,681 < << --- > The type of two-dimensional big arrays whose elements have Caml type 'a, > representation kind 'b, and memory layout 'c. > > << 983c685 < >> --- > >> 985,989c687,690 < Array2.create kind layout dim1 dim2 returns a new bigarray of < two dimension, whose size is dim1 in the first dimension and < dim2 in the second dimension. kind and layout determine the < array element kind and the array layout as described for < Bigarray.Genarray.create[29.1.1]. --- > Array2.create kind layout dim1 dim2 returns a new bigarray of two > dimension, whose size is dim1 in the first dimension and dim2 in the > second dimension. kind and layout determine the array element kind and > the array layout as described for Bigarray.Genarray.create[29.1]. 991,993c692 < < < << --- > << 995,998c694 < >> < < Return the first dimension of the given two-dimensional big < array. --- > >> 999a696 > Return the first dimension of the given two-dimensional big array. 1001,1002c698 < < << --- > << 1004,1008c700 < >> < < Return the second dimension of the given two-dimensional big < array. < --- > >> 1009a702 > Return the second dimension of the given two-dimensional big array. 1011c704 < << --- > << 1013c706 < >> --- > >> 1017,1019c710 < < < << --- > << 1021c712 < >> --- > >> 1025,1027c716 < < < << --- > << 1029,1035c718 < >> < < Array2.get a x y, also written a.{x,y}, returns the element of < a at coordinates (x, y). x and y must be within the bounds of < a, as described for Bigarray.Genarray.get[29.1.1]; otherwise, < Invalid_arg is raised. < --- > >> 1036a720,722 > Array2.get a x y, also written a.{x,y}, returns the element of a at > coordinates (x, y). x and y must be within the bounds of a, as described > for Bigarray.Genarray.get[29.1]; otherwise, Invalid_arg is raised. 1038c724 < << --- > << 1040,1046c726 < >> < < Array2.set a x y v, or alternatively a.{x,y} <- v, stores the < value v at coordinates (x, y) in a. x and y must be within the < bounds of a, as described for Bigarray.Genarray.set[29.1.1]; < otherwise, Invalid_arg is raised. < --- > >> 1047a728,731 > Array2.set a x y v, or alternatively a.{x,y} <- v, stores the value v at > coordinates (x, y) in a. x and y must be within the bounds of a, as > described for Bigarray.Genarray.set[29.1]; otherwise, Invalid_arg is > raised. 1049c733 < << --- > << 1053,1058c737 < >> < < Extract a two-dimensional sub-array of the given < two-dimensional big array by restricting the first dimension. < See Bigarray.Genarray.sub_left[29.1.1] for more details. < Array2.sub_left applies only to arrays with C layout. --- > >> 1059a739,742 > Extract a two-dimensional sub-array of the given two-dimensional big > array by restricting the first dimension. See > Bigarray.Genarray.sub_left[29.1] for more details. Array2.sub_left > applies only to arrays with C layout. 1061,1062c744 < < << --- > << 1066,1071c748 < >> < < Extract a two-dimensional sub-array of the given < two-dimensional big array by restricting the second dimension. < See Bigarray.Genarray.sub_right[29.1.1] for more details. < Array2.sub_right applies only to arrays with Fortran layout. --- > >> 1072a750,753 > Extract a two-dimensional sub-array of the given two-dimensional big > array by restricting the second dimension. See > Bigarray.Genarray.sub_right[29.1] for more details. Array2.sub_right > applies only to arrays with Fortran layout. 1074,1075c755 < < << --- > << 1079,1085c759 < >> < < Extract a row (one-dimensional slice) of the given < two-dimensional big array. The integer parameter is the index < of the row to extract. See Bigarray.Genarray.slice_left[29.1.1] < for more details. Array2.slice_left applies only to arrays with < C layout. --- > >> 1086a761,764 > Extract a row (one-dimensional slice) of the given two-dimensional big > array. The integer parameter is the index of the row to extract. See > Bigarray.Genarray.slice_left[29.1] for more details. Array2.slice_left > applies only to arrays with C layout. 1088,1089c766 < < << --- > << 1093c770 < >> --- > >> 1095,1098c772,774 < Extract a column (one-dimensional slice) of the given < two-dimensional big array. The integer parameter is the index < of the column to extract. See < Bigarray.Genarray.slice_right[29.1.1] for more details. --- > Extract a column (one-dimensional slice) of the given two-dimensional > big array. The integer parameter is the index of the column to extract. > See Bigarray.Genarray.slice_right[29.1] for more details. 1101,1106c777,779 < < < << < val blit : < ('a, 'b, 'c) t -> ('a, 'b, 'c) t -> unit < >> --- > << > val blit : ('a, 'b, 'c) t -> ('a, 'b, 'c) t -> unit > >> 1109,1110c782 < Bigarray.Genarray.blit[29.1.1] for more details. < --- > Bigarray.Genarray.blit[29.1] for more details. 1112,1113c784 < < << --- > << 1115c786 < >> --- > >> 1118,1119c789 < Bigarray.Genarray.fill[29.1.1] for more details. < --- > Bigarray.Genarray.fill[29.1] for more details. 1121,1122c791 < < << --- > << 1126,1129c795 < >> < < Build a two-dimensional big array initialized from the given < array of arrays. --- > >> 1130a797,798 > Build a two-dimensional big array initialized from the given array of > arrays. 1132,1133c800 < < << --- > << 1135a803 > ?pos:int64 -> 1138c806 < >> --- > >> 1141,1142c809 < Bigarray.Genarray.map_file[29.1.1] for more details. < --- > Bigarray.Genarray.map_file[29.1] for more details. 1144d810 < << 1146d811 < >> 1147a813,815 > Two-dimensional arrays. The Array2 structure provides operations similar to > those of Bigarray.Genarray[29.1], but specialized to the case of > two-dimensional arrays. 1149,1158d816 < 29.1.4 Module Bigarray.Array3 : Three-dimensional arrays. < ========================================================== < < << < module Array3 : sig < >> < < The Array3 structure provides operations similar to those of < Bigarray.Genarray[29.1.1], but specialized to the case of three-dimensional < arrays. 1160a819,820 > Three-dimensional arrays > ======================== 1163,1164c823,825 < type ('a, 'b, 'c) t < >> --- > module Array3 : >> > > sig 1166,1167d826 < The type of three-dimensional big arrays whose elements have < Caml type 'a, representation kind 'b, and memory layout 'c. 1168a828,830 > << > type ('a, 'b, 'c) t > >> 1169a832,833 > The type of three-dimensional big arrays whose elements have Caml type > 'a, representation kind 'b, and memory layout 'c. 1171c835 < << --- > << 1175,1181c839 < >> < < Array3.create kind layout dim1 dim2 dim3 returns a new bigarray < of three dimension, 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[29.1.1]. --- > >> 1182a841,845 > Array3.create kind layout dim1 dim2 dim3 returns a new bigarray of three > dimension, 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[29.1]. 1184,1185c847 < < << --- > << 1187,1190c849 < >> < < Return the first dimension of the given three-dimensional big < array. --- > >> 1191a851 > Return the first dimension of the given three-dimensional big array. 1193,1194c853 < < << --- > << 1196,1200c855 < >> < < Return the second dimension of the given three-dimensional big < array. < --- > >> 1201a857 > Return the second dimension of the given three-dimensional big array. 1203c859 < << --- > << 1205,1208c861 < >> < < Return the third dimension of the given three-dimensional big < array. --- > >> 1209a863 > Return the third dimension of the given three-dimensional big array. 1211,1212c865 < < << --- > << 1214c867 < >> --- > >> 1218,1220c871 < < < << --- > << 1222c873 < >> --- > >> 1226,1228c877 < < < << --- > << 1230c879 < >> --- > >> 1232,1235c881,883 < Array3.get a x y z, 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[29.1.1]; otherwise, Invalid_arg is --- > Array3.get a x y z, 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[29.1]; otherwise, Invalid_arg is 1238,1240c886 < < < << --- > << 1242c888 < >> --- > >> 1244,1247c890,892 < Array3.set a x y v, 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[29.1.1]; otherwise, Invalid_arg is --- > Array3.set a x y v, 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[29.1]; otherwise, Invalid_arg is 1250,1252c895 < < < << --- > << 1256,1261c899 < >> < < Extract a three-dimensional sub-array of the given < three-dimensional big array by restricting the first dimension. < See Bigarray.Genarray.sub_left[29.1.1] for more details. < Array3.sub_left applies only to arrays with C layout. --- > >> 1262a901,904 > Extract a three-dimensional sub-array of the given three-dimensional big > array by restricting the first dimension. See > Bigarray.Genarray.sub_left[29.1] for more details. Array3.sub_left > applies only to arrays with C layout. 1264,1265c906 < < << --- > << 1269,1274c910 < >> < < Extract a three-dimensional sub-array of the given < three-dimensional big array by restricting the second dimension. < See Bigarray.Genarray.sub_right[29.1.1] for more details. < Array3.sub_right applies only to arrays with Fortran layout. --- > >> 1275a912,915 > Extract a three-dimensional sub-array of the given three-dimensional big > array by restricting the second dimension. See > Bigarray.Genarray.sub_right[29.1] for more details. Array3.sub_right > applies only to arrays with Fortran layout. 1277,1278c917 < < << --- > << 1282,1288c921 < >> < < Extract a one-dimensional slice of the given three-dimensional < big array by fixing the first two coordinates. The integer < parameters are the coordinates of the slice to extract. See < Bigarray.Genarray.slice_left[29.1.1] for more details. < Array3.slice_left_1 applies only to arrays with C layout. --- > >> 1289a923,927 > Extract a one-dimensional slice of the given three-dimensional big array > by fixing the first two coordinates. The integer parameters are the > coordinates of the slice to extract. See > Bigarray.Genarray.slice_left[29.1] for more details. Array3.slice_left_1 > applies only to arrays with C layout. 1291,1292c929 < < << --- > << 1296,1303c933 < >> < < Extract a one-dimensional slice of the given three-dimensional < big array by fixing the last two coordinates. The integer < parameters are the coordinates of the slice to extract. See < Bigarray.Genarray.slice_right[29.1.1] for more details. < Array3.slice_right_1 applies only to arrays with Fortran < layout. --- > >> 1304a935,939 > Extract a one-dimensional slice of the given three-dimensional big array > by fixing the last two coordinates. The integer parameters are the > coordinates of the slice to extract. See > Bigarray.Genarray.slice_right[29.1] for more details. > Array3.slice_right_1 applies only to arrays with Fortran layout. 1306,1307c941 < < << --- > << 1311,1317c945 < >> < < Extract a two-dimensional slice of the given three-dimensional < big array by fixing the first coordinate. The integer parameter < is the first coordinate of the slice to extract. See < Bigarray.Genarray.slice_left[29.1.1] for more details. < Array3.slice_left_2 applies only to arrays with C layout. --- > >> 1318a947,951 > Extract a two-dimensional slice of the given three-dimensional big array > by fixing the first coordinate. The integer parameter is the first > coordinate of the slice to extract. See > Bigarray.Genarray.slice_left[29.1] for more details. Array3.slice_left_2 > applies only to arrays with C layout. 1320,1321c953 < < << --- > << 1325c957,1003 < >> --- > >> > > Extract a two-dimensional slice of the given three-dimensional big array > by fixing the last coordinate. The integer parameter is the coordinate of > the slice to extract. See Bigarray.Genarray.slice_right[29.1] for more > details. Array3.slice_right_2 applies only to arrays with Fortran layout. > > << > val blit : ('a, 'b, 'c) t -> ('a, 'b, 'c) t -> unit > >> > > Copy the first big array to the second big array. See > Bigarray.Genarray.blit[29.1] for more details. > > << > val fill : ('a, 'b, 'c) t -> 'a -> unit > >> > > Fill the given big array with the given value. See > Bigarray.Genarray.fill[29.1] for more details. > > << > val of_array : > ('a, 'b) Bigarray.kind -> > 'c Bigarray.layout -> 'a array array array -> ('a, 'b, 'c) t > >> > > Build a three-dimensional big array initialized from the given array of > arrays of arrays. > > << > val map_file : > Unix.file_descr -> > ?pos:int64 -> > ('a, 'b) Bigarray.kind -> > 'c Bigarray.layout -> > bool -> int -> int -> int -> ('a, 'b, 'c) t > >> > > Memory mapping of a file as a three-dimensional big array. See > Bigarray.Genarray.map_file[29.1] for more details. > > end > > Three-dimensional arrays. The Array3 structure provides operations similar > to those of Bigarray.Genarray[29.1], but specialized to the case of > three-dimensional arrays. 1327,1332d1004 < Extract a two-dimensional slice of the given three-dimensional < big array by fixing the last coordinate. The integer parameter < is the coordinate of the slice to extract. See < Bigarray.Genarray.slice_right[29.1.1] for more details. < Array3.slice_right_2 applies only to arrays with Fortran < layout. 1334a1007,1008 > Coercions between generic big arrays and fixed-dimension big arrays > =================================================================== 1337,1338c1011 < val blit : < ('a, 'b, 'c) t -> ('a, 'b, 'c) t -> unit --- > val genarray_of_array1 : ('a, 'b, 'c) Array1.t -> ('a, 'b, 'c) Genarray.t 1341,1342c1014,1019 < Copy the first big array to the second big array. See < Bigarray.Genarray.blit[29.1.1] for more details. --- > Return the generic big array corresponding to the given one-dimensional big > array. > > << > val genarray_of_array2 : ('a, 'b, 'c) Array2.t -> ('a, 'b, 'c) Genarray.t > >> 1343a1021,1026 > Return the generic big array corresponding to the given two-dimensional big > array. > > << > val genarray_of_array3 : ('a, 'b, 'c) Array3.t -> ('a, 'b, 'c) Genarray.t > >> 1344a1028,1029 > Return the generic big array corresponding to the given three-dimensional > big array. 1347c1032 < val fill : ('a, 'b, 'c) t -> 'a -> unit --- > val array1_of_genarray : ('a, 'b, 'c) Genarray.t -> ('a, 'b, 'c) Array1.t 1350,1351c1035,1037 < Fill the given big array with the given value. See < Bigarray.Genarray.fill[29.1.1] for more details. --- > Return the one-dimensional big array corresponding to the given generic big > array. Raise Invalid_arg if the generic big array does not have exactly one > dimension. 1352a1039,1041 > << > val array2_of_genarray : ('a, 'b, 'c) Genarray.t -> ('a, 'b, 'c) Array2.t > >> 1353a1043,1045 > Return the two-dimensional big array corresponding to the given generic big > array. Raise Invalid_arg if the generic big array does not have exactly two > dimensions. 1356,1359c1048 < val of_array : < ('a, 'b) Bigarray.kind -> < 'c Bigarray.layout -> < 'a array array array -> ('a, 'b, 'c) t --- > val array3_of_genarray : ('a, 'b, 'c) Genarray.t -> ('a, 'b, 'c) Array3.t 1362,1363c1051,1054 < Build a three-dimensional big array initialized from the given < array of arrays of arrays. --- > Return the three-dimensional big array corresponding to the given generic > big array. Raise Invalid_arg if the generic big array does not have exactly > three dimensions. > 1365a1057,1058 > Re-shaping big arrays > ===================== 1368,1372c1061,1063 < val map_file : < Unix.file_descr -> < ('a, 'b) Bigarray.kind -> < 'c Bigarray.layout -> < bool -> int -> int -> int -> ('a, 'b, 'c) t --- > val reshape : > ('a, 'b, 'c) Genarray.t -> > int array -> ('a, 'b, 'c) Genarray.t 1375,1376c1066,1079 < Memory mapping of a file as a three-dimensional big array. See < Bigarray.Genarray.map_file[29.1.1] for more details. --- > reshape b [|d1;...;dN|] converts the big array b to a N-dimensional array > of dimensions d1...dN. The returned array and the original array b share > their data and have the same layout. For instance, assuming that b is a > one-dimensional array of dimension 12, reshape b [|3;4|] returns a > two-dimensional array b' of dimensions 3 and 4. If b has C layout, the > element (x,y) of b' corresponds to the element x * 3 + y of b. If b has > Fortran layout, the element (x,y) of b' corresponds to the element x + (y - > 1) * 4 of b. The returned big array must have exactly the same number of > elements as the original big array b. That is, the product of the dimensions > of b must be equal to i1 * ... * iN. Otherwise, Invalid_arg is raised. > > << > val reshape_1 : ('a, 'b, 'c) Genarray.t -> int -> ('a, 'b, 'c) Array1.t > >> 1377a1081,1082 > Specialized version of Bigarray.reshape[29.1] for reshaping to > one-dimensional arrays. 1380c1085,1087 < end --- > val reshape_2 : > ('a, 'b, 'c) Genarray.t -> > int -> int -> ('a, 'b, 'c) Array2.t 1382a1090,1102 > Specialized version of Bigarray.reshape[29.1] for reshaping to > two-dimensional arrays. > > << > val reshape_3 : > ('a, 'b, 'c) Genarray.t -> > int -> int -> int -> ('a, 'b, 'c) Array3.t > >> > > Specialized version of Bigarray.reshape[29.1] for reshaping to > three-dimensional arrays. > > 1413c1133 < |Bigarray_val(v)->num_dims |number of dimensions | --- > | Bigarray_val(v)->num_dims |number of dimensions | 1422c1142 < |BIGARRAY_FLOAT32 |32-bit single-precision floats | --- > | BIGARRAY_FLOAT32 |32-bit single-precision floats | 1435,1436c1155 < << < extern void my_c_function(double * data, int dimx, int dimy); --- > << extern void my_c_function(double * data, int dimx, int dimy); 1475,1476c1194 < << < extern long my_c_array[100][200]; --- > << extern long my_c_array[100][200]; 1483c1201 < return alloc_bigarray(BIGARRAY_NATIVEINT | BIGARRAY_C_LAYOUT, --- > return alloc_bigarray(BIGARRAY_NATIVE_INT | BIGARRAY_C_LAYOUT, |