SliToMathematicaIndex

Command: SliToMathematicaIndex


Synopsis
sliIndex MathematicaToSliIndex -> mathematicaIndex

Description

"SliToMathematicaIndex" converts SLI indices to Mathematica-like
indices.
For an array of size N valid SLI indices are in the range 0..N-1 while
valid Matematica indices are in the range -N..-1 1..N (negative
indices indicating backward indexing from the end of the array).

Note that this routine will always return positive indices.

File
lib/sli/mathematica.sli
Author
Ruediger Kupper

Remarks

Note the difference in the argument list compared to
"MathematicaToSliIndex". Only one argument the index(array)
itself is needed.

The implementation is _most_ simple (add 1 to the index) but the
Routine is supplied for symmetry reasons.

Note that this routine will always return positive indices. Hence
the sequence
[array] MathematicaToSliIndex SliToMathematicaIndex
is NOT identity.

FirstVersion
11.3.2003

Examples

3 SliToMathematicaIndex -> 4
[ 3 1 ] SliToMathematicaIndex -> [ 4 2 ]