The C++ interface for anytrue.
More...
| array | anytrue (const array &input, int dim=-1) |
| | Test if all elements are false (zero) along a dimension in input. More...
|
| |
| template<typename ty > |
| ty | anytrue (const array &input) |
| | Test if all elements are false (zero) in entire array. More...
|
| |
The C++ interface for anytrue.
Verify if any of the elements are non zero.
These functions can also be used with conditions as parameters.
In such a case, the input array to the function is a boolean array.
bool hx[] = { true,true,false,true };
array x1(4,1, hx);
printf("%d,%d\n", anytrue<bool>(x1))
array y1 = randu(100, 1);
| array af::anytrue |
( |
const array & |
input, |
|
|
int |
dim = -1 |
|
) |
| |
Test if all elements are false (zero) along a dimension in input.
int in[] = {10,4,1,51,0,3};
array input(2,3,in);
- Parameters
-
| [in] | input | |
| [in] | dim | dimension along which to operate (-1 indicates first non-singleton dimension) |
- Returns
- boolean array with test results along the dimension
dim in the input
| ty af::anytrue |
( |
const array & |
input | ) |
|
Test if all elements are false (zero) in entire array.
- Parameters
-
- Returns
true if all elements in input are false (zero), false if any true (nonzero)