previous contents index next
(..Statement Part..) Contents Index (..Statement Part..)

3.2.3 Cell Grids (Loop)

Generally we are now able to specify the whole initial configuration by assigning CellExpressions to each cell, one by one. It need not be underlined, how boring this could be! Usually there are quite big amounts of cells which are to be treated in the same way. SCARLET supports this by giving a possibility to look at all cells in subsets of rather simple forms at the same time. The complete syntax is given by

Loop - Syntax:

Syntax: Loop

 

The basic form of all these sets is the cube, which is completely determined by two diametral corners Cell. We have already used this method to fix the range of the retina itself. The cube must certainly be a part of the retina. (Therefore, it is sufficient to check that the coordinates of the corners are within the range of the retina.)

Besides the ''full cube'' we can also decide to consider only those sites which form the crossing points of special grids (grid points), in which the distances between two grid lines in a certain coordinate direction must be constant.
 

As most general syntax of a set of grid points Loop we have

Cell1 (IntExpressionList) Cell2

where Cell1 and Cell2 are suitable sites generating the cube and lying within the retina, and where the single IntExpressions of (IntExpressionList) are values for the step sizes in the single coordinate directions. (IntExpression1 belongs to the first, IntExpression2 to the second, and so on.) Looking at a n-dimensional space we have to put n values for n step sizes.

IntExpression1 , IntExpression2 , ... , IntExpressionn

Furthermore we restrict the step sizes to positive nonnegative numbers, and IntExpressioni, 1&#lt;= i <= n, can only be zero, if the cube's extension in coordinate direction i equals one, what means that the i-th components of Cell1 and Cell2 are the same.

Although the syntax of Loop looks like a DO-WHILE structure, SCARLET evaluates all its expressions - especially (IntExpressionList) - only once to grant the step size to be constant.

Note that SCARLET takes Cell1 always for a grid point. Suppose that the set of coordinates of the full cube is called Q. The coordinate of a certain cell is a grid point, if there exist m_1, m_2, ... ,m_n in ZZ such that the following statement is valid:

Cell = Cell_1 + [ m_1* IntExpression_1 , ... , m_n * IntExpression_n]^t in Q




Example 38:

In a two-dimensional space [-5,-3] (3,2) [5,4] generates the following set of grid points (pointed out by black dots):


Special retina


For some special cases SCARLET allows abbreviations instead of the normal syntax:
 




Example 39:

Three ways to describe the same set:

[0,1,2,3] (1,1,1,1) [4,5,6,7]

[0,1,2,3] (1) [4,5,6,7]

[0,1,2,3]..[4,5,6,7] 

previous contents index next
(..Statement Part..) Contents Index (..Statement Part..)