Reduction intrinsic functions

Standard: F77 F90 F95 F2003 F2008 F2018


<Syntax>

ALL ( MASK [ , DIM ] )
ANY ( MASK [ , DIM ] )
COUNT ( MASK [ , DIM , KIND ] )
FINDLOC ( ARRAY, VALUE [ , MASK, KIND, BACK ] )
FINDLOC ( ARRAY, VALUE, DIM [ , MASK, KIND, BACK ] )
IALL ( ARRAY [ , DIM , MASK ] )
IANY ( ARRAY [ , DIM , MASK ] )
IPARITY ( ARRAY [ , DIM , MASK ] )
MAXLOC ( ARRAY [ , MASK , KIND , BACK ] )
MAXLOC ( ARRAY, DIM [ , MASK , KIND , BACK ] )
MAXVAL ( ARRAY [ , MASK ] )
MAXVAL ( ARRAY, DIM [ , MASK ] )
MINLOC ( ARRAY [ , MASK , KIND , BACK ] )
MINLOC ( ARRAY, DIM [ , MASK , KIND , BACK ] )
MINVAL ( ARRAY [ , MASK ] )
MINVAL ( ARRAY, DIM [ , MASK ] )
PARITY ( MASK [ , DIM ] )
PRODUCT ( ARRAY [ , MASK ] )
PRODUCT ( ARRAY, DIM [ , MASK ] )
SUM ( ARRAY [ , MASK ] )
SUM ( ARRAY, DIM [ , MASK ] )

<Semantics>

The reduction intrinsic functions collapse an array using the specified operation to combine elements.

If an optional MASK is present, only the elements corresponding to true elements of the mask are combined.

If DIM is not present, the array is completely collapsed (i.e. every element is combined), returning a scalar value (except for FINDLOC, MAXLOC and MINLOC, which return a location vector of size equal to the rank of ARRAY).

If DIM is present, only that dimension is collapsed; the result has rank 1 less than ARRAY (or MASK), thus reducing shape [ s1, ... sDIM−1, sDIM, sDIM+1, ..., srank ] to [ s1, ... sDIM−1, sDIM+1, ..., srank ]; the value of each element in the result is obtained by combining the corresponding values in the collapsed dimension. Note that a rank 0 result is scalar.

<Related>

ALL intrinsic function, ANY intrinsic function, COUNT intrinsic function, FINDLOC intrinsic function, IALL intrinsic function, IANY intrinsic function, IPARITY intrinsic function, MAXLOC intrinsic function, MAXVAL intrinsic function, MINLOC intrinsic function, MINVAL intrinsic function, PARITY intrinsic function, PRODUCT intrinsic function, SUM intrinsic function,