1Bigarray.Array0(3) OCaml library Bigarray.Array0(3)
2
3
4
6 Bigarray.Array0 - Zero-dimensional arrays.
7
9 Module Bigarray.Array0
10
12 Module Array0
13 : sig end
14
15
16 Zero-dimensional arrays. The Array0 structure provides operations simi‐
17 lar to those of Bigarray.Genarray , but specialized to the case of
18 zero-dimensional arrays that only contain a single scalar value. Stat‐
19 ically knowing the number of dimensions of the array allows faster op‐
20 erations, and more precise static type-checking.
21
22
23 Since 4.05.0
24
25
26
27
28
29 type ('a, 'b, 'c) t
30
31
32 The type of zero-dimensional Bigarrays whose elements have OCaml type
33 'a , representation kind 'b , and memory layout 'c .
34
35
36
37 val create : ('a, 'b) Bigarray.kind -> 'c Bigarray.layout -> ('a, 'b,
38 'c) t
39
40
41 Array0.create kind layout returns a new Bigarray of zero dimension.
42 kind and layout determine the array element kind and the array layout
43 as described for Bigarray.Genarray.create .
44
45
46
47 val init : ('a, 'b) Bigarray.kind -> 'c Bigarray.layout -> 'a -> ('a,
48 'b, 'c) t
49
50
51 Array0.init kind layout v behaves like Array0.create kind layout except
52 that the element is additionally initialized to the value v .
53
54
55 Since 4.12.0
56
57
58
59 val kind : ('a, 'b, 'c) t -> ('a, 'b) Bigarray.kind
60
61 Return the kind of the given Bigarray.
62
63
64
65 val layout : ('a, 'b, 'c) t -> 'c Bigarray.layout
66
67 Return the layout of the given Bigarray.
68
69
70
71 val change_layout : ('a, 'b, 'c) t -> 'd Bigarray.layout -> ('a, 'b,
72 'd) t
73
74
75 Array0.change_layout a layout returns a Bigarray with the specified
76 layout , sharing the data with a . No copying of elements is involved:
77 the new array and the original array share the same storage space.
78
79
80 Since 4.06.0
81
82
83
84 val size_in_bytes : ('a, 'b, 'c) t -> int
85
86
87 size_in_bytes a is a 's Bigarray.kind_size_in_bytes .
88
89
90
91 val get : ('a, 'b, 'c) t -> 'a
92
93
94 Array0.get a returns the only element in a .
95
96
97
98 val set : ('a, 'b, 'c) t -> 'a -> unit
99
100
101 Array0.set a x v stores the value v in a .
102
103
104
105 val blit : ('a, 'b, 'c) t -> ('a, 'b, 'c) t -> unit
106
107 Copy the first Bigarray to the second Bigarray. See Bigarray.Genar‐
108 ray.blit for more details.
109
110
111
112 val fill : ('a, 'b, 'c) t -> 'a -> unit
113
114 Fill the given Bigarray with the given value. See Bigarray.Genar‐
115 ray.fill for more details.
116
117
118
119 val of_value : ('a, 'b) Bigarray.kind -> 'c Bigarray.layout -> 'a ->
120 ('a, 'b, 'c) t
121
122 Build a zero-dimensional Bigarray initialized from the given value.
123
124
125
126
127
128OCamldoc 2022-02-04 Bigarray.Array0(3)