Skip to content

Commit ad980bf

Browse files
committed
Improve wording of the reverse functions
1 parent e31dedb commit ad980bf

File tree

2 files changed

+9
-14
lines changed

2 files changed

+9
-14
lines changed

src/functions-reference/array_operations.Rmd

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -412,19 +412,14 @@ Number of components of v less than v[s]
412412

413413
## Reversing Functions {#reversing-functions}
414414

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
415+
Stan provides functions to create a new array by reversing the order of
416+
elements in an existing array. For example, if `v` is declared as a real
417+
array of size 3, with values
417418
\[ \text{v} = (1,\, -10.3,\, 20.987), \] then
418419
\[ \mathrm{reverse(v)} = (20.987,\, -10.3,\, 1). \]
419420

420-
<!-- real[]; reverse; (real[] v); -->
421-
\index{{\tt \bfseries reverse }!{\tt (real[] v): real[]}|hyperpage}
421+
<!-- T[]; reverse; (T[] v); -->
422+
\index{{\tt \bfseries reverse }!{\tt (T[] v): T[]}|hyperpage}
422423

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.
424+
`T[]` **`reverse`**`(T[] v)`<br>\newline
425+
Return a new array containing the elements of the argument in reverse order.

src/functions-reference/matrix_operations.Rmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1618,10 +1618,10 @@ Number of components of v less than v[s]
16181618
\index{{\tt \bfseries reverse }!{\tt (vector v): vector}|hyperpage}
16191619

16201620
`vector` **`reverse`**`(vector v)`<br>\newline
1621-
Create a copy of the vector with the elements in reverse order.
1621+
Return a new vector containing the elements of the argument in reverse order.
16221622

16231623
<!-- row_vector; reverse; (row_vector v); -->
16241624
\index{{\tt \bfseries reverse }!{\tt (row_vector v): row_vector}|hyperpage}
16251625

16261626
`row_vector` **`reverse`**`(row_vector v)`<br>\newline
1627-
Create a copy of the row vector with the elements in reverse order.
1627+
Return a new row vector containing the elements of the argument in reverse order.

0 commit comments

Comments
 (0)