@@ -782,8 +782,10 @@ In addition to single integer indexes, as described in
782
782
[ the language indexing section] ( #language-indexing.section ) , Stan supports multiple indexing.
783
783
Multiple indexes can be integer arrays of indexes, lower
784
784
bounds, upper bounds, lower and upper bounds, or simply shorthand for
785
- all of the indexes. A complete table of index types is given in the
786
- following table.
785
+ all of the indexes. If the upper bound is smaller than the lower bound,
786
+ the range is empty (unlike, e.g. in R). Upper bound and lower bound can be
787
+ expressions that evaluate to integer. A complete table of index types is
788
+ given in the following table.
787
789
788
790
##### Indexing Options Table {- #index-types-table}
789
791
@@ -797,6 +799,8 @@ following table.
797
799
| lower bound | ` a[3:] ` | ` a[3] ` , ..., ` a[N] ` |
798
800
| upper bound | ` a[:5] ` | ` a[1] ` , ..., ` a[5] ` |
799
801
| range | ` a[2:7] ` | ` a[2] ` , ..., ` a[7] ` |
802
+ | range | ` a[7:2] ` | [ ] |
803
+ | range | ` a[5-3:5+2] ` | ` a[2] ` , ..., ` a[7] ` |
800
804
| all | ` a[:] ` | ` a[1] ` , ..., ` a[N] ` |
801
805
| all | ` a[] ` | ` a[1] ` , ..., ` a[N] ` |
802
806
0 commit comments