CellGPU  0.8.0
GPU-accelerated simulations of cells
Public Member Functions | Public Attributes | List of all members
Index2D Class Reference

Switch between a 2D array to a flattened, 1D index. More...

#include <indexer.h>

Public Member Functions

HOSTDEVICE Index2D (unsigned int w=0)
 
HOSTDEVICE Index2D (unsigned int w, unsigned int h)
 
HOSTDEVICE unsigned int operator() (unsigned int i, unsigned int j) const
 
HOSTDEVICE unsigned int getNumElements () const
 Return the number of elements that the indexer can index.
 
HOSTDEVICE unsigned int getW () const
 Get the width.
 
HOSTDEVICE unsigned int getH () const
 get the height
 

Public Attributes

unsigned int width
 array width
 
unsigned int height
 array height
 

Detailed Description

Switch between a 2D array to a flattened, 1D index.

A class for converting between a 2d index and a 1-d array, which makes calculation on the GPU a bit easier. This was inspired by the indexer class of Hoomd-blue


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