Clicky

Fortran Wiki
spread (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

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

Standard

(削除) Fortran 95 and later (削除ここまで)(追記) 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 (削除ここまで)(追記) intrinsics (追記ここまで)

Revised on April 30, 2009 17:34:58 by Jason Blevins (71.70.142.190) (895 characters / 0.0 pages)
Edit | Back in time (1 revision) | Hide changes | History | Views: Print | TeX | Source | Linked from: Intrinsic procedures, unpack

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