fortran中minloc什么意思

如题所述

第1个回答  2012-07-24
MINLOC — Location of the minimum value within an array
Description:Determines the location of the element in the array with the minimum value, or, if the DIM argument is supplied, determines the locations of the minimum element along each row of the array in the DIM direction. If MASK is present, only the elements for which MASK is .TRUE. are considered. If more than one element in the array has the minimum value, the location returned is that of the first such element in array element order. If the array has zero size, or all of the elements of MASK are .FALSE., then the result is an array of zeroes. Similarly, if DIM is supplied and all of the elements of MASK along a given row are zero, the result value for that row is zero.
Standard:Fortran 95 and later
Class:Transformational function
Syntax:
RESULT = MINLOC(ARRAY, DIM [, MASK])
RESULT = MINLOC(ARRAY [, MASK])
Arguments:
ARRAY Shall be an array of type INTEGER or REAL.
DIM (Optional) Shall be a scalar of type INTEGER, with a value between one and the rank of ARRAY, inclusive. It may not be an optional dummy argument.
MASK Shall be an array of type LOGICAL, and conformable with ARRAY.
Return value:If DIM is absent, the result is a rank-one array with a length equal to the rank of ARRAY. If DIM is present, the result is an array with a rank one less than the rank of ARRAY, and a size corresponding to the size of ARRAY with the DIM dimension removed. If DIM is present and ARRAY has a rank of one, the result is a scalar. In all cases, the result is of default INTEGER type.本回答被网友采纳
第2个回答  2011-04-11
Transformational Intrinsic Function (Generic): Returns the location of the minimum value of all elements in an array, a set of elements in an array, or elements in a specified dimension of an array.

Syntax

result = MINLOC (array [, dim] [, mask] )

array
(Input) Must be an array of type integer or real.

dim
(Optional; input) Must be a scalar integer with a value in the range 1 to n, where n is the rank of array. This argument is a Fortran 95 feature.

mask
(Optional; input) Must be a logical array that is conformable with array.

Results:

The result is an array of type default integer.

The following rules apply if dim is omitted:
相似回答