Open Qmin  0.8.0
GPU-accelerated Q-tensor-based liquid crystal simulations
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. More...
 
HOSTDEVICE unsigned int getW () const
 Get the width. More...
 
HOSTDEVICE unsigned int getH () const
 get the height More...
 

Public Attributes

unsigned int width
 array width More...
 
unsigned int height
 array height More...
 

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

Constructor & Destructor Documentation

◆ Index2D() [1/2]

HOSTDEVICE Index2D::Index2D ( unsigned int  w = 0)
inline

◆ Index2D() [2/2]

HOSTDEVICE Index2D::Index2D ( unsigned int  w,
unsigned int  h 
)
inline

Member Function Documentation

◆ operator()()

HOSTDEVICE unsigned int Index2D::operator() ( unsigned int  i,
unsigned int  j 
) const
inline

References width.

◆ getNumElements()

HOSTDEVICE unsigned int Index2D::getNumElements ( ) const
inline

◆ getW()

HOSTDEVICE unsigned int Index2D::getW ( ) const
inline

Get the width.

References width.

◆ getH()

HOSTDEVICE unsigned int Index2D::getH ( ) const
inline

get the height

References height.

Member Data Documentation

◆ width

unsigned int Index2D::width

array width

Referenced by getNumElements(), getW(), and operator()().

◆ height

unsigned int Index2D::height

array height

Referenced by getH(), and getNumElements().


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