-
Notifications
You must be signed in to change notification settings - Fork 1
/
ComputeAngles.inl
55 lines (45 loc) · 1.37 KB
/
ComputeAngles.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
49
50
51
52
53
54
/**
*** Copyright (c) 1995, 1996, 1997, 1998, 1999, 2000 by
*** The Board of Trustees of the University of Illinois.
*** All rights reserved.
**/
#ifndef COMPUTEANGLE_INL
#define COMPUTEANGLE_INL
#include "ComputeAngles.h"
inline AngleElem::AngleElem() { ; }
inline AngleElem::AngleElem(AtomID atom0, const TupleSignature *sig, const AngleValue *v){
atomID[0] = atom0;
atomID[1] = atom0 + sig->offset[0];
atomID[2] = atom0 + sig->offset[1];
value = &v[sig->tupleParamType];
}
inline AngleElem::AngleElem(const Angle *a, const AngleValue *v)
{
atomID[0] = a->atom1;
atomID[1] = a->atom2;
atomID[2] = a->atom3;
value = &v[a->angle_type];
}
inline AngleElem::AngleElem(AtomID atom0, AtomID atom1, AtomID atom2)
{
if (atom0 > atom2) { // Swap end atoms so lowest is first!
AtomID tmp = atom2; atom2 = atom0; atom0 = tmp;
}
atomID[0] = atom0;
atomID[1] = atom1;
atomID[2] = atom2;
}
inline int AngleElem::operator==(const AngleElem &a) const
{
return (a.atomID[0] == atomID[0] && a.atomID[1] == atomID[1] &&
a.atomID[2] == atomID[2]);
}
inline int AngleElem::operator<(const AngleElem &a) const
{
return (atomID[0] < a.atomID[0] ||
(atomID[0] == a.atomID[0] &&
(atomID[1] < a.atomID[1] ||
(atomID[1] == a.atomID[1] &&
atomID[2] < a.atomID[2]) )));
}
#endif