# Command: SliToMathematicaIndex

NEST HelpDesk | Command Index | NEST Quick Reference

Name:

    SliToMathematicaIndex - Convert SLI indices to Mathematica-like indices

Synopsis:

    sliIndex MathematicaToSliIndex -> mathematicaIndex

Examples:

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

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.

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.

Author:

    Ruediger Kupper

FirstVersion:

    11.3.2003

SeeAlso:

- MathematicaToSliIndex

Source:

    /opt/conda/conda-bld/nest_1512418773968/work/nest-2.14.0/lib/sli/mathematica.sli

NEST HelpDesk | Command Index | NEST Quick Reference

© 2004 The NEST Initiative