the C interface for min More...

All Elements

Parameters
[out]countScalar and on host
[in]numelThe number of elements in the vector.
[in]matThe input stream
afError af_min_vector_S (float *h_dst, unsigned numel, const float *d_src)
 Minimum value of a single precision vector. More...
 
afError af_min_vector_B (bool *h_dst, unsigned numel, const bool *d_src)
 Minimum value of a boolean vector. More...
 
afError af_min_vector_I (int *h_dst, unsigned numel, const int *d_src)
 Minimum value of a 32-bit signed integer vector. More...
 
afError af_min_vector_U (unsigned *h_dst, unsigned numel, const unsigned *d_src)
 Minimum value of a 32-bit unsigned integer vector. More...
 
afError af_min_vector_C (cfloat *h_dst, unsigned numel, const cfloat *d_src)
 Minimum value of a single precision, complex vector. More...
 
afError af_min_vector_D (double *h_dst, unsigned numel, const double *d_src)
 Minimum value of a double precision vector. More...
 
afError af_min_vector_Z (cdouble *h_dst, unsigned numel, const cdouble *d_src)
 Minimum value of a double precision, complex vector. More...
 
afError af_imin_vector_S (float *h_dst, int *h_idx, unsigned numel, const float *d_src, bool is_baseone=false)
 Indexed minimum value of a single precision vector,. More...
 
afError af_imin_vector_I (int *h_dst, int *h_idx, unsigned numel, const int *d_src, bool is_baseone=false)
 Indexed minimum value of a 32-bit signed integer vector,. More...
 
afError af_imin_vector_U (unsigned *h_dst, int *h_idx, unsigned numel, const unsigned *d_src, bool is_baseone=false)
 Indexed minimum value of a 32-bit unsigned integer vector,. More...
 
afError af_imin_vector_B (bool *h_dst, int *h_idx, unsigned numel, const bool *d_src, bool is_baseone=false)
 Indexed minimum value of a boolean vector. More...
 
afError af_imin_vector_C (cfloat *h_dst, int *h_idx, unsigned numel, const cfloat *d_src, bool is_baseone=false)
 Indexed minimum value of a single precision, complex vector. More...
 
afError af_imin_vector_D (double *h_dst, int *h_idx, unsigned numel, const double *d_src, bool is_baseone=false)
 Indexed minimum value of a double precision vector. More...
 
afError af_imin_vector_Z (cdouble *h_dst, int *h_idx, unsigned numel, const cdouble *d_src, bool is_baseone=false)
 Indexed minimum value of a double precision, complex vector. More...
 

Along a Dimension

Parameters
[out]countvector and on device
[in]numelThe number of elements in the vector.
[in]matThe input stream
[in]batchThe number of input tiles.
afError af_min_S (float *d_dst, unsigned ndims, const unsigned *dims, const float *d_src, int dim)
 Minimum value along a dimension in single precision matrix. More...
 
afError af_min_B (bool *d_dst, unsigned ndims, const unsigned *dims, const bool *d_src, int dim)
 Minimum value along a dimension in boolean matrix. More...
 
afError af_min_I (int *d_dst, unsigned ndims, const unsigned *dims, const int *d_src, int dim)
 Minimum value along a dimension in 32-bit signed integer matrix. More...
 
afError af_min_U (unsigned *d_dst, unsigned ndims, const unsigned *dims, const unsigned *d_src, int dim)
 Minimum value along a dimension in 32-bit unsigned integer matrix. More...
 
afError af_min_C (cfloat *d_dst, unsigned ndims, const unsigned *dims, const cfloat *d_src, int dim)
 Minimum value along a dimension in single precision, complex matrix. More...
 
afError af_min_D (double *d_dst, unsigned ndims, const unsigned *dims, const double *d_src, int dim)
 Minimum value along a dimension in double precision matrix. More...
 
afError af_min_Z (cdouble *d_dst, unsigned ndims, const unsigned *dims, const cdouble *d_src, int dim)
 Minimum value along a dimension in double precision, complex matrix. More...
 
afError af_imin_S (float *d_dst, int *d_idx, unsigned ndims, const unsigned *dims, const float *d_src, int dim, bool is_baseone=false)
 Indexed minimum value along a dimension in single precision matrix. More...
 
