*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->IRIX man pages -> f90/maxloc (3)              
Title
Content
Arch
Section
 

Contents


MAXLOC(3I)					       Last changed: 2-5-98

NAME    [Toc]    [Back]

     MAXLOC - Returns the location of a	maximum	value in an array

SYNOPSIS    [Toc]    [Back]

     MAXLOC ([ARRAY=]array [,[DIM=]dim]	[,[MASK=]mask])

     MAXLOC ([ARRAY=]array [,[MASK=]mask])

IMPLEMENTATION    [Toc]    [Back]

     UNICOS, UNICOS/mk,	and IRIX systems

STANDARDS    [Toc]    [Back]

     Fortran 90

DESCRIPTION    [Toc]    [Back]

     The MAXLOC	intrinsic function returns the location	of the first
     element of	array having the maximum value of the elements identified
     by	mask.  It accepts the following	arguments:

     array     Must be of type integer or real.	 It must not be	scalar.

     dim       Must be a scalar	integer	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.

     MAXLOC is a transformational function.  The name of this intrinsic
     cannot be passed as an argument.

NOTES    [Toc]    [Back]

     On	UNICOS systems,	both execution speed and the number of bits used in
     mathematical operations are affected when compiling with
     f90 -O fastint, which is the default setting.  For	more information,
     see CF90 Commands and Directives Reference	Manual,	publication
     SR-3901.

RETURN VALUES    [Toc]    [Back]

     The result	is an integer of type default integer, of rank one, with
     size equal	to the rank of array.

     The result	of MAXLOC(array) is a rank one array whose element values
     are the values of the subscripts of an element of array whose value
     equals the	maximum	value of all of	the elements of	array.	The ith
     subscript returned	lies in	the range 1 to e , where e  is
						i	  i
     the extent	of the ith dimension of	array.	If more	than one element
     has the maximum value, the	element	whose subscripts are returned is
     the first such element, taken in array element order.  If array has
     size 0, the value of the result is	undefined.

     The result	of MAXLOC(array,MASK=mask) is a	rank one array whose
     element values are	the values of the subscripts of	an element of
     array, corresponding to a true element of mask whose value	equals the
     maximum value of all such elements	of array.  The ith subscript
     returned lies in the range	1 to e , where e  is
				      i		i
     the extent	of the ith dimension of	array.	If more	than one such
     element has the maximum value, the	element	whose subscripts are
     returned is the first such	element	taken in array element order.  If
     there are no such elements	(that is, if array has size 0 or if every
     element of	mask has the value false), the value of	the result is
     undefined.

     If	array has rank one, the	result of
     MAXLOC(array, DIM=dim [, MASK=mask]) is a scalar with a value that	is
     the same as that of the first element of MAXLOC(array [, MASK=mask]).
     Otherwise,	the value of element (s	, s , ..., s	 , s	 , ...,	s )
				       1   2	    dim-1   dim+1	 n
     of	the result is equal to
     MAXLOC(array(s , s	, ..., s     , : , s	 , ...,	s ), DIM=1
		   1   2	dim-1	    dim+1	 n
     [,	MASK=mask(s , s	, ..., s     , : , s	 , ...,	s )]).
		   1   2	dim-1	    dim+1	 n
     An	element	of the result is undefined if the value	cannot be
     represented as an integer.

EXAMPLES    [Toc]    [Back]

     Example 1:	 The value of MAXLOC( (/ 2, 6, 4, 6 /) ) is [2].  If array
     B is declared INTEGER, DIMENSION(4:7) :: B	= (/ 8,	6, 3, 1	/), the
     value of MAXLOC(B)	is [1].

     Example 2:	 Assume	that A is the following	array:

	  | 0 -5  8 -3 |

	  | 3  4 -1  2 |

	  | 1  5  6 -4 |

     The following are true:

	  MAXLOC(A) is [1, 3]

	  MAXLOC(A, MASK=A .LT.	6) is [3, 2]

     Using array section references, the following are true:

	  MAXLOC(A(2:3,2:4)) is	[ 2, 2 ]

	  MAXLOC(A(2:3,2:4),MASK=A(2:3,2:4).LT.6) is [ 2, 1 ]

     Example 3:	 Assume	that B is the following	array:

	  [ 100, 2, 5, 7, 1, 90, 0, 20,	-1, 80 ]

     The following are true of this array:

	  MAXLOC(B(10:1:-1)) is	[ 10 ]

	  MAXLOC(B(10:1:-2)) is	[ 3 ]

     Example 4:	 The value of MAXLOC((/5,-9,3/)DIM=1) is 1.

     Example 5:	 Assume	that C is following array:

	  | 1 3	-9 |

	  | 2 2	 6 |

     The following are true of this array:

	  MAXLOC(C,DIM=1) is [ 2, 1, 2 ]

	  MAXLOC(C,DIM=2) is [ 2, 3 ]

	  MAXLOC(C) is [ 2, 3 ]

SEE ALSO    [Toc]    [Back]

      
      
     Intrinsic Procedures Reference Manual, publication	SR-2138, for the
     printed version of	this man page.
MAXLOC(3I)					       Last changed: 2-5-98

NAME    [Toc]    [Back]

     MAXLOC - Returns the location of a	maximum	value in an array

SYNOPSIS    [Toc]    [Back]

     MAXLOC ([ARRAY=]array [,[DIM=]dim]	[,[MASK=]mask])

     MAXLOC ([ARRAY=]array [,[MASK=]mask])

