Command: MathematicaToSliIndex

NEST HelpDesk Command Index NEST Quick Reference

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

Synopsis:
 [array] mathematicaIndex MathematicaToSliIndex -> [array] sliIndex

Description:
   "MathematicaToSliIndex" converts Mathematica-like indices
   to SLI 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).

   The given array is left untouched, solely its length is taken to
   correctly map negative Mathematica indices to the correct SLI
   indices.

   Alternatives: Function MathematicaToSliIndex_i if index is a
   number (example 1) and  MathematicaToSliIndex_a if index is an
   array (example 2) (both undocumented) -> behaviour and synopsis are
   the same.

Examples:
   [3 5 6 9 11] -2       MathematicaToSliIndex -> [3 5 6 9 11] 3
   [3 5 6 9 11] [ -2 2 ] MathematicaToSliIndex -> [3 5 6 9 11] [3 1]

Author:
 Markus Diesmann

Remarks:
 Commented Ruediger Kupper

SeeAlso:SliToMathematicaIndex
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