Class Indices

Class Documentation

class Indices

Public Types

typedef std::vector<unsigned int> RowsChunk

RowsChunk a vector<unsigned int> of rows which are contiguous.

typedef std::list<RowsChunk> ChunkList

ChunkList a list<vector<int>>, a list of contiguous chunks of rows e.g., {{1,2},{4},{10,11,12}}, is a list of 3 chunks of contiguous row indices, where the first chunk has size 2, the second chunk has size 1, the third chunk has size 3.

Public Functions

Indices(unsigned int i)

SubTaskMap creates a SubTaskMap of size 1, with just one index.

Parameters

i

Indices(const std::list<unsigned int> &rowsList)
Indices(const std::vector<unsigned int> &rowsVector)
template<class Iterator>
inline Indices(Iterator it, const Iterator end)
Indices(const Indices &indices)
const ChunkList &getChunks() const
const std::list<unsigned int> &asList() const

asList returns the list of all rows as a list (first row has index 0)

Returns

a list of row indices (starting from 0)

const std::vector<unsigned int> &asVector() const

asVector returns the list of all rows as a vector (first row has index 0)

Returns

a vector of row indices (starting from 0)

Indices &shift(unsigned int amount)

shift shifts all indices by the amount specified

Parameters

amount – by which all indices will be shift

bool isContiguous() const
int size() const
Indices &filter(const OpenSoT::Indices &f)

filter modifies the current set of indices by picking only the entries specified in f (the entries are counted starting from 0) For example, if the current object contains a set of 13 indices, [2,14], and the filter f contains 3 indices, [0,3,5] the final object will contain just 3 indices, [2, 5, 7]

Parameters

f – the indices filter. Numbers here will specify the entries to keep in the filtered Indices set

Returns

the current object, with just the filtered index set.

Indices operator+(const Indices &b) const

operator + adds a set of indices to the current indices set

Parameters

b – the indices set to concatenate

Returns

a bigger indices set (sorted, without duplicates)

Indices operator+(const unsigned int r) const

operator + adds a new index to the current indices set

Parameters

r – the index to add to the set

Returns

a bigger indices set (sorted, without duplicates)

Indices operator-(const Indices &b) const

operator - removes a set of indices (if existing) from the current indices set

Parameters

b – the indices set to remove

Returns

a smaller indices set (sorted, without duplicates)

Indices operator-(const unsigned int r) const

operator - removes an index (if existing) from the current indices set

Parameters

r – the index to remove frin the set

Returns

a smaller indices set (sorted, without duplicates)

bool operator==(const Indices &b) const
operator std::string() const
operator std::list<unsigned int>() const

Public Static Functions

static Indices range(unsigned int from, unsigned int to)

range creates a range of integers, [from,to]

Parameters
  • from – the first index

  • to – the last index

Returns

an Indices object with a sequence of ints [from,to]