Implicit index

An Implicit index (also known as a null-index) is an index that does not have a name, e.g. a list (a 1-dimensional array). It arises in rare cases in a Definition that contains a subexpression that generates a list of values. Normally, when you define an Index variable as a list of values, it becomes an explicit index, for example:

Index Years := 2016 .. 2020

Or if you define a variable as an expression containing subexpression that generates a list, e.g.

Variable Year_number := (1 .. 5) + 2015
Year_number -> [2016, 2017, 2018, 2019, 2020]

The variable becomes a Self index, i.e. it acts as an Index with values

Year_number -> [2016, 2017, 2018, 2019, 2020]

Year_number -> [2016, 2017, 2018, 2019, 2020]

Because an implicit index has no name, you can't refer to it in expressions where index parameters are expected.

Most built-in Analytica functions work fine over implicit indexes, e.g. the Subset function:

Subset(1997..2008 > 2005) → [2006, 2007, 2008]


Index Years := 1997..2008
Subset(Years > 2005) → [2006, 2007, 2008]

To avoid ambiguity, Analytica does not allow more than one implicit index in an array. It gives an error if you try to combine multiple arrays with implicit indexes.

When an implicit index reaches the top level of an expression, it is promoted to a Self index.

Implicit indexes define implicit dimensions, e.g. (-3..3) or [-3, -2, -1, 0, 1, 2, 3]. Indexes that do have a name, are called explicit indexes and define explicit dimensions, e.g. Index I := 1..10.

See Also


You are not allowed to post comments.