next up previous contents
Next: Array Sorting Functions Up: HPF Intrinsics and Library Previous: Prefix and Suffix Functions

 

SEGMENT and EXCLUSIVE

SEGMENT: apply the function to sections, for example,

  S       =  (/T,T,T, F,F, T,T, F, T,T/)
  !            -----  ---  ---  -  ---
  SUM_PREFIX((/1,2,3, 4,5, 6,1, 2, 3,4/),SEGMENT=S) =
             (/1,3,6, 4,9, 6,7, 2, 3,7/)

EXCLUSIVE: scalar LOGICAL. If .FALSE. (default) then each element takes part in operation for its position, otherwise it does not and the first scanned element has identity value.

  PRODUCT_PREFIX((/1,2,3,4/), EXCLUSIVE=.TRUE.) = 
                 (/1,1,2,6/)
  SUM_PREFIX((/1,2,3,4/), EXCLUSIVE=.TRUE.) = 
             (/0,1,3,6/)

For more information, click here gif

Now try this question gif


next up previous contents
Next: Array Sorting Functions Up: HPF Intrinsics and Library Previous: Prefix and Suffix Functions

©University of Liverpool, 1997
Wed May 28 23:37:18 BST 1997
Not for commercial use.