Index list

From ArachneWiki

Jump to: navigation, search

An index list is a type of input parameter that represents a set of integers with a string. Many Arachne modules require index lists in their command-line arguments. The ParseSet module converts index lists from strings into vec<int>s.

Format

Adopted from ParseSet.h

Accepted formats for integers:

  1. n: a single non-negative integer n. Example: 6.
  2. {n1,n2,...,nk}: a set of non-negative integers, n1 to nk. Example: {0,3,8,17,15}.
  3. [a,b]: all integers between a and b, inclusive. Requires that ab. Example: [2,5] = {2,3,4,5}.
  4. [a,b): all integers between a and b, including a but not b. Requires that ab. Example: [2,5) = {2,3,4}.
  5. @file: a list of integers given in the file file.
  6. a|b: a combination of any of the above formats. Example: [3,6)|[8,12] = {3,4,5,8,9,10,11,12}.

ParseSet does not handle negative integers. (Fortunately, indices are never negative.) Do not include quotations around the index list.

Personal tools