-
Notifications
You must be signed in to change notification settings - Fork 1
/
ComputeBonds.inl
49 lines (39 loc) · 1.14 KB
/
ComputeBonds.inl
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
/**
*** Copyright (c) 1995, 1996, 1997, 1998, 1999, 2000 by
*** The Board of Trustees of the University of Illinois.
*** All rights reserved.
**/
#ifndef COMPUTEBOND_INL
#define COMPUTEBOND_INL
#include "ComputeBonds.h"
inline BondElem::BondElem() { ; }
inline BondElem::BondElem(AtomID atom0, const TupleSignature *sig, const BondValue *v){
atomID[0] = atom0;
atomID[1] = atom0 + sig->offset[0];
value = &v[sig->tupleParamType];
}
inline BondElem::BondElem(const Bond *a, const BondValue *v)
{
atomID[0] = a->atom1;
atomID[1] = a->atom2;
value = &v[a->bond_type];
}
inline BondElem::BondElem(AtomID atom0, AtomID atom1)
{
if (atom0 > atom1) { // Swap end atoms so lowest is first!
AtomID tmp = atom1; atom1 = atom0; atom0 = tmp;
}
atomID[0] = atom0;
atomID[1] = atom1;
}
inline int BondElem::operator==(const BondElem &a) const
{
return (a.atomID[0] == atomID[0] && a.atomID[1] == atomID[1]);
}
inline int BondElem::operator<(const BondElem &a) const
{
return (atomID[0] < a.atomID[0] ||
(atomID[0] == a.atomID[0] &&
(atomID[1] < a.atomID[1]) ));
}
#endif