Command: SliToMathematicaIndex

NEST HelpDesk Command Index NEST Quick Reference

Name:
 SliToMathematicaIndex - Convert SLI indices to Mathematica-like indices

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.

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


Author:
 Ruediger Kupper

FirstVersion:
 11.3.2003

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.

SeeAlso:MathematicaToSliIndex
Source:
 /home/abuild/rpmbuild/BUILD/nest-2.4.1/lib/sli/mathematica.sli

NEST HelpDesk Command Index NEST Quick Reference

© 2000-2010 The NEST Initiative