#include <ComputeLCPO.h>
Public Member Functions | |
LCPONeighborList () | |
~LCPONeighborList () | |
LCPOAtom * | newlist (int max_size) |
LCPOAtom * | newlist () |
void | newsize (int list_size) |
void | reset () |
void | nextlist (LCPOAtom **list, int *list_size) |
int | getSize () |
Definition at line 27 of file ComputeLCPO.h.
LCPONeighborList::LCPONeighborList | ( | ) | [inline] |
Definition at line 38 of file ComputeLCPO.h.
00038 : 00039 maxNeighbors(initsize), maxAtoms(initsize), 00040 curNeighbor(0), curAtom(0) { 00041 neighbors = new LCPOAtom[initsize]; 00042 nnfa = new int[initsize]; 00043 } ~LCPONeighborList() {
LCPONeighborList::~LCPONeighborList | ( | ) | [inline] |
Definition at line 44 of file ComputeLCPO.h.
int LCPONeighborList::getSize | ( | ) | [inline] |
Definition at line 90 of file ComputeLCPO.h.
LCPOAtom* LCPONeighborList::newlist | ( | ) | [inline] |
Definition at line 72 of file ComputeLCPO.h.
LCPOAtom* LCPONeighborList::newlist | ( | int | max_size | ) | [inline] |
Definition at line 48 of file ComputeLCPO.h.
Referenced by ComputeLCPO::doForce().
00048 { // get a new list w/ room for max_size 00049 //do we need to make room for more neighbors 00050 int reqNewSize = curNeighbor + max_size; 00051 int newSize = maxNeighbors; 00052 while ( newSize < reqNewSize ) { newSize += newSize >> 1; } 00053 if ( newSize > maxNeighbors ) { 00054 LCPOAtom *newNeighbors = new LCPOAtom[newSize]; 00055 CmiMemcpy(newNeighbors,neighbors,curNeighbor*sizeof(LCPOAtom)); 00056 delete [] neighbors; 00057 neighbors = newNeighbors; 00058 maxNeighbors = newSize; 00059 } 00060 //do we need to make room for more atoms 00061 if (curAtom == maxAtoms) { 00062 newSize = maxAtoms + (maxAtoms >> 1); 00063 int *newNnfa = new int[newSize]; 00064 CmiMemcpy(newNnfa,nnfa,curAtom*sizeof(int)); 00065 delete [] nnfa; 00066 nnfa = newNnfa; 00067 maxAtoms = newSize; 00068 } 00069 return &neighbors[curNeighbor]; 00070 }
void LCPONeighborList::newsize | ( | int | list_size | ) | [inline] |
Definition at line 75 of file ComputeLCPO.h.
Referenced by ComputeLCPO::doForce().
void LCPONeighborList::nextlist | ( | LCPOAtom ** | list, | |
int * | list_size | |||
) | [inline] |
Definition at line 84 of file ComputeLCPO.h.
Referenced by ComputeLCPO::doForce().
void LCPONeighborList::reset | ( | ) | [inline] |
Definition at line 80 of file ComputeLCPO.h.
Referenced by ComputeLCPO::doForce().