index.h File Reference
#include <af/defines.h>
#include <af/seq.h>

Go to the source code of this file.

Data Structures

struct  af_index_t
 Struct used while indexing af_array. More...
 
class  index
 Wrapper for af_index. More...
 

Namespaces

 af
 

Typedefs

typedef struct af_index_t af_index_t
 Struct used while indexing af_array. More...
 

Functions

AFAPI array lookup (const array &in, const array &idx, const int dim=-1)
 Lookup the values of input array based on index. More...
 
AFAPI af_err af_index (af_array *out, const af_array in, const unsigned ndims, const af_seq *const index)
 Lookup the values of input array based on sequences. More...
 
AFAPI af_err af_lookup (af_array *out, const af_array in, const af_array indices, const unsigned dim)
 Lookup the values of input array based on index. More...
 
AFAPI af_err af_assign_seq (af_array *out, const af_array lhs, const unsigned ndims, const af_seq *const indices, const af_array rhs)
 Copy and write values in the locations specified by the sequences. More...
 
AFAPI af_err af_index_gen (af_array *out, const af_array in, const dim_t ndims, const af_index_t *indices)
 Indexing an array using af_seq, or af_array. More...
 
AFAPI af_err af_assign_gen (af_array *out, const af_array lhs, const dim_t ndims, const af_index_t *indices, const af_array rhs)
 Assignment of an array using af_seq, or af_array. More...
 

Typedef Documentation

typedef struct af_index_t af_index_t

Struct used while indexing af_array.

This struct represents objects which can be used to index into an af_array Object. It contains a union object which can be an af_seq or an af_array. Indexing with an int can be represented using a af_seq object with the same af_seq::begin and af_seq::end with an af_seq::step of 1

Function Documentation

AFAPI af_err af_assign_gen ( af_array out,
const af_array  lhs,
const dim_t  ndims,
const af_index_t indices,
const af_array  rhs 
)

Assignment of an array using af_seq, or af_array.

Generalized assignment function that accepts either af_array or af_seq along a dimension to assign elements form an input array to an output array

Parameters
[out]outoutput array containing values at indexed by the sequences
[in]lhsis the input array
[in]ndimsis the number of af_index_t provided
[in]indicesis an af_array of af_index_t objects
[in]rhsis the array whose values will be assigned to lhs
AFAPI af_err af_assign_seq ( af_array out,
const af_array  lhs,
const unsigned  ndims,
const af_seq *const  indices,
const af_array  rhs 
)

Copy and write values in the locations specified by the sequences.

Parameters
[out]outoutput array with values of rhs copied to locations specified by index and values from lhs in all other locations.
[in]lhsis array whose values are used for indices NOT specified by index
[in]ndimsis the number of sequences provided
[in]indicesis an array of sequences
[in]rhsis the array whose values are used for indices specified by index
AFAPI af_err af_index ( af_array out,
const af_array  in,
const unsigned  ndims,
const af_seq *const  index 
)

Lookup the values of input array based on sequences.

Parameters
[out]outoutput array containing values indexed by the sequences
[in]inis the input array
[in]ndimsis the number of sequences provided
[in]indexis an array of sequences
AFAPI af_err af_index_gen ( af_array out,
const af_array  in,
const dim_t  ndims,
const af_index_t indices 
)

Indexing an array using af_seq, or af_array.

Generalized indexing function that accepts either af_array or af_seq along a dimension to index the input array and create the corresponding output array

Parameters
[out]outoutput array containing values at indexed by the sequences
[in]inis the input array
[in]ndimsis the number of af_index_t provided
[in]indicesis an array of af_index_t objects
AFAPI af_err af_lookup ( af_array out,
const af_array  in,
const af_array  indices,
const unsigned  dim 
)

Lookup the values of input array based on index.

Parameters
[out]outoutput array containing values at locations specified by index
[in]inis input lookup array
[in]indicesis lookup indices
[in]dimspecifies the dimension for indexing