PRODUCT(3I) Last changed: 1-6-98
PRODUCT - Forms the product of array elements
PRODUCT ([ARRAY=]array [,[DIM=]dim] [,[MASK=]mask])
PRODUCT ([ARRAY=]array [,[MASK=]mask])
UNICOS, UNICOS/mk, and IRIX systems
Fortran 90
The PRODUCT intrinsic function forms the product of all the elements
of array along dimension dim corresponding to the true elements of
mask. It accepts the following arguments:
array Must be of type integer, real, or complex. It must not be
scalar.
dim Must be scalar and of type integer with a value in the range
1 <= dim <= n, where n is the rank of array. The
corresponding actual argument must not be an optional dummy
argument. This function does a check on dim when present.
mask Must be of type logical and must be conformable with array.
PRODUCT is a transformational intrinsic function. The name of this
intrinsic cannot be passed as an argument.
The result has the same type and type parameter as array. The result
is scalar if dim is absent or array has rank one; otherwise, the
result is an array of rank n-1 of shape
(d , d , ..., d , d , ..., d ),
1 2 dim-1 dim+1 n
where (d , d , ..., d )
1 2 n
is the shape of array.
The result of PRODUCT(array) has a value equal to the product of all
the elements of array or has the value 1 if array has size 0.
The result of PRODUCT(array,MASK=mask) has a value equal to the
product of the elements of array corresponding to the true elements of
mask or has the value 1 if there are no true elements.
If array has rank one, PRODUCT(array,dim[,mask]) has a value equal to
that of PRODUCT(array[,MASK=mask]). Otherwise, the value of element
(s , s , ..., s , s , ..., s )
1 2 dim-1 dim+1 n
of PRODUCT(array,dim[,mask]) is equal to
PRODUCT(array (s , s , ..., s , : , s , ..., s ))
1 2 dim-1 dim+1 n
[, MASK=mask (s , s , ..., s , : , s , ..., s )]).
1 2 dim-1 dim+1 n Example 1: The value of PRODUCT((/ 1, 2, 3 /)) is 6.
Example 2: PRODUCT(C, MASK = C .GT. 0.0) forms the product of the
positive elements of C.
Example 3: B is the following array:
| 1 3 5 |
| 2 4 6 |
PRODUCT(B, DIM = 1) is [2, 12, 30], and PRODUCT(B, DIM = 2) is [15,
48].
Intrinsic Procedures Reference Manual, publication SR-2138, for the
printed version of this man page.
PRODUCT(3I) Last changed: 1-6-98
PRODUCT - Forms the product of array elements
PRODUCT ([ARRAY=]array [,[DIM=]dim] [,[MASK=]mask])
PRODUCT ([ARRAY=]array [,[MASK=]mask])
UNICOS, UNICOS/mk, and IRIX systems
Fortran 90
The PRODUCT intrinsic function forms the product of all the elements
of array along dimension dim corresponding to the true elements of
mask. It accepts the following arguments:
array Must be of type integer, real, or complex. It must not be
scalar.
dim Must be scalar and of type integer with a value in the range
1 <= dim <= n, where n is the rank of array. The
corresponding actual argument must not be an optional dummy
argument. This function does a check on dim when present.
mask Must be of type logical and must be conformable with array.
PRODUCT is a transformational intrinsic function. The name of this
intrinsic cannot be passed as an argument.
The result has the same type and type parameter as array. The result
is scalar if dim is absent or array has rank one; otherwise, the
result is an array of rank n-1 of shape
(d , d , ..., d , d , ..., d ),
1 2 dim-1 dim+1 n
where (d , d , ..., d )
1 2 n
is the shape of array.
The result of PRODUCT(array) has a value equal to the product of all
the elements of array or has the value 1 if array has size 0.
The result of PRODUCT(array,MASK=mask) has a value equal to the
product of the elements of array corresponding to the true elements of
mask or has the value 1 if there are no true elements.
If array has rank one, PRODUCT(array,dim[,mask]) has a value equal to
that of PRODUCT(array[,MASK=mask]). Otherwise, the value of element
(s , s , ..., s , s , ..., s )
1 2 dim-1 dim+1 n
of PRODUCT(array,dim[,mask]) is equal to
PRODUCT(array (s , s , ..., s , : , s , ..., s ))
1 2 dim-1 dim+1 n
[, MASK=mask (s , s , ..., s , : , s , ..., s )]).
1 2 dim-1 dim+1 n Example 1: The value of PRODUCT((/ 1, 2, 3 /)) is 6.
Example 2: PRODUCT(C, MASK = C .GT. 0.0) forms the product of the
positive elements of C.
Example 3: B is the following array:
| 1 3 5 |
| 2 4 6 |
PRODUCT(B, DIM = 1) is [2, 12, 30], and PRODUCT(B, DIM = 2) is [15,
48].
Intrinsic Procedures Reference Manual, publication SR-2138, for the
printed version of this man page.
[ Back ]
|