A high-performance general-purpose compute library

- Main Page
- Tutorials
- Release Notes
- Examples

Public Member Functions
index Class Reference
ArrayFire Classes

Wrapper for af_index. More...

`#include <index.h>`

## Public Member Functions
| index ()
| Default constructor.
| ~index ()
| index (const int idx)
| Implicit int converter.
| index (const af::seq &s0)
| Implicit seq converter.
| index (const af_seq &s0)
| Implicit seq converter.
| index (const af::array &idx0)
| Implicit int converter.
| index (const index &idx0)
| Copy constructor.
bool | isspan () const
| Returns true if the af::index represents a af::span object.
const af_index_t & | get () const
| Gets the underlying af_index_t object.
index & | operator= (const index &idx0)
| Assigns idx0 to this index.

## 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] | idx | is 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] | s0 | is 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] | s0 | is 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] | idx0 | is the set of indices to parse

See also
  indexing

## ◆ index() [6/6]

index | ( | const index & | idx0 | ) |

Copy constructor.

Parameters

  [in] | idx0 | is 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] | idx0 | is 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:

- index.h