Next: IPARITY_PREFIX(ARRAYDIM, MASK, SEGMENT, Up: Specifications of Library Procedures Previous: IPARITY(ARRAYDIM, MASK)

Description. Computes a bitwise logical exclusive OR reduction along dimension DIM of ARRAY.

Class. Transformational function.

Arguments.

ARRAY must be of type integer. It must not be scalar.

DIM (optional) must be scalar and of type integer with a value in the range 1 < DIM < n, where n is the rank of ARRAY. The corresponding actual argument must not be an optional dummy argument.

MASK (optional) must be of type logical and must be conformable with ARRAY.

Result Type, Type Parameter, and Shape. The result is of type integer with the same kind type parameter as ARRAY. It is scalar if DIM is absent or if ARRAY has rank one; otherwise, the result is an array of rank n-1 and shape (d1,d2,...,dDIM-1,dDIM+1,...,dn) where(d1,d2,...,dn) is the shape of ARRAY.

Result Value.

Case (i): The result of IPARITY(ARRAY) is the IEOR reduction of all the elements of ARRAY. If ARRAY has size zero, the result has the value zero. See Section 7.4.3.

Case (ii): The result of IPARITY(ARRAY, MASK=MASK) is the IEOR reduction of all the elements of ARRAY corresponding to the true elements of MASK; if MASK contains no true elements, the result is zero.

Case (iii): If ARRAY has rank one, IPARITY(ARRAY, DIM [,MASK]) has a value equal to that of IPARITY(ARRAY [,MASK]). Otherwise, the value of element (s1,s2,...,sDIM-1,sDIM+1,...,sn) of IPARITY(ARRAY, DIM [,MASK]) is equal to IPARITY(ARRAY(s1,s2,...,sDIM-1,:,sDIM+1,...,sn) [,MASK = MASK(s1,s2,...,sDIM-1,:,sDIM+1,...,sn)])
Examples.

Case (i): The value of IPARITY((/13, 8, 3, 2/)) is 4.

Case (ii): The value of IPARITY(C, MASK = BTEST(C,0)) is the IEOR reduction of the odd elements of C.

Case (iii):

```                  /       \
If B is the array | 2 3 7 |
| 0 4 2 |
\       /
```
IPARITY(B, DIM = 1) is [2 7 5] and IPARITY(B, DIM = 2) is [6 6].

Next: IPARITY_PREFIX(ARRAYDIM, MASK, SEGMENT, Up: Specifications of Library Procedures Previous: IPARITY(ARRAYDIM, MASK)