00001 00007 #ifndef COMPUTEBOND_INL 00008 #define COMPUTEBOND_INL 00009 00010 #include "ComputeBonds.h" 00011 00012 inline BondElem::BondElem() { ; } 00013 00014 inline BondElem::BondElem(AtomID atom0, const TupleSignature *sig, const BondValue *v){ 00015 atomID[0] = atom0; 00016 atomID[1] = atom0 + sig->offset[0]; 00017 value = &v[sig->tupleParamType]; 00018 } 00019 00020 inline BondElem::BondElem(const Bond *a, const BondValue *v) 00021 { 00022 atomID[0] = a->atom1; 00023 atomID[1] = a->atom2; 00024 value = &v[a->bond_type]; 00025 } 00026 00027 inline BondElem::BondElem(AtomID atom0, AtomID atom1) 00028 { 00029 if (atom0 > atom1) { // Swap end atoms so lowest is first! 00030 AtomID tmp = atom1; atom1 = atom0; atom0 = tmp; 00031 } 00032 atomID[0] = atom0; 00033 atomID[1] = atom1; 00034 } 00035 00036 inline int BondElem::operator==(const BondElem &a) const 00037 { 00038 return (a.atomID[0] == atomID[0] && a.atomID[1] == atomID[1]); 00039 } 00040 00041 inline int BondElem::operator<(const BondElem &a) const 00042 { 00043 return (atomID[0] < a.atomID[0] || 00044 (atomID[0] == a.atomID[0] && 00045 (atomID[1] < a.atomID[1]) )); 00046 } 00047 00048 #endif 00049
1.3.9.1