The C++ interface for min.
More...
| array | min (const array &input, int dim=-1) |
| | Minimum of the elements along a dimension in matrix. More...
|
| |
| void | min (array &values, array &indices, const array &input, int dim=-1) |
| | Minimum value and index found along dimension. More...
|
| |
| template<typename ty > |
| ty | min (const array &input) |
| | Minimum value among all elements in array. More...
|
| |
| template<typename ty > |
| void | min (ty *value, int *index, const array &input) |
| | Minimum value and index among all elements in array. More...
|
| |
The C++ interface for min.
Returns the minimum value of an array, or if specified, the
minimum value of each dimension of the array. min can
also return the index of the minimum element:
int hx[] = { -3, -5, 2, -9 };
array x(2,2, hx);
float value;
int index;
printf("%g,%d\n", value, index));
Return the minimum regardless of dimension:
int hx[] = { -3, -5, 2, -9 };
array x1(2,2, hx);
array x2(4,1, hx);
printf("%d,%d\n", min<int>(x1), min<int>(x2));
Return minimum and indices along a given dimension
float ha[] = {1, 2, 3, 4};
array in = array(2, 2, ha);
| array af::min |
( |
const array & |
input, |
|
|
int |
dim = -1 |
|
) |
| |
Minimum 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 minimum values along the dimension
dim in the input
| void af::min |
( |
array & |
values, |
|
|
array & |
indices, |
|
|
const array & |
input, |
|
|
int |
dim = -1 |
|
) |
| |
Minimum 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 minimum values along the dimension dim in input |
| [out] | indices | location where values occur in input (zero-based indexing) |
| ty af::min |
( |
const array & |
input | ) |
|
Minimum value among all elements in array.
- Parameters
-
- Returns
- minimum of all values in the input array
| void af::min |
( |
ty * |
value, |
|
|
int * |
index, |
|
|
const array & |
input |
|
) |
| |
Minimum value and index among all elements in array.
- Parameters
-
| [in] | input | |
| [out] | value | array with minimum values along the dimension dim in input |
| [out] | index | location where values occur in input (zero-based indexing) |