There are a number of ways to examine the components of an indexed object. The simplest is to specify the fixed index that refers to the component of interest: the current value of the component will immediately be read-out, and is available for use in algebraic expressions. For example,
#: h[1,1];To examine the object as a whole, two display formats are provided. The first is obtained by attaching an empty index to the object, as in h[]. For an indexed scalar, this is the only kind of index allowed and results in the scalar value being returned. For any other kind of object the existing explicit components are displayed. Only those components that are actually stored in the data structure are shown, and no evaluation takes place, which also implies that a non-unit multiplier (qv) will not be combined with the component. Hence, an implicit object with no explicit elements will appear to be empty. Components shown by this display format may not match what would be shown by reading components with fixed indices. Because the index is empty some objects, notably those derived from the raising or lowering of indices of other objects, must be referenced with their actual name (or the generic equivalent). If the switch iprop is on, some of the properties listed in §2.2.6 are also shown.2 - rt #: df(h[2,2],t);
2 - 2 rt sin(sqrt(k) om) rt t ------------------------------ k
The second display format is obtained when the literal character ? is found (written as a normal index element) in a pattern or fixed index. Those indices preceding this special character are used as part (or all) of a pattern index, and any indices needed to fill out the index are automatically generated. Indices following the ? are ignored. The simplest way to examine the entire object is with h[?] which (for a rank-2 object) is equivalent to h[a,b,?], whereas to examine the first row one might use the command h[1,?]. This format will also display some of the object properties, depending on the setting of the iprop switch. The properties shown when the switch iprop is on can also be seen, regardless of the switch setting, with the function iprop() (qv).
The components are displayed by expanding the pattern index and reading each component from the object. Thus, the user can select segments of the object to display and will be shown the actual read-out value. If the switch xeval xeval is on, an extra evaluation is made to reflect the current state of algebraic variables. This format shows exactly what is in the object, as would be shown by accessing each component directly with a specific fixed index, but only the canonical elements are shown. This format will also show those components that are zero (and usually are not stored and therefore not displayed in the first format) unless the REDUCE switch nero is on. The index can also be used to indicate a shifted object, so that only the parent name need be used, for example h[@a,@b,?].
To see a directory of the objects created in the system, the function dir() is provided. In its simplest form, with no arguments, dir() displays all the objects in the system that have not been flagged with the nodir() (qv) function. The display shows the object name, its type, the number of non-zero explicit components, the state of the protection flags (qv), the coordinates and the index structure. With arguments dir() shows information about the named objects.
#: dir(); name type comp prot coordinates indextype x coordinates 4 w (t om th ph) (1)The current-metrics are indicated by the * at the beginning of the display line.*
h metric 4 w (t om th ph) (-1 -1)*
h_inv metric 4 w (t om th ph) (1 1) 3 objects, Total components: 12