KrisLibrary  1.0.0
Public Member Functions | Public Attributes | List of all members
ArrayMapping Struct Reference

An invertible mapping from indices in [0,imax), which operates in two modes: offset mode adds an offset, and mapping mode stores an explicit mapping. More...

#include <ArrayMapping.h>

Public Member Functions

bool IsOffset () const
 
int Size () const
 
void SetOffset (int offset, int imax)
 
int Map (int i) const
 
int InvMap (int imap) const
 
template<class A >
void Map (const A &x, A &mapx) const
 
template<class A >
void InvMap (const A &mapx, A &x) const
 

Public Attributes

std::vector< int > mapping
 
int imax
 
int offset
 

Detailed Description

An invertible mapping from indices in [0,imax), which operates in two modes: offset mode adds an offset, and mapping mode stores an explicit mapping.

Maps array indices i in [0,imax) to either:


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