IPARITY(3) - [BIT:LOGICAL] Bitwise exclusive OR of array elements
result = iparity( array [,mask] ) | iparity( array, dim [,mask] )
integer(kind=KIND) function iparity(array, dim, mask )integer(kind=KIND),intent(in) :: array(..) logical(kind=**),intent(in),optional :: dim logical(kind=**),intent(in),optional :: mask(..)
o |
ARRAY - An integer array.
| ||||
IPARITY(3) reduces with bitwise xor (exclusive or) the elements of ARRAY along dimension DIM if the corresponding element in MASK is .true..
o ARRAY : an array of integer values o DIM : a value from 1 to the rank of ARRAY. o MASK : a logical mask either a scalar or an array of the same shape as ARRAY.
The result is of the same type as ARRAY.
If DIM is absent, a scalar with the bitwise xor of all elements in ARRAY is returned. Otherwise, an array of rank N-1, where N equals the rank of ARRAY, and a shape similar to that of ARRAY with dimension DIM dropped is returned.
Case (i) : The result of IPARITY (ARRAY) has a value equal to the bitwise exclusive OR of all the elements of ARRAY. If ARRAY has size zero the result has the value zero.
Case (ii) : The result of IPARITY (ARRAY, MASK=MASK) has a value equal to that of
IPARITY (PACK (ARRAY, MASK)).Case (iii) : The result of IPARITY (ARRAY, DIM=DIM [, MASK=MASK]) has a value equal to that of IPARITY (ARRAY [, MASK=MASK]) if ARRAY has rank one.
Otherwise, an array of values reduced along the dimension DIM is returned.
Sample program:
program demo_iparity implicit none integer, dimension(2) :: a a(1) = int(b00100100) a(2) = int(b01101010) print (b8.8), iparity(a) end program demo_iparityResults:
> 01001110
Fortran 2008
IANY(3), IALL(3), IEOR(3), PARITY(3)
Fortran intrinsic descriptions
Nemo Release 3.1 | iparity (3fortran) | November 02, 2024 |