next up previous contents
Next: PARITY_PREFIX(MASKDIM, SEGMENT, EXCLUSIVE) Up: Specifications of Library Procedures Previous: PARITY(MASKDIM)

PARITY(MASK, DIM)

Optional Argument. DIM

Description. Determine whether an odd number of values are true in MASK along dimension DIM.

Class. Transformational function.

Arguments.

MASK must be of type logical. 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 MASK. The corresponding actual argument must not be an optional dummy argument.

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

Result Value.

Case (i): The result of PARITY(MASK) is the .NEQV. reduction of all the elements of MASK. If MASK has size zero, the result has the value false. See Section 7.4.3.

Case (ii): If MASK has rank one, PARITY(MASK, DIM) has a value equal to that of PARITY(MASK). Otherwise, the value of element (s1,s2,...,sDIM-1,sDIM+1,...,sn) of PARITY(MASK, DIM) is equal to
PARITY(MASK(s1,s2,...,sDIM-1,:,sDIM+1,...,sn))
Examples.

Case (i): The value of PARITY((/T, T, T, F/)) is true.

Case (ii):

                  /       \
If B is the array | T T F |
                  | T T T |
                  \       /
PARITY(B, DIM = 1) is [F F T] and PARITY(B, DIM = 2) is [F T].


next up previous contents
Next: PARITY_PREFIX(MASKDIM, SEGMENT, EXCLUSIVE) Up: Specifications of Library Procedures Previous: PARITY(MASKDIM)