ComputeAngles.inl

Go to the documentation of this file.
00001 
00007 #ifndef COMPUTEANGLE_INL
00008 #define COMPUTEANGLE_INL
00009 
00010 #include "ComputeAngles.h"
00011 
00012 inline AngleElem::AngleElem() { ; }
00013 
00014 inline AngleElem::AngleElem(AtomID atom0, const TupleSignature *sig, const AngleValue *v){
00015     atomID[0] = atom0;
00016     atomID[1] = atom0 + sig->offset[0];
00017     atomID[2] = atom0 + sig->offset[1];
00018     value = &v[sig->tupleParamType];
00019 }
00020 
00021 inline AngleElem::AngleElem(const Angle *a, const AngleValue *v)
00022   {
00023     atomID[0] = a->atom1;
00024     atomID[1] = a->atom2;
00025     atomID[2] = a->atom3;
00026     value = &v[a->angle_type];
00027   }
00028 
00029 inline AngleElem::AngleElem(AtomID atom0, AtomID atom1, AtomID atom2)
00030   {
00031     if (atom0 > atom2) {  // Swap end atoms so lowest is first!
00032       AtomID tmp = atom2; atom2 = atom0; atom0 = tmp; 
00033     }
00034     atomID[0] = atom0;
00035     atomID[1] = atom1;
00036     atomID[2] = atom2;
00037   }
00038 
00039 inline int AngleElem::operator==(const AngleElem &a) const
00040   {
00041     return (a.atomID[0] == atomID[0] && a.atomID[1] == atomID[1] &&
00042         a.atomID[2] == atomID[2]);
00043   }
00044 
00045 inline int AngleElem::operator<(const AngleElem &a) const
00046   {
00047     return (atomID[0] < a.atomID[0] ||
00048             (atomID[0] == a.atomID[0] &&
00049             (atomID[1] < a.atomID[1] ||
00050             (atomID[1] == a.atomID[1] &&
00051              atomID[2] < a.atomID[2]) )));
00052   }
00053 
00054 #endif
00055 

Generated on Mon Nov 20 01:17:10 2017 for NAMD by  doxygen 1.4.7