The following table lists the reduction operations that are recognized by the compiler.
Table 10–2 Recognized Reduction Operations|
Mathematical Operations |
Fortran Statement Templates |
|---|---|
|
Sum |
s = s + v(i) |
|
Product |
s = s * v(i) |
|
Dot product |
s = s + v(i) * u(i) |
|
Minimum |
s = amin( s, v(i)) |
|
Maximum |
s = amax( s, v(i)) |
|
OR |
do i = 1, n b = b .or. v(i) end do |
|
AND |
b = .true. do i = 1, n b = b .and. v(i) end do |
|
Count of non-zero elements |
k = 0 do i = 1, n if(v(i).ne.0) k = k + 1 end do |
All forms of the MIN and MAX function are recognized.