Lookup values of an array based on sequences and/or arrays.  
More...
|  | 
| void | copy (array &dst, const array &src, const index &idx0, const index &idx1=span, const index &idx2=span, const index &idx3=span) | 
|  | Copy the values of an input array based on index. 
 | 
|  | 
| 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. 
 | 
|  | 
| 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. 
 | 
|  | 
| af_err | af_create_indexers (af_index_t **indexers) | 
|  | Create an quadruple of af_index_t array. 
 | 
|  | 
| af_err | af_set_array_indexer (af_index_t *indexer, const af_array idx, const dim_t dim) | 
|  | set dimto given indexer af_arrayidx
 | 
|  | 
| af_err | af_set_seq_indexer (af_index_t *indexer, const af_seq *idx, const dim_t dim, const bool is_batch) | 
|  | set dimto given indexer af_arrayidx
 | 
|  | 
| af_err | af_set_seq_param_indexer (af_index_t *indexer, const double begin, const double end, const double step, const dim_t dim, const bool is_batch) | 
|  | set dimto given indexer af_arrayidx
 | 
|  | 
| af_err | af_release_indexers (af_index_t *indexers) | 
|  | Release's the memory resource used by the quadruple af_index_t array. 
 | 
|  | 
Lookup values of an array based on sequences and/or arrays. 
 
◆ af_create_indexers()
Create an quadruple of af_index_t array. 
                                                
                                                
 
    
    unsigned ndims = 2;
 
    
    unsigned n = 1;
 
 
    
 
    
                                               
        printf("Failed in af_index_gen: %d\n", err);
        return 1;
    }
 
 
 
        printf("Failed in af_index_gen: %d\n", err);
        return 1;
    }
 
    return 0;
 - Parameters
- 
  
    | [out] | indexers | pointer to location where quadruple af_index_t array is created |  
 
- Returns
- af_err error code 
 
 
◆ af_index()
Lookup the values of input array based on sequences. 
- Parameters
- 
  
    | [out] | out | output array containing values indexed by the sequences |  | [in] | in | is the input array |  | [in] | ndims | is the number of sequences provided |  | [in] | index | is an array of sequences |  
 
 
 
◆ af_index_gen()
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] | out | output array containing values at indexed by the sequences |  | [in] | in | is the input array |  | [in] | ndims | is the number of af_index_t provided |  | [in] | indices | is an array of af_index_t objects |  
 
 
 
◆ af_release_indexers()
Release's the memory resource used by the quadruple af_index_t array. 
                                                
                                                
 
    
    unsigned ndims = 2;
 
    
    unsigned n = 1;
 
 
    
 
    
                                               
        printf("Failed in af_index_gen: %d\n", err);
        return 1;
    }
 
 
 
        printf("Failed in af_index_gen: %d\n", err);
        return 1;
    }
 
    return 0;
 - Parameters
- 
  
    | [in] | indexers | is pointer to location where quadruple af_index_t array is created |  
 
 
 
◆ af_set_array_indexer()
set dim to given indexer af_array idx 
                                                
                                                
 
    
    unsigned ndims = 2;
 
    
    unsigned n = 1;
 
 
    
 
    
                                               
        printf("Failed in af_index_gen: %d\n", err);
        return 1;
    }
 
 
 
        printf("Failed in af_index_gen: %d\n", err);
        return 1;
    }
 
    return 0;
 - Parameters
- 
  
    | [in] | indexer | pointer to location where quadruple af_index_t array was created |  | [in] | idx | is the af_array indexer for given dimension dim |  | [in] | dim | is the dimension to be indexed |  
 
- Returns
- af_err error code 
 
 
◆ af_set_seq_indexer()
set dim to given indexer af_array idx 
This function is similar to af_set_array_indexer in terms of functionality except that this version accepts object of type af_seq instead of af_array.
                                                
                                                
 
    
    unsigned ndims = 2;
 
    
    unsigned n = 1;
 
 
    
 
    
                                               
        printf("Failed in af_index_gen: %d\n", err);
        return 1;
    }
 
 
 
        printf("Failed in af_index_gen: %d\n", err);
        return 1;
    }
 
    return 0;
 - Parameters
- 
  
    | [in] | indexer | pointer to location where quadruple af_index_t array was created |  | [in] | idx | is the af_seq indexer for given dimension dim |  | [in] | dim | is the dimension to be indexed |  | [in] | is_batch | indicates if the sequence based indexing is inside a batch operation |  
 
 
 
◆ af_set_seq_param_indexer()
      
        
          | af_err af_set_seq_param_indexer | ( | af_index_t * | indexer, | 
        
          |  |  | const double | begin, | 
        
          |  |  | const double | end, | 
        
          |  |  | const double | step, | 
        
          |  |  | const dim_t | dim, | 
        
          |  |  | const bool | is_batch ) | 
      
 
set dim to given indexer af_array idx 
This function is alternative to af_set_seq_indexer where instead of passing in an already prepared af_seq object, you pass the arguments necessary for creating an af_seq directly.
- Parameters
- 
  
    | [in] | indexer | pointer to location where quadruple af_index_t array was created |  | [in] | begin | is the beginning index of along dimension dim |  | [in] | end | is the beginning index of along dimension dim |  | [in] | step | size along dimension dim |  | [in] | dim | is the dimension to be indexed |  | [in] | is_batch | indicates if the sequence based indexing is inside a batch operation |  
 
- Returns
- af_err error code 
 
 
◆ copy()
Copy the values of an input array based on index. 
- Parameters
- 
  
    | [out] | dst | The destination array |  | [in] | src | The source array |  | [in] | idx0 | The first index |  | [in] | idx1 | The second index (defaults to span) |  | [in] | idx2 | The third index (defaults to span) |  | [in] | idx3 | The fourth index (defaults to span) |