Next: Structure Insertion, Previous: Insertion, Up: Insertion [Contents][Index]

Insertion into arrays (Arrays), strings (Strings), file arrays (File Arrays), and associated variables (Associated Variables) goes according to the following format:

`var`(

) = `subscripts``expr`

where

is a comma-separated list of one or more
subscripts (only one subscript is allowed for associated variables).
The subscripts (after expansion of lists and structures, Lists of Subscripts) may be scalars (Scalars), ranges (Ranges), or
numerical arrays (Arrays), and in general there must be as many
subscripts as there are dimensions in `subscripts`

.
`var`

If

has only one element, then this element is inserted
at every place indicated by the `expr`

. In that case
the conditions on the dimensions of `subscripts`

that are listed
below do not apply.
`expr`

You specify the part of

that receives values from
`var`

in one of the following ways:
`expr`

- By specifying the coordinates of all elements in that part, using
ranges, scalars, or numerical arrays. The different subscripts can be
combined in two different ways, which are indicated by keywords.
Keyword

`/OUTER`

specifies that the coordinates are combined as in a generalized outer product: all possible combinations of the various coordinates are serviced. For example, in`x(1:2,[7,4,2]) =`

,`expr`

must have dimensions 2 by 3, and the elements of`expr`

(in the order`expr``(0,0), (1,0), (0,1), (1,1), (0,2), (1,2)`

) are inserted into`x`

in the elements`(1,7), (2,7), (1,4), (2,4), (1,2), (2,2)`

respectively.In this case each dimension of

must be equal to the number of elements in the corresponding non-scalar subscript to`expr``x`

.Keyword

`/INNER`

specifies that the coordinates are combined as in a generalized inner product: each element of each multi-element subscript is used only once. For example, in`x([1,2],[7,4],/INNER) =`

, the`expr`

must have the same number of elements as each multi-element subscript to`expr``x`

, and all multi-element subscripts to`x`

must have the same number of elements. The elements of

are inserted in`expr``x`

in the elements`(1,7), (2,4)`

, respectively.By default,

`/OUTER`

is assumed if none of the subscripts has more than one dimension, and`/INNER`

otherwise.In addition, the elements of a single subscript which is a numerical

`array`

can be interpreted as if its elements were specified as separate`scalar`

s, by specifying the`/SEPARATE`

keyword.You may specify fewer subscripts than there are dimensions only if you also specify one of the keywords

`/ZERO`

or`/ALL`

. Keyword`/ZERO`

indicates that all omitted remaining subscripts are to be taken equal to zero. Keyword`/ALL`

indicates that all omitted remaining subscripts are to be taken equal to`*`

. These keywords can be combined with keyword`/SEPARATE`

. -
By specifying the coordinates of the lowest corner of that part (if the
part is a single block in all of its dimensions). If

has fewer dimensions than`expr`

, or if keyword`var``/ONEDIM`

is specified, then the insertion is done in one-dimensional fashion, starting at the element of

that is indicated by the subscripts. For example, in`var``x(2,4,0) =`

with`expr`

having fewer than three dimensions, the elements of`expr`

are inserted into consecutive elements of`expr``x`

, starting at the element of`x`

that corresponds to coordinates`(2,4,0)`

.If

has the same number of dimensions as`expr`

and if keyword`var``/ONEDIM`

is not specified, then the insertion is done taking the dimensional structure of

into account. For example, regard`var``x(2,4,0) =`

with`expr`

with 3 dimensions. Assuming that`expr`

has at least two elements in each dimension, elements`expr``(0,0,0), (1,0,0)`

of

are inserted in elements`expr``(2,4,0), (3,4,0)`

of`x`

. Elements`(0,1,0), (1,1,0)`

go to`(2,5,0), (3,5,0)`

, and elements`(0,0,1), (1,0,1)`

to`(2,4,1), (3,4,1)`

. - By specifying one index to

. In this case`var`

and`var`

are treated as one-dimensional arrays and the elements of`expr`

are inserted in`expr`

starting at the specified index.`var`

In any of the methods of insertion, it is illegal to try to insert data beyond the boundaries of the target.

The intention is to expand this kind of insertion to allow multiple
levels of insertion target specifications (such as
`x(5,*)(22).ALPHA = y`

), but this is not yet implemented.

See also: Data Classes, Subscripts

Next: Structure Insertion, Previous: Insertion, Up: Insertion [Contents][Index]