next up previous contents
Next: COPY_SUFFIX(ARRAYDIM, SEGMENT) Up: Specifications of Library Procedures Previous: COPY_SCATTER(ARRAYBASE,INDX1, ..., INDXn, MASK)

COPY_SCATTER(ARRAY,BASE,INDX1, ..., INDXn, MASK)

Optional Argument. MASK

Description. Scatters elements of ARRAY selected by MASK to positions of the result indicated by index arrays INDX1, ..., INDXn. Each element of the result is equal to one of the elements of ARRAY scattered to that position or, if there is none, to the corresponding element of BASE.

Class. Transformational function.

Arguments.

ARRAY may be of any type. It must not be scalar.

BASE must be of the same type and kind type parameter as ARRAY.

INDX1,...,INDXn must be of type integer and conformable with ARRAY. The number ofINDX arguments must be equal to the rank of BASE.

MASK (optional) must be of type logical and must be conformable with ARRAY.

Result Type, Type Parameter, and Shape. Same as BASE.

Result Value. Let be the set of elements of ARRAY associated with element of BASE as described in Secion 7.4.4.

If is empty, then the element of the result corresponding to the element of BASE has the same value as .

If is non-empty, then the element of the result corresponding to the element of BASE is the result of choosing one element from . HPF does not specify how the choice is to be made; the mechanism is implementation dependent.

Example. COPY_SCATTER((/1, 2, 3, 4/), (/7, 8, 9/), (/1, 1, 2, 2/)) is [x,y, 9], where x is a member of the set {1,2} and y is a member of the set {3,4}.