A high-performance general-purpose compute library

Return the minimum along a given dimension. More...

Functions

array min (const array &in, const int dim=-1)
 C++ Interface to return the minimum along a given dimension.
 
template<typename T >
min (const array &in)
 C++ Interface to return the minimum along the first non-singleton dimension.
 
void min (array &val, array &idx, const array &in, const int dim=-1)
 C++ Interface to return the minimum and its location along a given dimension.
 
template<typename T >
void min (T *val, unsigned *idx, const array &in)
 C++ Interface to return the minimum and its location over all dimensions.
 
af_err af_min (af_array *out, const af_array in, const int dim)
 C Interface to return the minimum along a given dimension.
 
af_err af_min_all (double *real, double *imag, const af_array in)
 C Interface to return the minimum over all dimensions.
 
af_err af_min_all_array (af_array *out, const af_array in)
 C Interface to return the minimum over all dimensions.
 
af_err af_imin (af_array *out, af_array *idx, const af_array in, const int dim)
 C Interface to return the minimum and its location along a given dimension.
 
af_err af_imin_all (double *real, double *imag, unsigned *idx, const af_array in)
 C Interface to return the minimum and its location over all dimensions.
 

Detailed Description

Return the minimum along a given dimension.

This function runs across all batches in the input simultaneously.

Function Documentation

◆ af_imin()

af_err af_imin ( af_array * out,
af_array * idx,
const af_array in,
const int dim )

C Interface to return the minimum and its location along a given dimension.

Parameters
[out]outminimum
[out]idxlocation
[in]ininput array
[in]dimdimension along which the minimum is found
Returns
AF_SUCCESS, if function returns successfully, else an af_err code is given

◆ af_imin_all()

af_err af_imin_all ( double * real,
double * imag,
unsigned * idx,
const af_array in )

C Interface to return the minimum and its location over all dimensions.

NaN values are ignored.

Parameters
[out]realreal component of the minimum
[out]imagimaginary component of the minimum; 0 if idx is real
[out]idxlocation
[in]ininput array
Returns
AF_SUCCESS, if function returns successfully, else an af_err code is given

◆ af_min()

af_err af_min ( af_array * out,
const af_array in,
const int dim )

C Interface to return the minimum along a given dimension.

Parameters
[out]outminimum
[in]ininput array
[in]dimdimension along which the minimum is found
Returns
AF_SUCCESS, if function returns successfully, else an af_err code is given

◆ af_min_all()

af_err af_min_all ( double * real,
double * imag,
const af_array in )

C Interface to return the minimum over all dimensions.

If in is real, imag will be set to zeros.

Parameters
[out]realreal component of the minimum
[out]imagimaginary component of the minimum
[in]ininput array
Returns
AF_SUCCESS, if function returns successfully, else an af_err code is given

◆ af_min_all_array()

af_err af_min_all_array ( af_array * out,
const af_array in )

C Interface to return the minimum over all dimensions.

Parameters
[out]outminimum
[in]ininput array
Returns
AF_SUCCESS, if function returns successfully, else an af_err code is given

◆ min() [1/4]

void min ( array & val,
array & idx,
const array & in,
const int dim = -1 )

C++ Interface to return the minimum and its location along a given dimension.

NaN values are ignored.

Parameters
[out]valminimum
[out]idxlocation
[in]ininput array
[in]dimdimension along which the minimum is found, -1 denotes the first non-singleton dimension

◆ min() [2/4]

template<typename T >
T min ( const array & in)

C++ Interface to return the minimum along the first non-singleton dimension.

NaN values are ignored.

Parameters
[in]ininput array
Returns
minimum

◆ min() [3/4]

array min ( const array & in,
const int dim = -1 )

C++ Interface to return the minimum along a given dimension.

NaN values are ignored.

Parameters
[in]ininput array
[in]dimdimension along which the minimum is found, -1 denotes the first non-singleton dimension
Returns
minimum
Examples
computer_vision/matching.cpp, graphics/fractal.cpp, image_processing/confidence_connected_components.cpp, image_processing/filters.cpp, and image_processing/image_editing.cpp.

◆ min() [4/4]

template<typename T >
void min ( T * val,
unsigned * idx,
const array & in )

C++ Interface to return the minimum and its location over all dimensions.

NaN values are ignored.

Often used to return values directly to the host.

Parameters
[out]valminimum
[out]idxlocation
[in]ininput array