arraylib::IndexWrap - project a cyclic index value onto interval [0,N).
index N CyclicValue -> normindex
-6 3 IndexWrap -> 0
-5 3 IndexWrap -> 1
-4 3 IndexWrap -> 2
-3 3 IndexWrap -> 0
-2 3 IndexWrap -> 1
-1 3 IndexWrap -> 2
0 3 IndexWrap -> 0
1 3 IndexWrap -> 1
2 3 IndexWrap -> 2
3 3 IndexWrap -> 0
4 3 IndexWrap -> 1
5 3 IndexWrap -> 2
6 3 IndexWrap -> 0
"IndexWrap" projects a cyclic integer index in the range (-oo,oo),
of periodicy N, onto its norm interval [0,N).
This function can be used to "wrap around" array indices in order to
index an array
Alternatives: Function IndexWrap_i_i (undocumented) -> behaviour and
synopsis are the same, except that no warnings or error messages are
thrown.
In : index: integer value in (-oo,oo).
N: Peroidicity of the cyclic index.
"index" is projected on the half-open interval [0,N).
N must be positive (and different from 0).
Out: The cyclic equivalent of the given index, regarding period N.
N must be positive (and different from 0). If N <= 0, /RangeCheck is raised.
Note that the variant IndexWrap_i_i does not do this check for
efficiency, and will break or yield invalid results in this case.
This function behaves like Mathematica's Mod function (which is
different from the mathematical definition of MOD).
"Namespace"-dictionary "arraylib".
Ruediger Kupper
14.2.2003 (Einstein's birthday)
/var/www/debian/nest/nest-simulator-2.20.0/lib/sli/arraylib.sli