Class PackedIndex

Class Documentation

class PackedIndex

An iterator-like object to help in traversing “packed” shapelet or Hermite polynomial matrix or vector dimensions.

A pair of indices (x,y) is mapped to the packed position i = (x+y)(x+y+1)/2 + x.

Typical usage is in a nested loop of the form:

for (PackedIndex i; i.getOrder() <= order; ++i) {
    // utilize i
}

Public Functions

PackedIndex &operator++()
int const getOrder() const
int const getX() const
int const getY() const
int const getIndex() const
PackedIndex()
PackedIndex(int const x, int const y)

Public Static Functions

static int const computeOffset(int order)
static int const computeIndex(int x, int y)