The C++ interface for max.
More...
| array | max (const array &input, int dim=-1) |
| | Maximum of the elements along a dimension in matrix. More...
|
| |
| void | max (array &values, array &indices, const array &input, int dim=-1) |
| | Maximum value and index found along dimension. More...
|
| |
| template<typename ty > |
| ty | max (const array &input) |
| | Maximum value among all elements in array. More...
|
| |
| template<typename ty > |
| void | max (ty *value, int *index, const array &input) |
| | Maximum value and index among all elements in array. More...
|
| |
The C++ interface for max.
Returns the maximum value of an array, or if specified, the
maximum value of each dimension of the array. Max can also
return the indices (0-based) where these elements are located.
int hx[] = { -3, -5, 2, -9 };
array x(2,2, hx);
float value;
int index;
printf("%g,%d\n", value, index));
Return the maximum regardless of dimension:
int hx[] = { -3, -5, 2, -9 };
array x1(2,2, hx);
array x2(4,1, hx);
printf("%d,%d\n", max<int>(x1), max<int>(x2));
Return maximum and indices along a given dimension
float ha[] = {1, 2, 3, 4};
array in = array(2, 2, ha);
| array af::max |
( |
const array & |
input, |
|
|
int |
dim = -1 |
|
) |
| |
Maximum of the elements along a dimension in matrix.
- Parameters
-
| [in] | input | |
| [in] | dim | dimension along which to operate (-1 indicates first non-singleton dimension) |
- Returns
- array with maximum values along the dimension
dim in the input
| void af::max |
( |
array & |
values, |
|
|
array & |
indices, |
|
|
const array & |
input, |
|
|
int |
dim = -1 |
|
) |
| |
Maximum value and index found along dimension.
- Parameters
-
| [in] | input | |
| [in] | dim | dimension along which to operate (-1 indicates first non-singleton dimension) |
| [out] | values | array with maximum values along the dimension dim in input |
| [out] | indices | location where values occur in input (zero-based indexing) |
| ty af::max |
( |
const array & |
input | ) |
|
Maximum value among all elements in array.
int hx[] = { -3, -5, 2, -9 };
array x1(2,2, hx);
array x2(4,1, hx);
printf("%d,%d\n", max<int>(x1), max<int>(x2));
- Parameters
-
- Returns
- maximum of all values in the input array
| void af::max |
( |
ty * |
value, |
|
|
int * |
index, |
|
|
const array & |
input |
|
) |
| |
Maximum value and index among all elements in array.
- Parameters
-
| [in] | input | |
| [out] | value | array with maximum values along the dimension dim in input |
| [out] | index | location where values occur in input (zero-based indexing) |