Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

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

Constructor & Destructor Documentation

AtomSigInfo::AtomSigInfo  )  [inline]
 

Definition at line 58 of file CompressPsf.C.

00059     {}

AtomSigInfo::AtomSigInfo const AtomSigInfo sig  )  [inline]
 

Definition at line 60 of file CompressPsf.C.

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

00061     {
00062         bondSigIndices.clear();
00063         for(int i=0; i<sig.bondSigIndices.size(); i++)
00064             bondSigIndices.push_back(sig.bondSigIndices[i]);
00065 
00066         angleSigIndices.clear();
00067         for(int i=0; i<sig.angleSigIndices.size(); i++)
00068             angleSigIndices.push_back(sig.angleSigIndices[i]);
00069 
00070         dihedralSigIndices.clear();
00071         for(int i=0; i<sig.dihedralSigIndices.size(); i++)
00072             dihedralSigIndices.push_back(sig.dihedralSigIndices[i]);
00073 
00074         improperSigIndices.clear();
00075         for(int i=0; i<sig.improperSigIndices.size(); i++)
00076             improperSigIndices.push_back(sig.improperSigIndices[i]);
00077 
00078         crosstermSigIndices.clear();
00079         for(int i=0; i<sig.crosstermSigIndices.size(); i++)
00080             crosstermSigIndices.push_back(sig.crosstermSigIndices[i]);
00081     }

AtomSigInfo::~AtomSigInfo  )  [inline]
 

Definition at line 83 of file CompressPsf.C.

00084     {
00085         bondSigIndices.clear();
00086         angleSigIndices.clear();
00087         dihedralSigIndices.clear();
00088         improperSigIndices.clear();
00089         crosstermSigIndices.clear();
00090     }


Member Function Documentation

CkHashCode AtomSigInfo::hash  )  const [inline]
 

Definition at line 101 of file CompressPsf.C.

References j.

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

void AtomSigInfo::sortTupleSigIndices  )  [inline]
 

Definition at line 92 of file CompressPsf.C.

Referenced by integrateAllAtomSigs().

00093     {
00094         sort(bondSigIndices.begin(), bondSigIndices.end());
00095         sort(angleSigIndices.begin(), angleSigIndices.end());
00096         sort(dihedralSigIndices.begin(), dihedralSigIndices.end());
00097         sort(improperSigIndices.begin(), improperSigIndices.end());
00098         sort(crosstermSigIndices.begin(), crosstermSigIndices.end());
00099     }


Member Data Documentation

vector<SigIndex> AtomSigInfo::angleSigIndices
 

Definition at line 53 of file CompressPsf.C.

Referenced by AtomSigInfo(), buildAngleData(), getAngleData(), operator==(), outputCompressedFile(), and outputPsfFile().

vector<SigIndex> AtomSigInfo::bondSigIndices
 

Definition at line 52 of file CompressPsf.C.

Referenced by AtomSigInfo(), buildBondData(), buildExclusions(), getBondData(), operator==(), outputCompressedFile(), and outputPsfFile().

vector<SigIndex> AtomSigInfo::crosstermSigIndices
 

Definition at line 56 of file CompressPsf.C.

Referenced by AtomSigInfo(), buildCrosstermData(), getCrosstermData(), operator==(), outputCompressedFile(), and outputPsfFile().

vector<SigIndex> AtomSigInfo::dihedralSigIndices
 

Definition at line 54 of file CompressPsf.C.

Referenced by AtomSigInfo(), buildDihedralData(), getDihedralData(), operator==(), outputCompressedFile(), and outputPsfFile().

vector<SigIndex> AtomSigInfo::improperSigIndices
 

Definition at line 55 of file CompressPsf.C.

Referenced by AtomSigInfo(), buildImproperData(), getImproperData(), operator==(), outputCompressedFile(), and outputPsfFile().


The documentation for this struct was generated from the following file:
Generated on Mon Nov 23 04:59:31 2009 for NAMD by  doxygen 1.3.9.1