IMPLEMENTATION    [Toc]    [Back]

     UNICOS, UNICOS/mk,	and IRIX systems

STANDARDS    [Toc]    [Back]

     Fortran 90

DESCRIPTION    [Toc]    [Back]

     The MAXLOC	intrinsic function returns the location	of the first
     element of	array having the maximum value of the elements identified
     by	mask.  It accepts the following	arguments:

     array     Must be of type integer or real.	 It must not be	scalar.

     dim       Must be a scalar	integer	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.

     MAXLOC is a transformational function.  The name of this intrinsic
     cannot be passed as an argument.

NOTES    [Toc]    [Back]

     On	UNICOS systems,	both execution speed and the number of bits used in
     mathematical operations are affected when compiling with
     f90 -O fastint, which is the default setting.  For	more information,
     see CF90 Commands and Directives Reference	Manual,	publication
     SR-3901.

RETURN VALUES    [Toc]    [Back]

     The result	is an integer of type default integer, of rank one, with
     size equal	to the rank of array.

     The result	of MAXLOC(array) is a rank one array whose element values
     are the values of the subscripts of an element of array whose value
     equals the	maximum	value of all of	the elements of	array.	The ith
     subscript returned	lies in	the range 1 to e , where e  is
						i	  i
     the extent	of the ith dimension of	array.	If more	than one element
     has the maximum value, the	element	whose subscripts are returned is
     the first such element, taken in array element order.  If array has
     size 0, the value of the result is	undefined.

     The result	of MAXLOC(array,MASK=mask) is a	rank one array whose
     element values are	the values of the subscripts of	an element of
     array, corresponding to a true element of mask whose value	equals the
     maximum value of all such elements	of array.  The ith subscript
     returned lies in the range	1 to e , where e  is
				      i		i
     the extent	of the ith dimension of	array.	If more	than one such
     element has the maximum value, the	element	whose subscripts are
     returned is the first such	element	taken in array element order.  If
     there are no such elements	(that is, if array has size 0 or if every
     element of	mask has the value false), the value of	the result is
     undefined.

     If	array has rank one, the	result of
     MAXLOC(array, DIM=dim [, MASK=mask]) is a scalar with a value that	is
     the same as that of the first element of MAXLOC(array [, MASK=mask]).
     Otherwise,	the value of element (s	, s , ..., s	 , s	 , ...,	s )
				       1   2	    dim-1   dim+1	 n
     of	the result is equal to
     MAXLOC(array(s , s	, ..., s     , : , s	 , ...,	s ), DIM=1
		   1   2	dim-1	    dim+1	 n
     [,	MASK=mask(s , s	, ..., s     , : , s	 , ...,	s )]).
		   1   2	dim-1	    dim+1	 n
     An	element	of the result is undefined if the value	cannot be
     represented as an integer.

EXAMPLES    [Toc]    [Back]

     Example 1:	 The value of MAXLOC( (/ 2, 6, 4, 6 /) ) is [2].  If array
     B is declared INTEGER, DIMENSION(4:7) :: B	= (/ 8,	6, 3, 1	/), the
     value of MAXLOC(B)	is [1].

     Example 2:	 Assume	that A is the following	array:

	  | 0 -5  8 -3 |

	  | 3  4 -1  2 |

	  | 1  5  6 -4 |

     The following are true:

	  MAXLOC(A) is [1, 3]

	  MAXLOC(A, MASK=A .LT.	6) is [3, 2]

     Using array section references, the following are true:

	  MAXLOC(A(2:3,2:4)) is	[ 2, 2 ]

	  MAXLOC(A(2:3,2:4),MASK=A(2:3,2:4).LT.6) is [ 2, 1 ]

     Example 3:	 Assume	that B is the following	array:

	  [ 100, 2, 5, 7, 1, 90, 0, 20,	-1, 80 ]

     The following are true of this array:

	  MAXLOC(B(10:1:-1)) is	[ 10 ]

	  MAXLOC(B(10:1:-2)) is	[ 3 ]

     Example 4:	 The value of MAXLOC((/5,-9,3/)DIM=1) is 1.

     Example 5:	 Assume	that C is following array:

	  | 1 3	-9 |

	  | 2 2	 6 |

     The following are true of this array:

	  MAXLOC(C,DIM=1) is [ 2, 1, 2 ]

	  MAXLOC(C,DIM=2) is [ 2, 3 ]

	  MAXLOC(C) is [ 2, 3 ]

SEE ALSO    [Toc]    [Back]

      
      
     Intrinsic Procedures Reference Manual, publication	SR-2138, for the
     printed version of	this man page.
[ Back ]
 Similar pages
Name OS Title
minloc IRIX Returns the location of a minimum value in an array
maxval IRIX Returns the maximum value in an array
XmListGetKbdItemPos Tru64 A List function that returns the position of the item at the location cursor
XmListGetKbdItemPos IRIX A List function that returns the position of the item at the location cursor
XmListGetKbdItemPos HP-UX A List function that returns the position of the item at the location cursor
maxexponent IRIX Returns the maximum exponent in the numeric model
minval IRIX Returns the minimum value in an array
sched_get_priority_min Tru64 Returns the maximum or minimum priority for the specified scheduling policy (P1003.1b)
getheight IRIX returns the maximum character height in the current raster font
sched_get_priority_max Tru64 Returns the maximum or minimum priority for the specified scheduling policy (P1003.1b)
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service