ArrayFire: index.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10#pragma once
13
23 union {
27
31
32
33#if __cplusplus
34namespace af
35{
36
37class dim4;
38class array;
39class seq;
40
53
55 public:
61
72
83
94
105
106#if AF_API_VERSION >= 31
115#endif
116
123
130
131#if AF_API_VERSION >= 31
140
141#if AF_COMPILER_CXX_RVALUE_REFERENCES
155#endif
156#endif
157};
158
170
171#if AF_API_VERSION >= 31
184 const index &idx0,
188#endif
189
190}
191#endif
192
193#ifdef __cplusplus
194extern "C" {
195#endif
196
209 const unsigned ndims, const af_seq* const index);
210
211
225 const unsigned dim);
226
244 const unsigned ndims, const af_seq* const indices,
246
265
286
287#if AF_API_VERSION >= 32
299#endif
300
301#if AF_API_VERSION >= 32
315#endif
316
317#if AF_API_VERSION >= 32
334 const dim_t dim, const bool is_batch);
335#endif
336
337#if AF_API_VERSION >= 32
356 const double begin, const double end, const double step,
357 const dim_t dim, const bool is_batch);
358#endif
359
360#if AF_API_VERSION >= 32
367
372#endif
373
374#ifdef __cplusplus
375}
376#endif
A multi dimensional data container.
index(const af::seq &s0)
Implicit seq converter.
index()
Default constructor.
index(const af::array &idx0)
Implicit int converter.
index(const af_seq &s0)
Implicit seq converter.
index(const index &idx0)
Copy constructor.
bool isspan() const
Returns true if the af::index represents a af::span object.
index & operator=(const index &idx0)
Assigns idx0 to this index.
index(const int idx)
Implicit int converter.
const af_index_t & get() const
Gets the underlying af_index_t object.
seq is used to create sequences for indexing af::array
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.
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.
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.
AFAPI af_err af_create_indexers(af_index_t **indexers)
Create an quadruple of af_index_t array.
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.
AFAPI 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
AFAPI 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.
AFAPI af_err af_release_indexers(af_index_t *indexers)
Release's the memory resource used by the quadruple af_index_t array.
AFAPI af_err af_set_array_indexer(af_index_t *indexer, const af_array idx, const dim_t dim)
set dim to given indexer af_array idx
AFAPI af_err af_set_seq_indexer(af_index_t *indexer, const af_seq *idx, const dim_t dim, const bool is_batch)
set dim to given indexer af_array idx
AFAPI af_err af_lookup(af_array *out, const af_array in, const af_array indices, const unsigned dim)
Lookup the values of an input array by indexing with another array.
AFAPI array lookup(const array &in, const array &idx, const int dim=-1)
Lookup the values of an input array by indexing with another array.
AFAPI seq span
A special value representing the entire axis of an af::array.
Struct used to index an af_array.
af_array arr
The af_array used for indexing.
bool isSeq
If true the idx value represents a seq.
bool isBatch
If true the seq object is a batch parameter.
af_seq seq
The af_seq used for indexing.
C-style struct to creating sequences for indexing.