ReferenceNeighborList.h 1.93 KB
Newer Older
1
2
3
#ifndef OPENMM_REFERENCE_NEIGHBORLIST_H_
#define OPENMM_REFERENCE_NEIGHBORLIST_H_

4
#include "RealVec.h"
5
#include "openmm/internal/windowsExport.h"
6
7
8
9
10
#include <set>
#include <vector>

namespace OpenMM {

11
typedef std::vector<RealVec> AtomLocationList;
12
13
14
15
16
17
18
19
20
21
22
23
24
typedef unsigned int AtomIndex;
typedef std::pair<AtomIndex, AtomIndex> AtomPair;
typedef std::vector<AtomPair>  NeighborList;

// Ridiculous O(n^2) version of neighbor list
// for pedagogical purposes and simplicity
// parameter neighborList is automatically clear()ed before 
// neighbors are added
void OPENMM_EXPORT computeNeighborListNaive(
                              NeighborList& neighborList,
                              int nAtoms,
                              const AtomLocationList& atomLocations, 
                              const std::vector<std::set<int> >& exclusions,
25
26
                              const RealVec& periodicBoxSize,
                              bool usePeriodic,
27
28
29
30
31
32
33
34
35
36
37
38
39
                              double maxDistance,
                              double minDistance = 0.0,
                              bool reportSymmetricPairs = false
                             );

// O(n) neighbor list method using voxel hash data structure
// parameter neighborList is automatically clear()ed before 
// neighbors are added
void OPENMM_EXPORT computeNeighborListVoxelHash(
                              NeighborList& neighborList,
                              int nAtoms,
                              const AtomLocationList& atomLocations, 
                              const std::vector<std::set<int> >& exclusions,
40
41
                              const RealVec& periodicBoxSize,
                              bool usePeriodic,
42
43
44
45
46
47
48
49
                              double maxDistance,
                              double minDistance = 0.0,
                              bool reportSymmetricPairs = false
                             );

} // namespace OpenMM

#endif // OPENMM_REFERENCE_NEIGHBORLIST_H_