The C++ interface for minmax.
More...
| array | minmax_packed (const array &input, int dim=-1) |
| | Minimum and maximum (packed) of the elements along a dimension in matrix. More...
|
| |
| void | minmax (array &minvalues, array &maxvalues, const array &input, int dim=-1) |
| | Minimum and maximum of the elements along a dimension in matrix. More...
|
| |
| template<typename ty > |
| ty | minmax (const array &input) |
| | Minimum (out.x) and maximum (out.y) values among all elements in array. More...
|
| |
The C++ interface for minmax.
Returns the minimum and the maximum value along a given dimension
or for all of the elements of an array.
float ha[] = {1, 2, 3, 4, 5, 6};
array in = array(2, 3, ha);
array minvals, maxvals;
minmax(minvals, maxvals, in, 0);
minmax(minvals, maxvals, in, 1);
| array af::minmax_packed |
( |
const array & |
input, |
|
|
int |
dim = -1 |
|
) |
| |
Minimum and maximum (packed) 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 of minimum (real part) and maximum (imag part) along the dimension
dim in the input
| void af::minmax |
( |
array & |
minvalues, |
|
|
array & |
maxvalues, |
|
|
const array & |
input, |
|
|
int |
dim = -1 |
|
) |
| |
Minimum and 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) |
| [out] | minvalues | minimums |
| [out] | maxvalues | maximums |
| ty af::minmax |
( |
const array & |
input | ) |
|
Minimum (out.x) and maximum (out.y) values among all elements in array.
int hx[] = { -3, -5, 2, -9 };
array x(2,2, hx);
float2 extrema = minmax<float2>(x);
printf("%g,%g\n", extrema.x, extrema.y);
- Parameters
-
- Returns
- both minimum and maximum of all values in array