array | alltrue (const array &input, int dim=-1) |
test if all elements are true (nonzero) along a dimension in input | |
template<typename ty > | |
ty | alltrue (const array &input) |
test if all elements are true (nonzero) in entire array | |
array | allfalse (const array &input, int dim=-1) |
test if all elements are false (zero) along a dimension in input | |
template<typename ty > | |
ty | allfalse (const array &input) |
test if all elements are false (zero) in entire array |
array af::alltrue | ( | const array & | input, |
int | dim = -1 |
||
) |
test if all elements are true (nonzero) along a dimension in input
[in] | input | |
[in] | dim | dimension along which to operate (-1 indicates first nonsingleton dimension) |
dim
in the input ty af::alltrue | ( | const array & | input | ) |
test if all elements are true (nonzero) in entire array
bool hx[] = { true,true,false,true }; array x1(hx, 2,2); // 2x2 matrix array x2(hx, 4,1); // 4x1 vector printf("%d,%d\n", alltrue<bool>(x1), alltrue<bool>(x2)); // 0,0 float hy[] = { 1,4,0,2 }; array y1(hy, 2,2); // 2x2 matrix array y2(hy, 4,1); // 4x1 vector printf("%d,%d\n", alltrue<bool>(y1), alltrue<bool>(y2)); // 0,0
[in] | input |
true
iff all elements in array are true (false if any zeros) array af::allfalse | ( | const array & | input, |
int | dim = -1 |
||
) |
test if all elements are false (zero) along a dimension in input
[in] | input | |
[in] | dim | dimension along which to operate (-1 indicates first nonsingleton dimension) |
dim
in the input ty af::allfalse | ( | const array & | input | ) |
test if all elements are false (zero) in entire array
[in] | input |
true
if all elements in input
are false (zero), false
if any true (nonzero)