NAMD
Public Member Functions | Public Attributes | List of all members
AtomSigInfo Struct Reference

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.

65  {}
AtomSigInfo::AtomSigInfo ( const AtomSigInfo sig)
inline

Definition at line 66 of file CompressPsf.C.

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

67  {
68  bondSigIndices.clear();
69  for(int i=0; i<sig.bondSigIndices.size(); i++)
70  bondSigIndices.push_back(sig.bondSigIndices[i]);
71 
72  angleSigIndices.clear();
73  for(int i=0; i<sig.angleSigIndices.size(); i++)
74  angleSigIndices.push_back(sig.angleSigIndices[i]);
75 
76  dihedralSigIndices.clear();
77  for(int i=0; i<sig.dihedralSigIndices.size(); i++)
78  dihedralSigIndices.push_back(sig.dihedralSigIndices[i]);
79 
80  improperSigIndices.clear();
81  for(int i=0; i<sig.improperSigIndices.size(); i++)
82  improperSigIndices.push_back(sig.improperSigIndices[i]);
83 
84  crosstermSigIndices.clear();
85  for(int i=0; i<sig.crosstermSigIndices.size(); i++)
86  crosstermSigIndices.push_back(sig.crosstermSigIndices[i]);
87  }
vector< SigIndex > crosstermSigIndices
Definition: CompressPsf.C:62
vector< SigIndex > improperSigIndices
Definition: CompressPsf.C:61
vector< SigIndex > bondSigIndices
Definition: CompressPsf.C:58
vector< SigIndex > angleSigIndices
Definition: CompressPsf.C:59
vector< SigIndex > dihedralSigIndices
Definition: CompressPsf.C:60
AtomSigInfo::~AtomSigInfo ( )
inline

Definition at line 89 of file CompressPsf.C.

90  {
91  bondSigIndices.clear();
92  angleSigIndices.clear();
93  dihedralSigIndices.clear();
94  improperSigIndices.clear();
95  crosstermSigIndices.clear();
96  }
vector< SigIndex > crosstermSigIndices
Definition: CompressPsf.C:62
vector< SigIndex > improperSigIndices
Definition: CompressPsf.C:61
vector< SigIndex > bondSigIndices
Definition: CompressPsf.C:58
vector< SigIndex > angleSigIndices
Definition: CompressPsf.C:59
vector< SigIndex > dihedralSigIndices
Definition: CompressPsf.C:60

Member Function Documentation

CkHashCode AtomSigInfo::hash ( ) const
inline

Definition at line 107 of file CompressPsf.C.

107  {
108  // What's a good hash function for this? Lets make something up
109  // Concatenate all the index lists into a list of chars, then hash that
110  // string using Charm's string hash function
111 
112  // To keep memory allocation cheap, we'll just use a 32-byte buffer
113  // and wrap around if we have more sigs
114  const int maxlen = 32;
115  unsigned char keydata[maxlen+1];
116  const int maxchar = 256;
117  int i,j;
118  for(j=0;j<=maxlen;j++) keydata[j] = 0;
119  j=0;
120  for(i=0; i<bondSigIndices.size(); i++,j++) {
121  keydata[j % maxlen] ^= (bondSigIndices[i] % maxchar);
122  }
123  for(i=0; i<angleSigIndices.size(); i++,j++) {
124  keydata[j % maxlen] ^= (angleSigIndices[i] % maxchar);
125  }
126  for(i=0; i<dihedralSigIndices.size(); i++,j++) {
127  keydata[j % maxlen] ^= (dihedralSigIndices[i] % maxchar);
128  }
129  for(i=0; i<improperSigIndices.size(); i++,j++) {
130  keydata[j % maxlen] ^= (improperSigIndices[i] % maxchar);
131  }
132  for(i=0; i<crosstermSigIndices.size(); i++,j++) {
133  keydata[j % maxlen] ^= (crosstermSigIndices[i] % maxchar);
134  }
135 // CmiPrintf("Computed hash string len %d,%d\n",j,maxlen);
136  if (j > maxlen) j = maxlen;
137 // for(i=0; i < j; i++) {
138 // if (keydata[i] == 0)
139 // keydata[i] = 255;
140 // CmiPrintf("key[%d]=%d %p\n",i,keydata[i],keydata);
141 // }
142  return CkHashFunction_default((const void*)keydata,(size_t)j);
143  }
vector< SigIndex > crosstermSigIndices
Definition: CompressPsf.C:62
vector< SigIndex > improperSigIndices
Definition: CompressPsf.C:61
vector< SigIndex > bondSigIndices
Definition: CompressPsf.C:58
vector< SigIndex > angleSigIndices
Definition: CompressPsf.C:59
vector< SigIndex > dihedralSigIndices
Definition: CompressPsf.C:60
void AtomSigInfo::sortTupleSigIndices ( )
inline

Definition at line 98 of file CompressPsf.C.

References sort.

Referenced by integrateAllAtomSigs().

99  {
100  sort(bondSigIndices.begin(), bondSigIndices.end());
101  sort(angleSigIndices.begin(), angleSigIndices.end());
105  }
vector< SigIndex > crosstermSigIndices
Definition: CompressPsf.C:62
vector< SigIndex > improperSigIndices
Definition: CompressPsf.C:61
vector< SigIndex > bondSigIndices
Definition: CompressPsf.C:58
BlockRadixSort::TempStorage sort
vector< SigIndex > angleSigIndices
Definition: CompressPsf.C:59
vector< SigIndex > dihedralSigIndices
Definition: CompressPsf.C:60

Member Data Documentation

vector<SigIndex> AtomSigInfo::angleSigIndices

Definition at line 59 of file CompressPsf.C.

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

vector<SigIndex> AtomSigInfo::bondSigIndices
vector<SigIndex> AtomSigInfo::crosstermSigIndices

Definition at line 62 of file CompressPsf.C.

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

vector<SigIndex> AtomSigInfo::dihedralSigIndices

Definition at line 60 of file CompressPsf.C.

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

vector<SigIndex> AtomSigInfo::improperSigIndices

Definition at line 61 of file CompressPsf.C.

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


The documentation for this struct was generated from the following file: