The C++ interface for alltrue.
More...
| array | alltrue (const array &input, int dim=-1) |
| | Test if all elements are true (nonzero) along a dimension in input. More...
|
| |
| template<typename ty > |
| ty | alltrue (const array &input) |
| | Test if all elements are true (nonzero) in entire array. More...
|
| |
The C++ interface for alltrue.
Performs a logical boolean and operation over the elements
of an array.
These functions are particularly useful when utilized with
the result of conditions as parameters. In such a case, the
input array to the function is a boolean array.
Similar to the other reduction operations in ArrayFire,
alltrue can also operate a long a given dimension.
bool hx[] = { true, true, false, true };
array x1(4, 1, hx);
printf("%d\n", alltrue<bool>(x1));
| array af::alltrue |
( |
const array & |
input, |
|
|
int |
dim = -1 |
|
) |
| |
Test if all elements are true (nonzero) along a dimension in input.
- 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
- Examples:
- examples/financial/monte_carlo_options.cpp.
| ty af::alltrue |
( |
const array & |
input | ) |
|
Test if all elements are true (nonzero) in entire array.
- Parameters
-
- Returns
true iff all elements in array are true (false if anytrue zeros)