RESHAPE(3I) Last changed: 1698
RESHAPE  Constructs an array of a specified shape
RESHAPE ([SOURCE=]source, [SHAPE=]shape [,[PAD=]pad] [,[ORDER=]order])
UNICOS, UNICOS/mk, and IRIX systems
Fortran 90
The RESHAPE intrinsic function constructs an array of a specified
shape from the elements of a given array. It accepts the following
arguments:
source May be of any type. It must be array valued. If pad is
absent or of size zero, the size of source must be greater
than or equal to PRODUCT(shape). The size of the result is
the product of the values of the elements of shape.
shape Must be an integer, of rank one, and of constant size. Its
size must be positive and less than 8. It must not have an
element whose value is negative.
pad Must be of the same type as source. It must be array
valued.
order Must be of type integer. It must have the same shape as
shape, and its value must be a permutation of (1,2,...,n),
where n is the size of shape. If absent, the default order
is (1,2,...,n).
RESHAPE is a transformational function. The name of this intrinsic
cannot be passed as an argument.
The type of the result is the same type as source. The result is an
array of shape shape, that is, SHAPE(RESHAPE(source,shape,pad,order))
is equal to shape.
The elements of the result, taken in permuted subscript order
order(1), ..., order(n), are those of source in normal array element
order followed, if necessary, by those of pad in array element order,
followed, if necessary, by additional copies of pad in array element
order.
Example 1: RESHAPE((/1,2,3,4,5,6/), (/2,3/)) has the following value:
 1 3 5 
 2 4 6 
Example 2: RESHAPE((/1,2,3,4,5,6,7,8,9/), (/3,4/), (/0,0/)) has the
following value:
 1 4 7 0 
 2 5 8 0 
 3 6 9 0 
Example 3: RESHAPE((/1,2,3,4,5,6/), (/2,4/), (/0,0/), (/2,1/)) has
the following value:
 1 2 3 4 
 5 6 0 0 
Intrinsic Procedures Reference Manual, publication SR2138, for the
printed version of this man page.
RESHAPE(3I) Last changed: 1698
RESHAPE  Constructs an array of a specified shape
RESHAPE ([SOURCE=]source, [SHAPE=]shape [,[PAD=]pad] [,[ORDER=]order])
UNICOS, UNICOS/mk, and IRIX systems
Fortran 90
The RESHAPE intrinsic function constructs an array of a specified
shape from the elements of a given array. It accepts the following
arguments:
source May be of any type. It must be array valued. If pad is
absent or of size zero, the size of source must be greater
than or equal to PRODUCT(shape). The size of the result is
the product of the values of the elements of shape.
shape Must be an integer, of rank one, and of constant size. Its
size must be positive and less than 8. It must not have an
element whose value is negative.
pad Must be of the same type as source. It must be array
valued.
order Must be of type integer. It must have the same shape as
shape, and its value must be a permutation of (1,2,...,n),
where n is the size of shape. If absent, the default order
is (1,2,...,n).
RESHAPE is a transformational function. The name of this intrinsic
cannot be passed as an argument.
The type of the result is the same type as source. The result is an
array of shape shape, that is, SHAPE(RESHAPE(source,shape,pad,order))
is equal to shape.
The elements of the result, taken in permuted subscript order
order(1), ..., order(n), are those of source in normal array element
order followed, if necessary, by those of pad in array element order,
followed, if necessary, by additional copies of pad in array element
order.
Example 1: RESHAPE((/1,2,3,4,5,6/), (/2,3/)) has the following value:
 1 3 5 
 2 4 6 
Example 2: RESHAPE((/1,2,3,4,5,6,7,8,9/), (/3,4/), (/0,0/)) has the
following value:
 1 4 7 0 
 2 5 8 0 
 3 6 9 0 
Example 3: RESHAPE((/1,2,3,4,5,6/), (/2,4/), (/0,0/), (/2,1/)) has
the following value:
 1 2 3 4 
 5 6 0 0 
Intrinsic Procedures Reference Manual, publication SR2138, for the
printed version of this man page.
[ Back ]
