Clicky

Fortran Wiki
reshape (changes)

Skip the Navigation Links | Home Page | All Pages | Recently Revised | Authors | Feeds | Export |

Showing changes from revision #1 to #2: (追記) Added (追記ここまで) | (削除) Removed (削除ここまで) | (削除) Chan (削除ここまで)(追記) ged (追記ここまで)

Description

Reshapes source to correspond to shape. If necessary, the new array may be padded with elements from pad or permuted as defined by order.

Standard

(削除) Fortran 95 and later (削除ここまで)(追記) Fortran 95 (追記ここまで)(追記) and later (追記ここまで)

Class

Transformational function

Syntax

result = reshape(source, shape[, pad, order])

Arguments

  • source - Shall be an array of any type.
  • shape - Shall be of type integer and an array of rank one. Its values must be positive or zero.
  • pad - (Optional) shall be an array of the same type as source.
  • order - (Optional) shall be of type integer and an array of the same shape as shape. Its values shall be a permutation of the numbers from 1 to n, where n is the size of shape. If order is absent, the natural ordering shall be assumed.

Return value

The result is an array of shape shape with the same type as source.

Example

program test_reshape
 integer, dimension(4) :: x
 write(*,*) shape(x) ! prints "4"
 write(*,*) shape(reshape(x, (/2, 2/))) ! prints "2 2"
end program

See also

shape

category: (削除) Intrinsics (削除ここまで)(追記) intrinsics (追記ここまで)

Revised on April 30, 2009 20:12:36 by Jason Blevins (71.70.142.190) (1146 characters / 0.0 pages)
Edit | Back in time (1 revision) | Hide changes | History | Views: Print | TeX | Source | Linked from: Intrinsic procedures, shape, size

AltStyle によって変換されたページ (->オリジナル) /