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

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

Contents


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

NAME    [Toc]    [Back]

     SPREAD - Constructs an array from several copies of an actual argument

SYNOPSIS    [Toc]    [Back]

     SPREAD ([SOURCE=]source, [DIM=]dim, [NCOPIES=]ncopies)

IMPLEMENTATION    [Toc]    [Back]

     UNICOS, UNICOS/mk,	and IRIX systems

STANDARDS    [Toc]    [Back]

     Fortran 90

DESCRIPTION    [Toc]    [Back]

     The SPREAD	intrinsic function constructs an array from several copies
     of	an actual argument.  This intrinsic function can be used for array
     construction.  It replicates an array by adding a dimension.  It
     broadcasts	several	copies of source along a specified dimension and
     thus forms	an array of rank one greater.  SPREAD accepts the following
     arguments:

     source    May be of any type.  It may be scalar or	array valued.  The
	       rank of source must be less than	7.

     dim       Must be scalar and an integer with value	in the range of
	       1 <= dim	<= n + 1, where	n is the rank of source.  This
	       function	does a check on	dim.

     ncopies   Must be scalar and an integer.

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

RETURN VALUES    [Toc]    [Back]

     The result	is an array of the same	type as	source and of rank n+1,
     where n is	the rank of source.

     If	source is scalar, the shape of the result is MAX(ncopies,0).  If
     source is array valued with shape
     (d	, d , ..., d ),
       1   2	    n
     the shape of the result is
     (d	, d , ..., d	 , MAX(ncopies,	0), d	, ..., d ).
       1   2	    dim-1		     dim	n

     If	source is scalar, each element of the result has a value equal to
     source.

     If	source is array	valued,	the element of the result with subscripts
     (r	, r , ..., r   )
       1   2	    n+1
     has the value
     source(r ,	r , ..., r     , r     , ..., r	  )).
	     1	 2	  dim-1	  dim+1	       n+1

EXAMPLES    [Toc]    [Back]

     Example 1:	 Assume	that ISCALR is the scalar value	of 8.  The
     following statements are then true:

     * The value of SPREAD( ISCALR, DIM	= 1, NCOPIES = 0) is a zero-sized
       array.

     * The value of SPREAD( ISCALR, DIM	= 1, NCOPIES = 2) is [8, 8].

     Example 2:	 Assume	that A is the array [2,	3, 4].	The following
     statements	are then true:

     * The value of SPREAD( A, DIM = 1,	NCOPIES	= 0 ) is a zero-sized
       array.

     * The value of SPREAD( A, DIM = 1,	NCOPIES	= 3 ) is as follows:

	| 2 3 4	|

	| 2 3 4	|

	| 2 3 4	|

     * The value of SPREAD( A, DIM = 2,	NCOPIES	= 3 ) is as follows:

	| 2 2 2	|

	| 3 3 3	|

	| 4 4 4	|

SEE ALSO    [Toc]    [Back]

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

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

NAME    [Toc]    [Back]

     SPREAD - Constructs an array from several copies of an actual argument

SYNOPSIS    [Toc]    [Back]

     SPREAD ([SOURCE=]source, [DIM=]dim, [NCOPIES=]ncopies)

IMPLEMENTATION    [Toc]    [Back]

     UNICOS, UNICOS/mk,	and IRIX systems

STANDARDS    [Toc]    [Back]

     Fortran 90

DESCRIPTION    [Toc]    [Back]

     The SPREAD	intrinsic function constructs an array from several copies
     of	an actual argument.  This intrinsic function can be used for array
     construction.  It replicates an array by adding a dimension.  It
     broadcasts	several	copies of source along a specified dimension and
     thus forms	an array of rank one greater.  SPREAD accepts the following
     arguments:

     source    May be of any type.  It may be scalar or	array valued.  The
	       rank of source must be less than	7.

     dim       Must be scalar and an integer with value	in the range of
	       1 <= dim	<= n + 1, where	n is the rank of source.  This
	       function	does a check on	dim.

     ncopies   Must be scalar and an integer.

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

RETURN VALUES    [Toc]    [Back]

     The result	is an array of the same	type as	source and of rank n+1,
     where n is	the rank of source.

     If	source is scalar, the shape of the result is MAX(ncopies,0).  If
     source is array valued with shape
     (d	, d , ..., d ),
       1   2	    n
     the shape of the result is
     (d	, d , ..., d	 , MAX(ncopies,	0), d	, ..., d ).
       1   2	    dim-1		     dim	n

     If	source is scalar, each element of the result has a value equal to
     source.

     If	source is array	valued,	the element of the result with subscripts
     (r	, r , ..., r   )
       1   2	    n+1
     has the value
     source(r ,	r , ..., r     , r     , ..., r	  )).
	     1	 2	  dim-1	  dim+1	       n+1

EXAMPLES    [Toc]    [Back]

     Example 1:	 Assume	that ISCALR is the scalar value	of 8.  The
     following statements are then true:

     * The value of SPREAD( ISCALR, DIM	= 1, NCOPIES = 0) is a zero-sized
       array.

     * The value of SPREAD( ISCALR, DIM	= 1, NCOPIES = 2) is [8, 8].

     Example 2:	 Assume	that A is the array [2,	3, 4].	The following
     statements	are then true:

     * The value of SPREAD( A, DIM = 1,	NCOPIES	= 0 ) is a zero-sized
       array.

     * The value of SPREAD( A, DIM = 1,	NCOPIES	= 3 ) is as follows:

	| 2 3 4	|

	| 2 3 4	|

	| 2 3 4	|

     * The value of SPREAD( A, DIM = 2,	NCOPIES	= 3 ) is as follows:

	| 2 2 2	|

	| 3 3 3	|

	| 4 4 4	|

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
xargs Tru64 Constructs argument lists and runs commands
reshape IRIX Constructs an array of a specified shape
tt_message_arg_bval HP-UX retrieve the byte-array value of a message argument
tt_message_arg_bval_set HP-UX set the byte-array value and type of a message argument
dmColorConvert IRIX performs the actual image conversion.
transfer IRIX Treats the first argument as if it is of the same type as the second argument
deroff IRIX remove nroff, troff, tbl and eqn constructs
newfs Tru64 Constructs a new UFS file system
mfs Tru64 Constructs a new UFS file system
deroff HP-UX remove nroff, tbl, and neqn constructs
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service