CUDA
C/C++    Fortran   

Test if any / all true

Test if any / all elements in the array are true. More...

Data Types

interface  anytrue
 Find if any element in an array is true, along a given dimension. More...
interface  alltrue
 Find if all elements in an array are true, along a given dimension. More...

type(array) array_anytrue (A, d)
 Any of elements in a matrix.

type(array) array_alltrue (A, d)
 All of elements in a matrix.

Detailed Description

Test if any / all elements in the array are true.

 type(array) A, an, al
 ! Generate random system
 A  = randu(5,5)
 an = anytrue(A >= 1.0) ! Check if any elment is greater than 1.0
 al = alltrue(A >= 0.0) ! Check if all elements are greater than 0.0

Function/Subroutine Documentation

type(array) array_anytrue ( type(array),intent(in)  A,
integer,intent(in),optional  d 
) [inherited]

Any of elements in a matrix.

type(array) array_alltrue ( type(array),intent(in)  A,
integer,intent(in),optional  d 
) [inherited]

All of elements in a matrix.