We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c88aaaf commit 1de2a6bCopy full SHA for 1de2a6b
src/reference-manual/expressions.qmd
@@ -804,6 +804,13 @@ given in the following table.
804
| all | `a[:]` | `a[1]`, ..., `a[N]` |
805
| all | `a[]` | `a[1]`, ..., `a[N]` |
806
807
+The range indexing with `:` allows only increasing sequences. Indexing
808
+with a decereasing sequence can be made by creating an integer array in
809
+the following way:
810
+```stan
811
+ array[6] int ii = reverse(linspaced_int_array(6, 2, 7));
812
+```
813
+Then `a[ii]` evaluates to `a[7]`, ..., `a[2]`.
814
815
### Multiple index semantics {-}
816
0 commit comments