A high-performance general-purpose compute library
index Class Reference

Wrapper for af_index. More...

#include <index.h>

Public Member Functions

 index ()
 Default constructor. More...
 
 ~index ()
 
 index (const int idx)
 Implicit int converter. More...
 
 index (const af::seq &s0)
 Implicit seq converter. More...
 
 index (const af_seq &s0)
 Implicit seq converter. More...
 
 index (const af::array &idx0)
 Implicit int converter. More...
 
 index (const index &idx0)
 Copy constructor. More...
 
bool isspan () const
 Returns true if the af::index represents a af::span object. More...
 
const af_index_tget () const
 Gets the underlying af_index_t object. More...
 
indexoperator= (const index &idx0)
 Assigns idx0 to this index. More...
 

Detailed Description

Wrapper for af_index.

This class is a wrapper for the af_index struct in the C interface. It allows implicit type conversion from valid indexing types like int, af::seq, af_seq, and af::array.

Note
This is a helper class and does not necessarily need to be created explicitly. It is used in the operator() overloads to simplify the API.

Definition at line 52 of file index.h.

Constructor & Destructor Documentation

◆ index() [1/6]

index ( )

Default constructor.

Equivalent to af::span

◆ ~index()

~index ( )

◆ index() [2/6]

index ( const int  idx)

Implicit int converter.

Indexes the af::array at index idx

Parameters
[in]idxis the id of the index
See also
indexing

◆ index() [3/6]

index ( const af::seq s0)

Implicit seq converter.

Indexes the af::array using an af::seq object

Parameters
[in]s0is the set of indices to parse
See also
indexing

◆ index() [4/6]

index ( const af_seq s0)

Implicit seq converter.

Indexes the af::array using an af_seq object

Parameters
[in]s0is the set of indices to parse
See also
indexing

◆ index() [5/6]

index ( const af::array idx0)

Implicit int converter.

Indexes the af::array using an af::array object

Parameters
[in]idx0is the set of indices to parse
See also
indexing

◆ index() [6/6]

index ( const index idx0)

Copy constructor.

Parameters
[in]idx0is index to copy.
See also
indexing

Member Function Documentation

◆ get()

const af_index_t & get ( ) const

Gets the underlying af_index_t object.

Returns
the af_index_t represented by this object

◆ isspan()

bool isspan ( ) const

Returns true if the af::index represents a af::span object.

Returns
true if the af::index is an af::span

◆ operator=()

index & operator= ( const index idx0)

Assigns idx0 to this index.

Parameters
[in]idx0is the index to be assigned to the /ref af::index
Returns
the reference to this

The documentation for this class was generated from the following file: