Skip to content

Commit d75a1e2

Browse files
committed
more docs
1 parent 5af2be0 commit d75a1e2

File tree

25 files changed

+990
-139
lines changed

25 files changed

+990
-139
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ const numberOfPoints = 20000000;
8787
8888
// ...
8989
90-
let x = af.randu(numberOfPoints, af.types.dtype.f32);
91-
let y = af.randu(numberOfPoints, af.types.dtype.f32);
90+
let x = af.randu(numberOfPoints, af.dtype.f32);
91+
let y = af.randu(numberOfPoints, af.dtype.f32);
9292
let dist = af.sqrt(x.mul(x).add(y.mul(y)));
9393
let numInside = yield af.sumAsync(dist.lt(1));
9494
let piVal = (4.0 * numInside) / numberOfPoints;

documentation/docs/AFArray.md

Lines changed: 38 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
[-> ArrayFire Documentation](http://www.arrayfire.com/docs/group__array__mat.htm)
44

5+
## TOC
6+
57
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
68
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
79

@@ -53,9 +55,9 @@ Creates an AFArray instance of the specified dimensions, and copies data from th
5355

5456
- **dim0 .. dim3: Number** - size of the dimension
5557
- **dims: Array|[Dim4](Dim4)** - specifies sizes of the dimensions, eg: `[2, 1, 1]` or `new Dim4(3, 4)`
56-
- **type: value of [dType](statics/#typesdtype)** - can be one of the values of dType object (eg. `dType.f32`)
58+
- **type: value of [dType](enums/#dtype)** - can be one of the values of dType object (eg. `dType.f32`)
5759
- **buffer: Buffer** - data to copy to the device, or device pointer created by the `alloc` method.
58-
- **source: value of [source](statics/#typessource)** - can be one of the values of source object (eg. `source.host`)
60+
- **source: value of [source](enums/#source)** - can be one of the values of source object (eg. `source.host`)
5961

6062
**Result**: the created AFArray instance.
6163

@@ -74,7 +76,7 @@ Arrays could be created as empty ones or by having a specified dimensions and el
7476

7577
- **dim0 .. dim3: Number** - size of the dimension
7678
- **dims: Array|[Dim4](Dim4)** - specifies sizes of the dimensions, eg: `[2, 1, 1]` or `new Dim4(3, 4)`
77-
- **type: value of [dType](statics/#typesdtype)** - can be one of the values of dType object (eg. `dType.f32`)
79+
- **type: value of [dType](enums/#dtype)** - can be one of the values of dType object (eg. `dType.f32`)
7880

7981
**Remarks:**
8082

@@ -133,13 +135,13 @@ Perform deep copy from host/device pointer to an existing array.
133135

134136
- **buffer: Buffer** - data to copy to the array, or device pointer created by the `alloc` method.
135137
- **bytesToCopy**: bytes to copy
136-
- **source: value of [source](statics/#typessource)** - can be one of the values of source object (eg. `source.host`)
138+
- **source: value of [source](enums/#source)** - can be one of the values of source object (eg. `source.host`)
137139

138140
### type()
139141

140142
- `type()` [-> ArrayFire Documentation](http://www.arrayfire.com/docs/group__method__mat.htm#ga0844daa9b8cc7b7912e89a3d8ddf1a4b)
141143

142-
**Result:** array's element type, can be one of the values of **[dType](statics/#typesdtype)** object
144+
**Result:** array's element type, can be one of the values of **[dType](enums/#dtype)** object
143145

144146
### dims()
145147

@@ -171,7 +173,7 @@ Converts the array into another type.
171173

172174
**Arguments:**
173175

174-
- **type: value of [dType](statics/#typesdtype)** - can be one of the values of dType object (eg. `dType.f32`)
176+
- **type: value of [dType](enums/#dtype)** - can be one of the values of dType object (eg. `dType.f32`)
175177

176178
**Result:** AFArray instance holding reference the converted array
177179

@@ -209,7 +211,6 @@ Evaluate any JIT expressions to generate data for the array.
209211
**Arguments**:
210212

211213
- **s0 .. s3: null|String|Number|[Seq](Seq)|AFArray**
212-
213214
- **null:** means `"span"`
214215
- **String:** can be `"span"`
215216
- **Number:** element's index, or -1 which means the last element
@@ -273,11 +274,40 @@ Gets a reference of a matrix in a 3D AFArray.
273274
- `subAssign(other)` operator -=
274275
- `mulAssign(other)` operator *=
275276
- `divAssign(other)` operator /=
277+
- `assign(s0, other)` operator =
278+
- `set(s0, other)` operator = (alias of assign)
279+
- `addAssign(s0, other)` operator +=
280+
- `subAssign(s0, other)` operator -=
281+
- `mulAssign(s0, other)` operator *=
282+
- `divAssign(s0, other)` operator /=
283+
- `assign(s0, s1, other)` operator =
284+
- `set(s0, s1, other)` operator = (alias of assign)
285+
- `addAssign(s0, s1, other)` operator +=
286+
- `subAssign(s0, s1, other)` operator -=
287+
- `mulAssign(s0, s1, other)` operator *=
288+
- `divAssign(s0, s1, other)` operator /=
289+
- `assign(s0, s1, s2, other)` operator =
290+
- `set(s0, s1, s2, other)` operator = (alias of assign)
291+
- `addAssign(s0, s1, s2, other)` operator +=
292+
- `subAssign(s0, s1, s2, other)` operator -=
293+
- `mulAssign(s0, s1, s2, other)` operator *=
294+
- `divAssign(s0, s1, s2, other)` operator /=
295+
- `assign(s0, s1, s2, s3, other)` operator =
296+
- `set(s0, s1, s2, s3, other)` operator = (alias of assign)
297+
- `addAssign(s0, s1, s2, s3, other)` operator +=
298+
- `subAssign(s0, s1, s2, s3, other)` operator -=
299+
- `mulAssign(s0, s1, s2, s3, other)` operator *=
300+
- `divAssign(s0, s1, s2, s3, other)` operator /=
276301

277302
**Arguments**:
278303

304+
- **s0 .. s3: null|String|Number|[Seq](Seq)|AFArray** lhs index
305+
- **null:** means `"span"`
306+
- **String:** can be `"span"`
307+
- **Number:** element's index, or -1 which means the last element
308+
- **[Seq](Seq):** sequence of values
309+
- **AFArray:** array holding the index value
279310
- **other: AFArray|Number|[Complex](Complex)|String**
280-
281311
- **AFArray:** rhs array
282312
- **Number:** rhs number
283313
- **[Complex](Complex):** rhs complex value
@@ -301,7 +331,6 @@ Gets a reference of a matrix in a 3D AFArray.
301331
**Arguments**:
302332

303333
- **other: AFArray|Number|[Complex](Complex)|String**
304-
305334
- **AFArray:** rhs array
306335
- **Number:** rhs number
307336
- **[Complex](Complex):** rhs complex value
@@ -330,7 +359,6 @@ Gets a reference of a matrix in a 3D AFArray.
330359
**Arguments**:
331360

332361
- **other: AFArray|Number|[Complex](Complex)|String**
333-
334362
- **AFArray:** rhs array
335363
- **Number:** rhs number
336364
- **[Complex](Complex):** rhs complex value

documentation/docs/Col.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Col class
2+
3+
## constructor
4+
5+
- `new Col(index)`
6+
7+
**Arguments**:
8+
9+
- **index: Number** - column index
10+
11+
## Properties
12+
13+
### index
14+
15+
**Value:** column index

documentation/docs/Cols.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Cols class
2+
3+
## constructor
4+
5+
- `new Cols(firstIndex, lastIndex)`
6+
7+
**Arguments**:
8+
9+
- **firstIndex: Number** - first col index
10+
- **lastIndex: Number** - last col index
11+
12+
## Properties
13+
14+
### firstIndex
15+
16+
**Value:** first col index
17+
18+
### lastIndex
19+
20+
**Value:** last col index

documentation/docs/Row.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Row class
2+
3+
## constructor
4+
5+
- `new Row(index)`
6+
7+
**Arguments**:
8+
9+
- **index: Number** - row index
10+
11+
## Properties
12+
13+
### index
14+
15+
**Value:** row index

documentation/docs/Rows.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Rows class
2+
3+
## constructor
4+
5+
- `new Rows(firstIndex, lastIndex)`
6+
7+
**Arguments**:
8+
9+
- **firstIndex: Number** - first row index
10+
- **lastIndex: Number** - last row index
11+
12+
## Properties
13+
14+
### firstIndex
15+
16+
**Value:** first row index
17+
18+
### lastIndex
19+
20+
**Value:** last row index

documentation/docs/Slice.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Slice class
2+
3+
## constructor
4+
5+
- `new Slice(index)`
6+
7+
**Arguments**:
8+
9+
- **index: Number** - slice index
10+
11+
## Properties
12+
13+
### index
14+
15+
**Value:** slice index

documentation/docs/Slices.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Slices class
2+
3+
## constructor
4+
5+
- `new Slices(firstIndex, lastIndex)`
6+
7+
**Arguments**:
8+
9+
- **firstIndex: Number** - first slice index
10+
- **lastIndex: Number** - last slice index
11+
12+
## Properties
13+
14+
### firstIndex
15+
16+
**Value:** first slice index
17+
18+
### lastIndex
19+
20+
**Value:** last slice index

documentation/docs/create.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Create a random array sampled from uniform distribution.
3131

3232
- **dim0 .. dim3: Number** - size of the dimension
3333
- **dims: Array|[Dim4](Dim4)** - specifies sizes of the dimensions, eg: `[2, 1, 1]` or `new Dim4(3, 4)`
34-
- **type: value of [dType](statics/#typesdtype)** - can be one of the values of dType object (eg. `dType.f32`)
34+
- **type: value of [dType](enums/#dtype)** - can be one of the values of dType object (eg. `dType.f32`)
3535

3636
**Result**: the created AFArray instance.
3737

@@ -53,7 +53,7 @@ Create a random array sampled from normal distribution.
5353

5454
- **dim0 .. dim3: Number** - size of the dimension
5555
- **dims: Array|[Dim4](Dim4)** - specifies sizes of the dimensions, eg: `[2, 1, 1]` or `new Dim4(3, 4)`
56-
- **type: value of [dType](statics/#typesdtype)** - can be one of the values of dType object (eg. `dType.f32`)
56+
- **type: value of [dType](enums/#dtype)** - can be one of the values of dType object (eg. `dType.f32`)
5757

5858
**Result**: the created AFArray instance.
5959

@@ -75,7 +75,7 @@ Create an identity matrix (array with diagonal values 1).
7575

7676
- **dim0 .. dim3: Number** - size of the dimension
7777
- **dims: Array|[Dim4](Dim4)** - specifies sizes of the dimensions, eg: `[2, 1, 1]` or `new Dim4(3, 4)`
78-
- **type: value of [dType](statics/#typesdtype)** - can be one of the values of dType object (eg. `dType.f32`)
78+
- **type: value of [dType](enums/#dtype)** - can be one of the values of dType object (eg. `dType.f32`)
7979

8080
**Result**: the created AFArray instance.
8181

@@ -94,7 +94,7 @@ Creates an array with [0, n] values along the seqDim which is tiled across other
9494
- **dim0 .. dim3: Number** - size of the dimension
9595
- **dims: Array|[Dim4](Dim4)** - specifies sizes of the dimensions, eg: `[2, 1, 1]` or `new Dim4(3, 4)`
9696
- **seqDim: Number** - dimension along which [0, dim[seqDim] - 1] is generated, default is -1, which means the last specified dimension
97-
- **type: value of [dType](statics/#typesdtype)** - can be one of the values of dType object (eg. `dType.f32`)
97+
- **type: value of [dType](enums/#dtype)** - can be one of the values of dType object (eg. `dType.f32`)
9898

9999
**Result**: the created AFArray instance.
100100

@@ -108,7 +108,7 @@ Create an sequence [0, dims.elements - 1] and modify to specified dimensions dim
108108

109109
- **dims: Array|[Dim4](Dim4)** - specifies sizes of the dimensions, eg: `[2, 1, 1]` or `new Dim4(3, 4)`
110110
- **tileDims: Array|[Dim4](Dim4)** - specifies the tiling dimensions, eg: `[2, 1, 1]` or `new Dim4(3, 4)`
111-
- **type: value of [dType](statics/#typesdtype)** - can be one of the values of dType object (eg. `dType.f32`)
111+
- **type: value of [dType](enums/#dtype)** - can be one of the values of dType object (eg. `dType.f32`)
112112

113113
**Result**: the created AFArray instance.
114114

@@ -144,6 +144,6 @@ Create an array filled with the specified value.
144144
- **String:**: number value (to workaround JavaScript inability to hold int64 values)
145145
- **dim0 .. dim3: Number** - size of the dimension
146146
- **dims: Array|[Dim4](Dim4)** - specifies sizes of the dimensions, eg: `[2, 1, 1]` or `new Dim4(3, 4)`
147-
- **type: value of [dType](statics/#typesdtype)** - can be one of the values of dType object (eg. `dType.f32`)
147+
- **type: value of [dType](enums/#dtype)** - can be one of the values of dType object (eg. `dType.f32`)
148148

149149
**Result**: the created AFArray instance.

documentation/docs/devices.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ Allocates memory on the device.
122122
**Arguments:**
123123

124124
- **elements: Number** - number of elements to allocate
125-
- **type: value of [dType](statics/#typesdtype)** - type of the elements, can be one of the values of dType object (eg. `dType.f32`)
125+
- **type: value of [dType](enums/#dtype)** - type of the elements, can be one of the values of dType object (eg. `dType.f32`)
126126

127127
**Result: Buffer** - device memory pointer
128128

@@ -137,7 +137,7 @@ Allocates pinned memory on the host by using ArrayFire's memory manager.
137137
**Arguments:**
138138

139139
- **elements: Number** - number of elements to allocate
140-
- **type: value of [dType](statics/#typesdtype)** - type of the elements, can be one of the values of dType object (eg. `dType.f32`)
140+
- **type: value of [dType](enums/#dtype)** - type of the elements, can be one of the values of dType object (eg. `dType.f32`)
141141

142142
**Result: Buffer** - memory pointer
143143

0 commit comments

Comments
 (0)