afError af_imin_I (int *d_dst, int *d_idx, unsigned ndims, const unsigned *dims, const int *d_src, int dim, bool is_baseone=false)
 Indexed minimum value along a dimension in 32-bit signed integer matrix. More...
 
afError af_imin_U (unsigned *d_dst, int *d_idx, unsigned ndims, const unsigned *dims, const unsigned *d_src, int dim, bool is_baseone=false)
 Indexed minimum value along a dimension in 32-bit unsigned integer matrix. More...
 
afError af_imin_B (bool *d_dst, int *d_idx, unsigned ndims, const unsigned *dims, const bool *d_src, int dim, bool is_baseone=false)
 Indexed minimum value along a dimension in boolean matrix. More...
 
afError af_imin_C (cfloat *d_dst, int *d_idx, unsigned ndims, const unsigned *dims, const cfloat *d_src, int dim, bool is_baseone=false)
 Indexed minimum value along a dimension in single precision, cplx matrix. More...
 
afError af_imin_D (double *d_dst, int *d_idx, unsigned ndims, const unsigned *dims, const double *d_src, int dim, bool is_baseone=false)
 Indexed minimum value along a dimension in double precision matrix. More...
 
afError af_imin_Z (cdouble *d_dst, int *d_idx, unsigned ndims, const unsigned *dims, const cdouble *d_src, int dim, bool is_baseone=false)
 Indexed minimum value along a dimension in double precision, cplx matrix. More...
 

Detailed Description

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 };
// hx = -3 2
// -5 -9
array x(2,2, hx); // 2x2 matrix
float value;
int index;
min(&value, &index, x);
printf("%g,%d\n", value, index)); // -9,3

Return the minimum regardless of dimension:

int hx[] = { -3, -5, 2, -9 };
array x1(2,2, hx); // 2x2 matrix
array x2(4,1, hx); // 4x1 vector
printf("%d,%d\n", min<int>(x1), min<int>(x2)); // -9,-9

Return minimum and indices along a given dimension

float ha[] = {1, 2, 3, 4};
array in = array(2, 2, ha);
// Storage for the results
array m, i;
// Min along columns
min(m, i, in, 0);
print(m);
print(i);
// m = 1.0000 3.0000
// i = 0 0
// Min along rows
min(m, i, in, 1);
print(m);
print(i);
// m = 1.0000
// 2.0000
// i = 0
// 0

Function Documentation

afError af_min_vector_S ( float *  h_dst,
unsigned  numel,
const float *  d_src 
)

Minimum value of a single precision vector.

afError af_min_vector_B ( bool *  h_dst,
unsigned  numel,
const bool *  d_src 
)

Minimum value of a boolean vector.

afError af_min_vector_I ( int *  h_dst,
unsigned  numel,
const int *  d_src 
)

Minimum value of a 32-bit signed integer vector.

afError af_min_vector_U ( unsigned *  h_dst,
unsigned  numel,
const unsigned *  d_src 
)

Minimum value of a 32-bit unsigned integer vector.

afError af_min_vector_C ( cfloat h_dst,
unsigned  numel,
const cfloat d_src 
)

Minimum value of a single precision, complex vector.

afError af_min_vector_D ( double *  h_dst,
unsigned  numel,
const double *  d_src 
)

Minimum value of a double precision vector.

afError af_min_vector_Z ( cdouble h_dst,
unsigned  numel,
const cdouble d_src 
)

Minimum value of a double precision, complex vector.

afError af_imin_vector_S ( float *  h_dst,
int *  h_idx,
unsigned  numel,
const float *  d_src,
bool  is_baseone = false 
)

Indexed minimum value of a single precision vector,.

afError af_imin_vector_I ( int *  h_dst,
int *  h_idx,
unsigned  numel,
const int *  d_src,
bool  is_baseone = false 
)

Indexed minimum value of a 32-bit signed integer vector,.

afError af_imin_vector_U ( unsigned *  h_dst,
int *  h_idx,
unsigned  numel,
const unsigned *  d_src,
bool  is_baseone = false 
)

