ComputeDihedrals.inl

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

Generated on Thu Sep 21 01:17:10 2017 for NAMD by  doxygen 1.4.7