for element1 in array1, element2 in array2 do
element2=process_element(element1)
endfor
for element in array do
element = sum(element@{-1..1,-1..1})/count(element@{-1..1,-1..1})
endfor
There are also reduction versions of the communicating operators, which apply an operation globally or over a neighbourhood, rather than returning an array. The above example may be more efficiently coded as:
for element in array do
element = sum::element@{-1..1,-1..1}/count::element@{-1..1,-1..1}
endfor
for element in array do
element = element/sum::element
endfor
Comments
Post a Comment