csmg
- Date:
10-12-2011
NAME
CSMG - Performs a conditional scalar merge
SYNOPSIS
CSMG ([I=]i, [J=]j, [K=]k)
IMPLEMENTATION
Cray Linux Environment (CLE)
STANDARDS
Fortran extension
DESCRIPTION
The CSMG intrinsic function merges i and j, controlled by the bit mask in k. When a 1 bit appears in k, the corresponding bit of i becomes the corresponding bit of the result. When a 0 bit appears in k, the corresponding bit of j is taken. Therefore, CSMG(i, j, k) equals the following specification:
(i .AND. k) .OR. (j .AND. .NOT. k)
The CSMG function accepts the following arguments:
- i
First item to be merged. Can be of Boolean, integer, real, or Cray pointer type. Must be the same length as j and k.
- j
Second item to be merged. Can be of Boolean, integer, real, or Cray pointer type. Must be the same length as i and k.
- k
Bit mask. Can be of Boolean, integer, real, or Cray pointer type. Must be the same length as i and j.
CSMG is an elemental function. The name of this intrinsic cannot be passed as an argument.
NOTES
The CSMG intrinsic function is outmoded. Refer to the Cray Fortran Reference Manual for information on outmoded features and their preferred standard alternatives.
RETURN VALUES
The return value is of type Boolean.
EXAMPLES
Example 1: Specifying CSMG(i,j,MASK(64)) or CSMG(i,j,-1) yields i.
Example 2: CSMG(i,j,0) yields j.
Example 3: Specifying the conditional scalar merge CSMG(‘ABCDEFGH’H,’12345678’H,X’0000FFFFFF0000FF’) yields ‘12CDE67H’H as the result.