PACK man page on IRIX

Man page or keyword search:  
man Server   31559 pages
apropos Keyword Search (all sections)
Output format
IRIX logo
[printable version]

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

NAME
     PACK - Packs an array into an array of rank one under control of a
     mask

SYNOPSIS
     PACK ([ARRAY=]array, [MASK=]mask [,[VECTOR=]vector])

IMPLEMENTATION
     UNICOS, UNICOS/mk, and IRIX systems

STANDARDS
     Fortran 90

DESCRIPTION
     The PACK intrinsic function packs an array into an array of rank one
     under control of a mask.  It can be used for array construction.  It
     accepts the following arguments:

     array     Can be of any type.  It must not be scalar.

     mask      Must be of type logical and must be conformable with array.

     vector    Must be of the same type as array and must have rank one.
	       vector must have at least as many elements as there are true
	       elements in mask.  If mask is scalar with the value true,
	       vector must have at least as many elements as there are in
	       array.

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

RETURN VALUES
     The result is an array of rank one of the same type as array.  If
     vector is present, the result size is that of vector; otherwise, the
     result size is the number t of true elements in mask unless mask is
     scalar with the value true in which case the result size is the size
     of array.

     Element i of the result is the element of array that corresponds to
     the ith true element of mask, taking elements in array element order,
     for i=1, 2, ..., t.  If vector is present and has size n>t, element i
     of the result has the value vector(i), for i=t+1, ..., n.

EXAMPLES
     Example 1:	 If N = (/ 1, -1, 3 /), the following are true:

	  PACK( N, MASK=N.LT.0) is [-1].

	  PACK( N, MASK=.TRUE.) is [1, -1, 3].

     Example 2:	 Array M is as follows:

	| 0 0 0 |

	| 9 0 0 |

	| 0 0 7 |

     The nonzero elements of array M can be gathered by the PACK function.
     The following are the results:

	  PACK(M, MASK=M.NE.0) is [9, 7].

	  PACK(M, MASK=M.NE.0, VECTOR=(/2, 4, 6, 8, 10, 12/)) is [9, 7, 6,
	  8, 10 12].

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

[top]

List of man pages available for IRIX

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net