#ifndef OPENMM_CPU_NEIGHBORLIST_H_ #define OPENMM_CPU_NEIGHBORLIST_H_ #include "windowsExportCpu.h" #include #include #include #include namespace OpenMM { class OPENMM_EXPORT_CPU CpuNeighborList { public: class ThreadData; class VoxelHash; CpuNeighborList(); ~CpuNeighborList(); void computeNeighborList(int numAtoms, const std::vector& atomLocations, const std::vector >& exclusions, const float* periodicBoxSize, bool usePeriodic, float maxDistance); const std::vector >& getNeighbors(); /** * This routine contains the code executed by each thread. */ void runThread(int index, std::vector >& threadNeighbors); private: bool isDeleted; int numThreads, waitCount; std::vector > neighbors; std::vector thread; std::vector threadData; pthread_cond_t startCondition, endCondition; pthread_mutex_t lock; // The following variables are used to make information accessible to the individual threads. VoxelHash* voxelHash; const std::vector >* exclusions; const float* atomLocations; const float* periodicBoxSize; int numAtoms; bool usePeriodic; float maxDistance; }; } // namespace OpenMM #endif // OPENMM_REFERENCE_NEIGHBORLIST_H_