You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/arrayandmatrixmanipulation.rst
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,7 @@ ArrayFire provides several different methods for manipulating arrays and matrice
17
17
Below we provide several examples of these functions and their use.
18
18
19
19
flat()
20
-
======
20
+
******
21
21
The **flat()** function flattens an array to one dimension:
22
22
23
23
.. literalinclude:: arrayandmatrixmanipulation.py
@@ -32,7 +32,7 @@ The **flat** function can be called from Python as follows:
32
32
af.flat(array) - Python function for flattening an array
33
33
34
34
flip()
35
-
======
35
+
******
36
36
The **flip()** function flips the contents of an array along a chosen dimension. In the example below, we show the 5x2 array flipped along the zeroth (i.e. within a column) and first (e.g. across rows) axes:
37
37
38
38
@@ -49,7 +49,7 @@ The **flip** function can be called from Python as follows:
49
49
50
50
51
51
join()
52
-
======
52
+
******
53
53
54
54
The **join()** function joins arrays along a specific dimension. The C++ interface can join up to four arrays whereas the C interface supports up to 10 arrays. Here is an example of how to use join an array to itself:
55
55
@@ -66,7 +66,7 @@ The **join** function can be called from Python as follows:
66
66
af.join(0, array, array1) - Python function for joining arrays along a specified axis
67
67
68
68
moddims()
69
-
=========
69
+
*********
70
70
71
71
The **moddims()** function changes the dimensions of an array without changing its data or order. Note that this function modifies only the metadata associated with the array. It does not modify the content of the array. Here is an example of moddims() converting an 8x1 array into a 2x4 and then back to a 8x1:
72
72
@@ -83,7 +83,7 @@ The moddims function has a single form in the Python API:
83
83
84
84
85
85
reorder()
86
-
=========
86
+
*********
87
87
The **reorder()** function modifies the order of data within an array by exchanging data according to the change in dimensionality. The linear ordering of data within the array is preserved.
88
88
89
89
.. literalinclude:: arrayandmatrixmanipulation.py
@@ -92,7 +92,7 @@ The **reorder()** function modifies the order of data within an array by exchang
92
92
:end-before: [manipulation5-endsnippet]
93
93
94
94
shift()
95
-
=======
95
+
*******
96
96
The **shift()** function shifts data in a circular buffer fashion along a chosen dimension. Consider the following example:
97
97
98
98
@@ -107,7 +107,7 @@ The shift function can be called from Python as follows:
107
107
af.shift(array, (3,2)) - Python function for shifting arrays along specified dimension
108
108
109
109
tile()
110
-
======
110
+
******
111
111
The **tile()** function repeats an array along the specified dimension. For example below we show how to tile an array along the zeroth and first dimensions of an array:
112
112
113
113
.. literalinclude:: arrayandmatrixmanipulation.py
@@ -121,7 +121,7 @@ The **tile()** function repeats an array along the specified dimension. For exam
121
121
122
122
123
123
transpose()
124
-
===========
124
+
***********
125
125
The **transpose()** function performs a standard matrix transpose. The input array must have the dimensions of a 2D-matrix.
126
126
127
127
.. literalinclude:: arrayandmatrixmanipulation.py
@@ -139,6 +139,6 @@ The python interface for transpose is as follows:
139
139
140
140
141
141
array()
142
-
=======
142
+
*******
143
143
**array()** can be used to create a (shallow) copy of a matrix with different dimensions. The total number of elements must remain the same. This function is a wrapper over the moddims() function discussed earlier.
0 commit comments