@@ -7,6 +7,7 @@ cat(' * <a href="array-size-and-dimension-function.html">Array Size and Dimensio
7
7
cat(' * <a href="array-broadcasting.html">Array Broadcasting</a>\n')
8
8
cat(' * <a href="array-concatenation.html">Array Concatenation</a>\n')
9
9
cat(' * <a href="sorting-functions.html">Sorting functions</a>\n')
10
+ cat(' * <a href="reversing-functions.html">Reversing Functions</a>\n')
10
11
}
11
12
```
12
13
@@ -334,7 +335,7 @@ Any mismatches will cause an error to be thrown.
334
335
x3 = append_array(x1, x2);
335
336
```
336
337
337
- ## Sorting functions {#sorting-functions}
338
+ ## Sorting Functions {#sorting-functions}
338
339
339
340
Sorting can be used to sort values or the indices of those values in
340
341
either ascending or descending order. For example, if ` v ` is declared
@@ -409,3 +410,21 @@ Number of components of v less than v[s]
409
410
` int ` ** ` rank ` ** ` (int[] v, int s) ` <br >\newline
410
411
Number of components of v less than v[ s]
411
412
413
+ ## Reversing Functions {#reversing-functions}
414
+
415
+ Reversing allows to create a copy of array in which elements are in reverse
416
+ order. For example, if ` v ` is declared as a real array of size 3, with values
417
+ \[ \text{v} = (1,\, -10.3,\, 20.987), \] then
418
+ \[ \mathrm{reverse(v)} = (20.987,\, -10.3,\, 1). \]
419
+
420
+ <!-- real[]; reverse; (real[] v); -->
421
+ \index{{\tt \bfseries reverse }!{\tt (real[ ] v): real[ ] }|hyperpage}
422
+
423
+ ` real[] ` ** ` reverse ` ** ` (real[] v) ` <br >\newline
424
+ Create a copy of the array with the elements in reverse order.
425
+
426
+ <!-- int[]; reverse; (int[] v); -->
427
+ \index{{\tt \bfseries reverse }!{\tt (int[ ] v): int[ ] }|hyperpage}
428
+
429
+ ` int[] ` ** ` reverse ` ** ` (int[] v) ` <br >\newline
430
+ Create a copy of the array with the elements in reverse order.
0 commit comments