This repository has been archived by the owner on Dec 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
/
pairlist.h
80 lines (51 loc) · 1.55 KB
/
pairlist.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#ifndef PAIRLIST_H
#define PAIRLIST_H
#include "attractrigidbody.h"
#include <vector>
namespace PTools
{
struct AtomPair
{
uint atlig;
uint atrec;
};
/*! \brief Contains list of pairs of atoms in interaction
*
*
*/
class AttractPairList
{
public:
AttractPairList(const AttractRigidbody & receptor, const AttractRigidbody & ligand, dbl cutoff );
AttractPairList(const AttractRigidbody & receptor,const AttractRigidbody & ligand); ///< constructor with infinite cutoff ;
AttractPairList(){}; //null constructor for use with std::vector
~AttractPairList();
///update pairlist
void update();
///< Add a pair and checks if correct ligand and receptor are provided
void addPair(const AttractRigidbody& ligand, const AttractRigidbody& receptor, const AtomPair& pair) ;
///return the current cutoff
dbl GetCutoff() {
return sqrt(squarecutoff);
};
///return number of pairs of atoms in interaction (distance <= cutoff)
uint Size() {
return vectl.size();
};
/// get atom pair number i of the pairlist
AtomPair operator[](int i) {
AtomPair pair;
pair.atlig=vectl[i];
pair.atrec=vectr[i];
return pair;
};
private:
dbl squarecutoff ; ///< cutoff^2
const AttractRigidbody* mp_ligand;
const AttractRigidbody* mp_receptor;
bool no_update; ///< if true the pairlist is never updated
std::vector <uint> vectl ; ///< index of ligands atoms
std::vector <uint> vectr ; ///< index of receptor atoms
};
}//namespace PTools
#endif