AtomSigInfo Struct Reference

List of all members.

Public Member Functions

 AtomSigInfo ()
 AtomSigInfo (const AtomSigInfo &sig)
 ~AtomSigInfo ()
void sortTupleSigIndices ()
CkHashCode hash () const

Public Attributes

vector< SigIndexbondSigIndices
vector< SigIndexangleSigIndices
vector< SigIndexdihedralSigIndices
vector< SigIndeximproperSigIndices
vector< SigIndexcrosstermSigIndices

Detailed Description

Definition at line 56 of file CompressPsf.C.


Constructor & Destructor Documentation

AtomSigInfo::AtomSigInfo (  )  [inline]

Definition at line 64 of file CompressPsf.C.

00065     {}

AtomSigInfo::AtomSigInfo ( const AtomSigInfo sig  )  [inline]

Definition at line 66 of file CompressPsf.C.

References angleSigIndices, bondSigIndices, crosstermSigIndices, dihedralSigIndices, and improperSigIndices.

00067     {
00068         bondSigIndices.clear();
00069         for(int i=0; i<sig.bondSigIndices.size(); i++)
00070             bondSigIndices.push_back(sig.bondSigIndices[i]);
00071 
00072         angleSigIndices.clear();
00073         for(int i=0; i<sig.angleSigIndices.size(); i++)
00074             angleSigIndices.push_back(sig.angleSigIndices[i]);
00075 
00076         dihedralSigIndices.clear();
00077         for(int i=0; i<sig.dihedralSigIndices.size(); i++)
00078             dihedralSigIndices.push_back(sig.dihedralSigIndices[i]);
00079 
00080         improperSigIndices.clear();
00081         for(int i=0; i<sig.improperSigIndices.size(); i++)
00082             improperSigIndices.push_back(sig.improperSigIndices[i]);
00083 
00084         crosstermSigIndices.clear();
00085         for(int i=0; i<sig.crosstermSigIndices.size(); i++)
00086             crosstermSigIndices.push_back(sig.crosstermSigIndices[i]);
00087     }

AtomSigInfo::~AtomSigInfo (  )  [inline]

Definition at line 89 of file CompressPsf.C.

References angleSigIndices, bondSigIndices, crosstermSigIndices, dihedralSigIndices, and improperSigIndices.

00090     {
00091         bondSigIndices.clear();
00092         angleSigIndices.clear();
00093         dihedralSigIndices.clear();
00094         improperSigIndices.clear();
00095         crosstermSigIndices.clear();
00096     }


Member Function Documentation

CkHashCode AtomSigInfo::hash (  )  const [inline]

Definition at line 107 of file CompressPsf.C.

References angleSigIndices, bondSigIndices, crosstermSigIndices, dihedralSigIndices, improperSigIndices, and j.

00107                                    {
00108       // What's a good hash function for this? Lets make something up
00109       // Concatenate all the index lists into a list of chars, then hash that
00110       // string using Charm's string hash function
00111 
00112       // To keep memory allocation cheap, we'll just use a 32-byte buffer
00113       // and wrap around if we have more sigs
00114       const int maxlen = 32;
00115       unsigned char keydata[maxlen+1];
00116       const int maxchar = 256;
00117       int i,j;
00118       for(j=0;j<=maxlen;j++) keydata[j] = 0;
00119       j=0;
00120       for(i=0; i<bondSigIndices.size(); i++,j++) {
00121         keydata[j % maxlen] ^= (bondSigIndices[i] % maxchar);
00122       }
00123       for(i=0; i<angleSigIndices.size(); i++,j++) {
00124         keydata[j % maxlen] ^= (angleSigIndices[i] % maxchar);
00125       }
00126       for(i=0; i<dihedralSigIndices.size(); i++,j++) {
00127         keydata[j % maxlen] ^= (dihedralSigIndices[i] % maxchar);
00128       }
00129       for(i=0; i<improperSigIndices.size(); i++,j++) {
00130         keydata[j % maxlen] ^= (improperSigIndices[i] % maxchar);
00131       }
00132       for(i=0; i<crosstermSigIndices.size(); i++,j++) {
00133         keydata[j % maxlen] ^= (crosstermSigIndices[i] % maxchar);
00134       }
00135 //      CmiPrintf("Computed hash string len %d,%d\n",j,maxlen);
00136       if (j > maxlen) j = maxlen;
00137 //      for(i=0; i < j; i++) {
00138 //        if (keydata[i] == 0)
00139 //          keydata[i] = 255;
00140 //        CmiPrintf("key[%d]=%d %p\n",i,keydata[i],keydata);
00141 //      }
00142       return CkHashFunction_default((const void*)keydata,(size_t)j);
00143     }

void AtomSigInfo::sortTupleSigIndices (  )  [inline]

Definition at line 98 of file CompressPsf.C.

References angleSigIndices, bondSigIndices, crosstermSigIndices, dihedralSigIndices, and improperSigIndices.

00099     {
00100         sort(bondSigIndices.begin(), bondSigIndices.end());
00101         sort(angleSigIndices.begin(), angleSigIndices.end());
00102         sort(dihedralSigIndices.begin(), dihedralSigIndices.end());
00103         sort(improperSigIndices.begin(), improperSigIndices.end());
00104         sort(crosstermSigIndices.begin(), crosstermSigIndices.end());
00105     }


Member Data Documentation

vector<SigIndex> AtomSigInfo::angleSigIndices

Definition at line 59 of file CompressPsf.C.

Referenced by AtomSigInfo(), buildAngleData(), hash(), operator==(), sortTupleSigIndices(), and ~AtomSigInfo().

vector<SigIndex> AtomSigInfo::bondSigIndices

Definition at line 58 of file CompressPsf.C.

Referenced by AtomSigInfo(), buildBondData(), hash(), operator==(), sortTupleSigIndices(), and ~AtomSigInfo().

vector<SigIndex> AtomSigInfo::crosstermSigIndices

Definition at line 62 of file CompressPsf.C.

Referenced by AtomSigInfo(), buildCrosstermData(), hash(), operator==(), sortTupleSigIndices(), and ~AtomSigInfo().

vector<SigIndex> AtomSigInfo::dihedralSigIndices

Definition at line 60 of file CompressPsf.C.

Referenced by AtomSigInfo(), buildDihedralData(), hash(), operator==(), sortTupleSigIndices(), and ~AtomSigInfo().

vector<SigIndex> AtomSigInfo::improperSigIndices

Definition at line 61 of file CompressPsf.C.

Referenced by AtomSigInfo(), buildImproperData(), hash(), operator==(), sortTupleSigIndices(), and ~AtomSigInfo().


The documentation for this struct was generated from the following file:
Generated on Tue Nov 21 01:17:17 2017 for NAMD by  doxygen 1.4.7