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

peastman's avatar
peastman committed
4
#include "openmm/Vec3.h"
5
#include "openmm/internal/windowsExport.h"
6
7
8
9
10
#include <set>
#include <vector>

namespace OpenMM {

peastman's avatar
peastman committed
11
typedef std::vector<Vec3> 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,
peastman's avatar
peastman committed
25
                              const Vec3* periodicBoxVectors,
26
                              bool usePeriodic,
27
28
29
                              double maxDistance,
                              double minDistance = 0.0,
                              bool reportSymmetricPairs = false
30
                            );
31
32
33
34
35
36
37

// 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,
38
                              const AtomLocationList& atomLocations,
39
                              const std::vector<std::set<int> >& exclusions,
peastman's avatar
peastman committed
40
                              const Vec3* periodicBoxVectors,
41
                              bool usePeriodic,
42
43
44
                              double maxDistance,
                              double minDistance = 0.0,
                              bool reportSymmetricPairs = false
45
                            );
46
47
48
49

} // namespace OpenMM

#endif // OPENMM_REFERENCE_NEIGHBORLIST_H_