+=, -=, *=, /=, &=, ^=, |=, =, >?= int:S pvar; sum += pvar; /* summation of pvar */ bit_and &= pvar; /* bitwise and all elements of pvar */ printf(" product %d \n", *=pvar ); /* print product of pvar */ min_val = pvar; /* find minimum value of all elements in pvar */ max_val >?= pvar; /* find maximum value of all elements in pvar */Note that when these operators are used with parallel variables on both left and right hand sides, the operation applies to all elements, and is then not a reduction:
pvar1 += pvar2; /* for each element, add pvar1 and pvar2 and store into pvar1 */When the left side is a scalar, then the operator is a reduction:
s += pvar; /* sum pvar into scalar s */ pvar = s; /* set all elements of pvar to scalar s */
Options:
©1995 Pacific-Sierra Research Corporation. All rights reserved.
Send comments or suggestions to dpce2 at crescentbaysoftware.com.