The C++ interface for where. More...

One Dimension

Find non-zero values in a vector.

Return linear indices (zero- or one-based).

Parameters
[out]n_outNumber of non-zeros returned in d_indices
[out]d_indicesLinear indices (if is_baseone true then one-based, else zero-based)
[in]n_inNumber of total elements in d_X
[in]d_XInput vector
[in]is_baseoneIs indexed output one-based? If true, one-based indexing; else, zero-based. Default: false.
afError af_where_BS (unsigned *n_out, float **d_indices, unsigned n_in, const bool *d_X, bool is_baseone=false)
 Boolean (8-bit) find, single-precision indexing. More...
 
afError af_where_BD (unsigned *n_out, double **d_indices, unsigned n_in, const bool *d_X, bool is_baseone=false)
 Boolean (8-bit) find, double-precision indexing. More...
 
afError af_where_BU (unsigned *n_out, unsigned **d_indices, unsigned n_in, const bool *d_X, bool is_baseone=false)
 Boolean (8-bit) find, integer indexing. More...
 
afError af_where_SS (unsigned *n_out, float **d_indices, unsigned n_in, const float *d_X, bool is_baseone=false)
 Single-precision find, single-precision indexing. More...
 
afError af_where_SD (unsigned *n_out, double **d_indices, unsigned n_in, const float *d_X, bool is_baseone=false)
 Single-precision find, double-precision indexing. More...
 
afError af_where_DD (unsigned *n_out, double **d_indices, unsigned n_in, const double *d_X, bool is_baseone=false)
 Double-precision find. More...
 
afError af_where_UU (unsigned *n_out, unsigned **d_indices, unsigned n_in, const unsigned *d_X, bool is_baseone=false)
 Unsigned integer find. More...
 
afError af_where_II (unsigned *n_out, int **d_indices, unsigned n_in, const int *d_X, bool is_baseone=false)
 Integer find. More...
 

Two Dimension

Find non-zero values in a matrix.

Return 2D indices (zero or one-based).

Parameters
[out]n_outNumber of non-zeros returned in d_I and d_J
[out]d_IRow indices (zero or one-based) of non-zero elements
[out]d_JColumn indices (zero or one-based) of non-zero elements
[in]n_inNumber of total elements in d_X
[in]rowsNumber of rows in d_X
[in]d_XInput matrix
[in]is_baseoneIs indexed output one-based? If true, one-based indexing; else, zero-based. Default: false.
afError af_where2_BS (unsigned *n_out, float **d_I, float **d_J, unsigned n_in, unsigned rows, const bool *d_X, bool is_baseone=false)
 Boolean (8-bit) find, single-precision indexing. More...
 
afError af_where2_BD (unsigned *n_out, double **d_I, double **d_J, unsigned n_in, unsigned rows, const bool *d_X, bool is_baseone=false)
 Boolean (8-bit) find, double-precision indexing. More...
 
afError af_where2_SS (unsigned *n_out, float **d_I, float **d_J, unsigned n_in, unsigned rows, const float *d_X, bool is_baseone=false)
 Single-precision find, single-precision indexing. More...
 
afError af_where2_SD (unsigned *n_out, double **d_I, double **d_J, unsigned n_in, unsigned rows, const float *d_X, bool is_baseone=false)
 Single-precision find, double-precision indexing. More...
 
afError af_where2_DD (unsigned *n_out, double **d_I, double **d_J, unsigned n_in, unsigned rows, const double *d_X, bool is_baseone=false)
 Double-precision find. More...
 
afError af_where2_UU (unsigned *n_out, unsigned **d_I, unsigned **d_J, unsigned n_in, unsigned rows, const unsigned *d_X, bool is_baseone=false)
 Unsigned integer find. More...
 
afError af_where2_II (unsigned *n_out, int **d_I, int **d_J, unsigned n_in, unsigned rows, const int *d_X, bool is_baseone=false)
 Integer find. More...
 

Detailed Description

The C++ interface for where.

Returns the indicies of the non-zero values in an set of elements.

These functions can also be used with conditions as parameters. In such a case, the input array to the function is a boolean array.

Function Documentation

afError af_where_BS ( unsigned *  n_out,
float **  d_indices,
unsigned  n_in,
const bool *  d_X,
bool  is_baseone = false 
)

Boolean (8-bit) find, single-precision indexing.

afError af_where_BD ( unsigned *  n_out,
double **  d_indices,
unsigned  n_in,
const bool *  d_X,
bool  is_baseone = false 
)

Boolean (8-bit) find, double-precision indexing.

afError af_where_BU ( unsigned *  n_out,
unsigned **  d_indices,
unsigned  n_in,
const bool *  d_X,
bool  is_baseone = false 
)

Boolean (8-bit) find, integer indexing.

afError af_where_SS ( unsigned *  n_out,
float **  d_indices,
unsigned  n_in,
const float *  d_X,
bool  is_baseone = false 
)

Single-precision find, single-precision indexing.

afError af_where_SD ( unsigned *  n_out,
double **  d_indices,
unsigned  n_in,
const float *  d_X,
bool  is_baseone = false 
)

Single-precision find, double-precision indexing.

afError af_where_DD ( unsigned *  n_out,
double **  d_indices,
unsigned  n_in,
const double *  d_X,
bool  is_baseone = false 
)

Double-precision find.

afError af_where_UU ( unsigned *  n_out,
unsigned **  d_indices,
unsigned  n_in,
const unsigned *  d_X,
bool  is_baseone = false 
)

Unsigned integer find.

afError af_where_II ( unsigned *  n_out,
int **  d_indices,
unsigned  n_in,
const int *  d_X,
bool  is_baseone = false 
)

Integer find.

afError af_where2_BS ( unsigned *  n_out,
float **  d_I,
float **  d_J,
unsigned  n_in,
unsigned  rows,
const bool *  d_X,
bool  is_baseone = false 
)

Boolean (8-bit) find, single-precision indexing.

afError af_where2_BD ( unsigned *  n_out,
double **  d_I,
double **  d_J,
unsigned  n_in,
unsigned  rows,
const bool *  d_X,
bool  is_baseone = false 
)

Boolean (8-bit) find, double-precision indexing.

afError af_where2_SS ( unsigned *  n_out,
float **  d_I,
float **  d_J,
unsigned  n_in,
unsigned  rows,
const float *  d_X,
bool  is_baseone = false 
)

Single-precision find, single-precision indexing.

afError af_where2_SD ( unsigned *  n_out,
double **  d_I,
double **  d_J,
unsigned  n_in,
unsigned  rows,
const float *  d_X,
bool  is_baseone = false 
)

Single-precision find, double-precision indexing.

afError af_where2_DD ( unsigned *  n_out,
double **  d_I,
double **  d_J,
unsigned  n_in,
unsigned  rows,
const double *  d_X,
bool  is_baseone = false 
)

Double-precision find.

afError af_where2_UU ( unsigned *  n_out,
unsigned **  d_I,
unsigned **  d_J,
unsigned  n_in,
unsigned  rows,
const unsigned *  d_X,
bool  is_baseone = false 
)

Unsigned integer find.

afError af_where2_II ( unsigned *  n_out,
int **  d_I,
int **  d_J,
unsigned  n_in,
unsigned  rows,
const int *  d_X,
bool  is_baseone = false 
)

Integer find.