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

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

Contents


COUNT(3I)					       Last changed: 1-6-98

NAME    [Toc]    [Back]

     COUNT - Counts the	number of true array elements

SYNOPSIS    [Toc]    [Back]

     COUNT ([MASK=]mask	[,[DIM=]dim])

IMPLEMENTATION    [Toc]    [Back]

     UNICOS, UNICOS/mk,	and IRIX systems

STANDARDS    [Toc]    [Back]

     Fortran 90

DESCRIPTION    [Toc]    [Back]

     The COUNT intrinsic function counts the number of true array elements
     of	argument mask along dimension dim.  It accepts the following
     arguments:

     mask      Must be of type logical.	 It must not be	a scalar.

     dim       Must be a scalar.  It is	an integer with	a value	in the
	       range 1 <= dim <= n, where n is the rank	of mask.  The
	       corresponding actual argument must not be an optional dummy
	       argument.  This function	does a check on	dim when present.

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

RETURN VALUES    [Toc]    [Back]

     The result	is type	integer.  It is	a scalar result	if dim is absent or
     if	mask has rank 1.  Otherwise, the result	is an array of rank n-1	and
     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 mask.

     The result	of COUNT(mask) has a value equal to the	number of TRUE
     elements of mask or has the value 0 if mask is a zero-sized array.

     If	mask has rank 1, COUNT(mask, dim) has a	value equal to that of
     COUNT(mask).  Otherwise, the value	of

     element (s	, s , ..., s	 , s	 , ...,	s )
	       1   2	    dim-1   dim+1	 n
     of	COUNT(mask, dim) is equal to
     COUNT(MASK	(s , s , ..., s	    , :	, s	, ..., s )).
		  1   2	       dim-1	   dim+1	n

EXAMPLES    [Toc]    [Back]

     Example 1:

     * COUNT( (/ .TRUE., .FALSE., .TRUE. /) ) is 2.

     * COUNT(mask) returns zero	when mask is a zero-sized array.

     Example 2:	 Assume	that B is the following	array:

	| 1 3 5	|

	| 2 4 6	|

     C is the following	array:

	| 0 3 5	|

	| 7 4 8	|

     * COUNT( B	.NE. C)	is 3

     * COUNT( B	.NE. C,	DIM=1) is [2, 0, 1]

     * COUNT( B	.NE. C,	DIM=2) is [1, 2]

     * COUNT( C	.EQ. 1)	returns	zero because there are no true elements	in
       the mask.

     Example 3:	 Assume	that array N is	as follows:

	| 0 1 2	3 |

	| 4 5 6	7 |

	| 8 9 0	1 |

     In	an array section reference, you	can expect the following results:

     * COUNT((N(2:3,2:4).NE.0))	is 5

     * COUNT((N(2:3,2:4).NE.0),DIM=1) is [2, 1,	2]

     * COUNT((N(2:3,2:4).NE.0),DIM=2) is [3, 2]

SEE ALSO    [Toc]    [Back]

      
      
     Intrinsic Procedures Reference Manual, publication	SR-2138, for the
     printed version of	this man page.

COUNT(3I)					       Last changed: 1-6-98

NAME    [Toc]    [Back]

     COUNT - Counts the	number of true array elements

SYNOPSIS    [Toc]    [Back]

     COUNT ([MASK=]mask	[,[DIM=]dim])

IMPLEMENTATION    [Toc]    [Back]

     UNICOS, UNICOS/mk,	and IRIX systems

STANDARDS    [Toc]    [Back]

     Fortran 90

DESCRIPTION    [Toc]    [Back]

     The COUNT intrinsic function counts the number of true array elements
     of	argument mask along dimension dim.  It accepts the following
     arguments:

     mask      Must be of type logical.	 It must not be	a scalar.

     dim       Must be a scalar.  It is	an integer with	a value	in the
	       range 1 <= dim <= n, where n is the rank	of mask.  The
	       corresponding actual argument must not be an optional dummy
	       argument.  This function	does a check on	dim when present.

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

RETURN VALUES    [Toc]    [Back]

     The result	is type	integer.  It is	a scalar result	if dim is absent or
     if	mask has rank 1.  Otherwise, the result	is an array of rank n-1	and
     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 mask.

     The result	of COUNT(mask) has a value equal to the	number of TRUE
     elements of mask or has the value 0 if mask is a zero-sized array.

     If	mask has rank 1, COUNT(mask, dim) has a	value equal to that of
     COUNT(mask).  Otherwise, the value	of

     element (s	, s , ..., s	 , s	 , ...,	s )
	       1   2	    dim-1   dim+1	 n
     of	COUNT(mask, dim) is equal to
     COUNT(MASK	(s , s , ..., s	    , :	, s	, ..., s )).
		  1   2	       dim-1	   dim+1	n

EXAMPLES    [Toc]    [Back]

     Example 1:

     * COUNT( (/ .TRUE., .FALSE., .TRUE. /) ) is 2.

     * COUNT(mask) returns zero	when mask is a zero-sized array.

     Example 2:	 Assume	that B is the following	array:

	| 1 3 5	|

	| 2 4 6	|

     C is the following	array:

	| 0 3 5	|

	| 7 4 8	|

     * COUNT( B	.NE. C)	is 3

     * COUNT( B	.NE. C,	DIM=1) is [2, 0, 1]

     * COUNT( B	.NE. C,	DIM=2) is [1, 2]

     * COUNT( C	.EQ. 1)	returns	zero because there are no true elements	in
       the mask.

     Example 3:	 Assume	that array N is	as follows:

	| 0 1 2	3 |

	| 4 5 6	7 |

	| 8 9 0	1 |

     In	an array section reference, you	can expect the following results:

     * COUNT((N(2:3,2:4).NE.0))	is 5

     * COUNT((N(2:3,2:4).NE.0),DIM=1) is [2, 1,	2]

     * COUNT((N(2:3,2:4).NE.0),DIM=2) is [3, 2]

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
size IRIX Returns the total number of elements in an array
popcnt IRIX Counts number of set bits
leadz IRIX Counts number of leading 0 bits
XmTabListTabCount HP-UX A convenience function that counts the number of tabs
sum IRIX Sums array elements
glarrayelementext IRIX specify the array elements used to render a vertex
product IRIX Forms the product of array elements
slaed4 IRIX rank-one modification to a diagonal matrix whose elements are given in the array d, and that D(i) < D(j) for i
dlaed4 IRIX rank-one modification to a diagonal matrix whose elements are given in the array d, and that D(i) < D(j) for i
llength IRIX Count the number of elements in a list
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service