Open Qmin  0.8.0
GPU-accelerated Q-tensor-based liquid crystal simulations
Public Member Functions | Public Attributes | List of all members
IndexDD Class Reference

Switch between a d-dimensional grid to a flattened, 1D index. More...

#include <indexer.h>

Collaboration diagram for IndexDD:
Collaboration graph
[legend]

Public Member Functions

HOSTDEVICE IndexDD (unsigned int w=0)
 
HOSTDEVICE IndexDD (iVec w)
 
HOSTDEVICE void setSizes (unsigned int w)
 
HOSTDEVICE void setSizes (iVec w)
 
HOSTDEVICE unsigned int operator() (const iVec &i) const
 
HOSTDEVICE iVec inverseIndex (int i)
 What iVec would correspond to a given unsigned int IndexDD(iVec) More...
 
HOSTDEVICE unsigned int getNumElements () const
 Return the number of elements that the indexer can index. More...
 
HOSTDEVICE iVec getSizes () const
 Get the iVec of sizes. More...
 

Public Attributes

iVec sizes
 a list of the size of the full array in each of the d dimensions More...
 
iVec intermediateSizes
 intermediateSizes[a] = Product_{d<=a} sizes. intermediateSizes[0]=1; More...
 
unsigned int numberOfElements
 
unsigned int width
 The total number of elements that the indexer can index. More...
 

Detailed Description

Switch between a d-dimensional grid 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

◆ IndexDD() [1/2]

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

References setSizes().

◆ IndexDD() [2/2]

HOSTDEVICE IndexDD::IndexDD ( iVec  w)
inline

References setSizes().

Member Function Documentation

◆ setSizes() [1/2]

HOSTDEVICE void IndexDD::setSizes ( unsigned int  w)
inline

References intermediateSizes, numberOfElements, sizes, and iVec::x.

Referenced by IndexDD().

◆ setSizes() [2/2]

HOSTDEVICE void IndexDD::setSizes ( iVec  w)
inline

◆ operator()()

HOSTDEVICE unsigned int IndexDD::operator() ( const iVec i) const
inline

References dot(), and intermediateSizes.

◆ inverseIndex()

HOSTDEVICE iVec IndexDD::inverseIndex ( int  i)
inline

◆ getNumElements()

HOSTDEVICE unsigned int IndexDD::getNumElements ( ) const
inline

Return the number of elements that the indexer can index.

References numberOfElements.

◆ getSizes()

HOSTDEVICE iVec IndexDD::getSizes ( ) const
inline

Get the iVec of sizes.

References sizes.

Member Data Documentation

◆ sizes

iVec IndexDD::sizes

a list of the size of the full array in each of the d dimensions

Referenced by getSizes(), inverseIndex(), and setSizes().

◆ intermediateSizes

iVec IndexDD::intermediateSizes

intermediateSizes[a] = Product_{d<=a} sizes. intermediateSizes[0]=1;

Referenced by operator()(), and setSizes().

◆ numberOfElements

unsigned int IndexDD::numberOfElements

Referenced by getNumElements(), and setSizes().

◆ width

unsigned int IndexDD::width

The total number of elements that the indexer can index.

array width


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