next up previous contents
Next: UNPACK Intrinsic Up: Array Construction Intrinsics Previous: SPREAD Intrinsic

 

PACK Intrinsic

PACK(SOURCE,MASK[,VECTOR])

This function packs a arbitrary shaped array into a one-dimensional array under a mask. VECTOR, if present, must be 1-D and must be of same type and kind as SOURCE.

Element i of the result is the element of SOURCE that corresponds to the ith .TRUE. element of MASK, (in array element order,) for i=1,...,t, where t is the number .TRUE. elements in MASK.

If VECTOR is present, the result size is that of VECTOR; otherwise, the result size is t unless MASK is scalar with the value .TRUE. in which case the result size is the size of SOURCE. If VECTOR has size n > t, element i of the result has the value VECTOR(i), for i=t+1,...,n.

For example, if

displaymath23422

and

displaymath23493

then


next up previous contents
Next: UNPACK Intrinsic Up: Array Construction Intrinsics Previous: SPREAD Intrinsic

Adam Marshall ©University of Liverpool, 1996
Tue Nov 26 17:50:42 GMT 1996