Indexed minimum value of a 32-bit unsigned integer vector,.

afError af_imin_vector_B ( bool *  h_dst,
int *  h_idx,
unsigned  numel,
const bool *  d_src,
bool  is_baseone = false 
)

Indexed minimum value of a boolean vector.

afError af_imin_vector_C ( cfloat h_dst,
int *  h_idx,
unsigned  numel,
const cfloat d_src,
bool  is_baseone = false 
)

Indexed minimum value of a single precision, complex vector.

afError af_imin_vector_D ( double *  h_dst,
int *  h_idx,
unsigned  numel,
const double *  d_src,
bool  is_baseone = false 
)

Indexed minimum value of a double precision vector.

afError af_imin_vector_Z ( cdouble h_dst,
int *  h_idx,
unsigned  numel,
const cdouble d_src,
bool  is_baseone = false 
)

Indexed minimum value of a double precision, complex vector.

afError af_min_S ( float *  d_dst,
unsigned  ndims,
const unsigned *  dims,
const float *  d_src,
int  dim 
)

Minimum value along a dimension in single precision matrix.

afError af_min_B ( bool *  d_dst,
unsigned  ndims,
const unsigned *  dims,
const bool *  d_src,
int  dim 
)

Minimum value along a dimension in boolean matrix.

afError af_min_I ( int *  d_dst,
unsigned  ndims,
const unsigned *  dims,
const int *  d_src,
int  dim 
)

Minimum value along a dimension in 32-bit signed integer matrix.

afError af_min_U ( unsigned *  d_dst,
unsigned  ndims,
const unsigned *  dims,
const unsigned *  d_src,
int  dim 
)

Minimum value along a dimension in 32-bit unsigned integer matrix.

afError af_min_C ( cfloat d_dst,
unsigned  ndims,
const unsigned *  dims,
const cfloat d_src,
int  dim 
)

Minimum value along a dimension in single precision, complex matrix.

afError af_min_D ( double *  d_dst,
unsigned  ndims,
const unsigned *  dims,
const double *  d_src,
int  dim 
)

Minimum value along a dimension in double precision matrix.

afError af_min_Z ( cdouble d_dst,
unsigned  ndims,
const unsigned *  dims,
const cdouble d_src,
int  dim 
)

Minimum value along a dimension in double precision, complex matrix.

afError af_imin_S ( float *  d_dst,
int *  d_idx,
unsigned  ndims,
const unsigned *  dims,
const float *  d_src,
int  dim,
bool  is_baseone = false 
)

Indexed minimum value along a dimension in single precision matrix.

afError af_imin_I ( int *  d_dst,
int *  d_idx,
unsigned  ndims,
const unsigned *  dims,
const int *  d_src,
int  dim,
bool  is_baseone = false 
)

Indexed minimum value along a dimension in 32-bit signed integer matrix.

afError af_imin_U ( unsigned *  d_dst,
int *  d_idx,
unsigned  ndims,
const unsigned *  dims,
const unsigned *  d_src,
int  dim,
bool  is_baseone = false 
)

Indexed minimum value along a dimension in 32-bit unsigned integer matrix.

afError af_imin_B ( bool *  d_dst,
int *  d_idx,
unsigned  ndims,
const unsigned *  dims,
const bool *  d_src,
int  dim,
bool  is_baseone = false 
)

Indexed minimum value along a dimension in boolean matrix.

afError af_imin_C ( cfloat d_dst,
int *  d_idx,
unsigned  ndims,
const unsigned *  dims,
const cfloat d_src,
int  dim,
bool  is_baseone = false 
)

Indexed minimum value along a dimension in single precision, cplx matrix.

afError af_imin_D ( double *  d_dst,
int *  d_idx,
unsigned  ndims,
const unsigned *  dims,
const double *  d_src,
int  dim,
bool  is_baseone = false 
)

Indexed minimum value along a dimension in double precision matrix.

afError af_imin_Z ( cdouble d_dst,
int *  d_idx,
unsigned  ndims,
const unsigned *  dims,
const cdouble d_src,
int  dim,
bool  is_baseone = false 
)

Indexed minimum value along a dimension in double precision, cplx matrix.