Clicky

Fortran Wiki
spread (Rev #1, changes)

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

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

Description

Replicates a source array ncopies times along a specified dimension dim.

Standard

Fortran 95 and later

Class

Transformational function

Syntax

result = spread(source, dim, ncopies)

Arguments

  • source - Shall be a scalar or an array of any type and a rank less than seven.
  • dim - Shall be a scalar of type integer with a value in the range from 1 to n+1, where n equals the rank of source.
  • ncopies - Shall be a scalar of type integer.

Return value

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

Example

program test_spread
 integer :: a = 1, b(2) = (/ 1, 2 /)
 write(*,*) spread(a, 1, 2) ! "1 1"
 write(*,*) spread(b, 1, 2) ! "1 1 2 2"
end program

See also

unpack

category: Intrinsics

Revision from April 26, 2009 19:28:40 by Jason Blevins
Forward in time (to current) | See current | History | Rollback | View: Source | Linked from: Intrinsic procedures, unpack

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