NAMD
ComputeNonbondedCUDAExcl.inl
Go to the documentation of this file.
1 
7 #ifndef COMPUTENONBONDEDCUDAEXCL_INL
8 #define COMPUTENONBONDEDCUDAEXCL_INL
9 
11 
12 inline ExclElem::ExclElem() { ; }
13 
14 inline ExclElem::ExclElem(AtomID atom0, const TupleSignature *sig, const int *v){
15  atomID[0] = atom0;
16  atomID[1] = atom0 + sig->offset[0];
17  modified = sig->tupleParamType;
18 }
19 
20 inline ExclElem::ExclElem(const Exclusion *a, const int *v)
21  {
22  atomID[0] = a->atom1;
23  atomID[1] = a->atom2;
24  modified = a->modified;
25  }
26 
27 inline ExclElem::ExclElem(AtomID atom0, AtomID atom1)
28  {
29  if (atom0 > atom1) { // Swap end atoms so lowest is first!
30  AtomID tmp = atom1; atom1 = atom0; atom0 = tmp;
31  }
32  atomID[0] = atom0;
33  atomID[1] = atom1;
34  }
35 
36 inline int ExclElem::operator==(const ExclElem &a) const
37  {
38  return (a.atomID[0] == atomID[0] && a.atomID[1] == atomID[1]);
39  }
40 
41 inline int ExclElem::operator<(const ExclElem &a) const
42  {
43  return (atomID[0] < a.atomID[0] ||
44  (atomID[0] == a.atomID[0] &&
45  (atomID[1] < a.atomID[1]) ));
46  }
47 
48 #endif
49 
int32 atom2
Definition: structures.h:160
int AtomID
Definition: NamdTypes.h:29
int operator==(const ExclElem &a) const
int operator<(const ExclElem &a) const
Index modified
Definition: structures.h:161
int32 atom1
Definition: structures.h:159
AtomID atomID[size]
Index tupleParamType
Definition: structures.h:202