next up previous contents
Next: Array Combining Scatter Functions Up: HPF Intrinsics and Library Previous: Bit Manipulation Functions

 

Array Combining Scatter Functions

Fortran 90 allows indirect addressing, however if,

    INTEGER, DIMENSION(4) :: A = 1, B = 2
    INTEGER, DIMENSION(3) :: W = (/1,2,2/)

then writing

 A(W) = A(W) + 2*B(1:3)

is incorrect due to the multiple assignments to A(2). We are able to use combining scatter functions:

 A = SUM_SCATTER(2*B(1:3),A,W)

now A equals (/5,9,1,1/). This performs

 A(1) = A(1) + 2*B(1)
 A(2) = A(2) + 2*B(2) + 2*B(3)

For more information, click here gif


next up previous contents
Next: Array Combining Scatter Functions Up: HPF Intrinsics and Library Previous: Bit Manipulation Functions

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