Clicky

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

all(mask [, dim]) determines if all the values are true in mask in the array along dimension dim.

Standard

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

Class

Transformational function

Syntax

result = all(mask [, dim])

Arguments

  • mask - the type of the argument shall be logical and it shall not be scalar.
  • dim - (optional) dim shall be a scalar integer with a value that lies between one and the rank of mask.

Return value

all(mask) returns a scalar value of type logical where the kind type parameter is the same as the kind type parameter of mask. If dim is present, then all(mask, dim) returns an array with the rank of mask minus 1. The shape is determined from the shape of mask where the dim dimension is elided.

  1. all(mask) is true if all elements of mask are true. It also is true if mask has zero size; otherwise, it is false.

  2. If the rank of mask is one, then all(mask, dim) is equivalent to all(mask). If the rank is greater than one, then all(mask, dim) is determined by applying all to the array sections.

Example

program test_all
 logical l
 l = all((/.true., .true., .true./))
 print *, l
 call section
 contains
 subroutine section
 integer a(2,3), b(2,3)
 a = 1
 b = 1
 b(2,2) = 2
 print *, all(a .eq. b, 1)
 print *, all(a .eq. b, 2)
 end subroutine section
end program test_all

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

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

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