ExclSigInfo Struct Reference

List of all members.

Public Member Functions

 ExclSigInfo ()
 ExclSigInfo (const ExclSigInfo &sig)
 ~ExclSigInfo ()
void sortExclOffset ()
int hash () const

Public Attributes

vector< int > fullExclOffset
vector< int > modExclOffset

Detailed Description

Definition at line 198 of file CompressPsf.C.


Constructor & Destructor Documentation

ExclSigInfo::ExclSigInfo (  )  [inline]

Definition at line 203 of file CompressPsf.C.

00204     {}

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

Definition at line 205 of file CompressPsf.C.

References fullExclOffset, and modExclOffset.

00206     {
00207         fullExclOffset.clear();
00208         for(int i=0; i<sig.fullExclOffset.size(); i++)
00209             fullExclOffset.push_back(sig.fullExclOffset[i]);
00210 
00211         modExclOffset.clear();
00212         for(int i=0; i<sig.modExclOffset.size(); i++)
00213             modExclOffset.push_back(sig.modExclOffset[i]);
00214     }

ExclSigInfo::~ExclSigInfo (  )  [inline]

Definition at line 216 of file CompressPsf.C.

References fullExclOffset, and modExclOffset.

00217     {
00218         fullExclOffset.clear();
00219         modExclOffset.clear();
00220     }


Member Function Documentation

int ExclSigInfo::hash (  )  const [inline]

Definition at line 228 of file CompressPsf.C.

References circShift(), fullExclOffset, and modExclOffset.

00228                      {
00229       unsigned int code = 0x1234;
00230       unsigned int codesz = 8 * sizeof(int);
00231       const unsigned int numFoffset = fullExclOffset.size();
00232       const unsigned int numMoffset = modExclOffset.size();
00233       const unsigned int numOffsets = numFoffset + numMoffset;
00234       
00235       // No excluded atoms? Just hash to 0
00236       if (numOffsets == 0)
00237         return 0;
00238       
00239       unsigned int shift = codesz / numOffsets;
00240       if (shift == 0) shift=1;
00241       unsigned int i;
00242       for(i=0; i < numFoffset; i++) {
00243         code = circShift(code,shift);
00244         code ^= fullExclOffset[i];
00245       }
00246       for(i=0; i < numMoffset; i++) {
00247         code = circShift(code,shift);
00248         code ^= modExclOffset[i];
00249       }
00250       return code;
00251     }

void ExclSigInfo::sortExclOffset (  )  [inline]

Definition at line 222 of file CompressPsf.C.

References fullExclOffset, and modExclOffset.

00223     {
00224         sort(fullExclOffset.begin(), fullExclOffset.end());
00225         sort(modExclOffset.begin(), modExclOffset.end());
00226     }


Member Data Documentation

vector<int> ExclSigInfo::fullExclOffset

Definition at line 200 of file CompressPsf.C.

Referenced by buildExclusions(), ExclSigInfo(), hash(), operator==(), sortExclOffset(), and ~ExclSigInfo().

vector<int> ExclSigInfo::modExclOffset

Definition at line 201 of file CompressPsf.C.

Referenced by buildExclusions(), ExclSigInfo(), hash(), operator==(), sortExclOffset(), and ~ExclSigInfo().


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