ALL(MASK, DIM)

Purpose

Determines if all values in an entire array, or in each vector along a single dimension, are true.

Class

Transformational function

Argument type and attributes

MASK
is a logical array.
DIM (optional)
is an integer scalar in the range 1 ≤ DIM ≤ rank(MASK). The corresponding actual argument must not be an optional dummy argument.

Result value

The result is a logical array with the same type parameters as MASK. The rank of the result is rank(MASK)-1 if the DIM is specified; otherwise the result is a scaler of type logical.

The shape of the result is (s1, s2, …, s(DIM-1), s(DIM+1), …, sn), where n is the rank of MASK.

Each element in the result array is .TRUE. only if all the elements given by MASK(m1, m2, …, m(DIM-1), :, m(DIM+1), …, mn), are true. When the result is a scalar, either because DIM is not specified or because MASK is of rank one, it is .TRUE. only if all elements of MASK are true, or MASK has size zero.

Examples

! A is the array | 4 3 6 |, and B is the array | 3 5 2 |
!                | 2 4 1 |                     | 7 8 4 |

! Is every element in A less than the
! corresponding one in B?
      RES = ALL(A .LT. B)          ! result RES is false

! Are all elements in each column of A less than the
! corresponding column of B?
      RES = ALL(A .LT. B, DIM = 1) ! result RES is (f,t,f)

! Same question, but for each row of A and B.
      RES = ALL(A .LT. B, DIM = 2) ! result RES is (f,t)