NAMD
Public Member Functions | Public Attributes | List of all members
CollectionMaster::CollectVectorInstance Class Reference

#include <CollectionMaster.h>

Public Member Functions

 CollectVectorInstance (void)
 
 CollectVectorInstance (int s)
 
void free ()
 
int notfree ()
 
void reset (int s)
 
void append (CollectVectorMsg *msg, int max_index)
 
int ready (void)
 

Public Attributes

int seq
 
Lattice lattice
 
ResizeArray< Vectordata
 
ResizeArray< FloatVectorfdata
 

Detailed Description

Definition at line 189 of file CollectionMaster.h.

Constructor & Destructor Documentation

CollectionMaster::CollectVectorInstance::CollectVectorInstance ( void  )
inline

Definition at line 193 of file CollectionMaster.h.

CollectionMaster::CollectVectorInstance::CollectVectorInstance ( int  s)
inline

Definition at line 195 of file CollectionMaster.h.

References reset().

Member Function Documentation

void CollectionMaster::CollectVectorInstance::append ( CollectVectorMsg msg,
int  max_index 
)
inline

Definition at line 209 of file CollectionMaster.h.

References CollectVectorMsg::aid, CollectVectorMsg::aid_size, ResizeArray< T >::begin(), CollectVectorMsg::data, data, CollectVectorMsg::data_size, CollectVectorMsg::fdata, fdata, CollectVectorMsg::fdata_size, and ResizeArray< T >::resize().

210  {
211  AtomID *a = msg->aid;
212  Vector *d = msg->data;
213  FloatVector *fd = msg->fdata;
214  int size = msg->aid_size;
215  if ( msg->data_size ) {
216  data.resize(max_index);
217  Vector *ptr = data.begin();
218  for( int i = 0; i < size; ++i ) { ptr[a[i]] = d[i]; }
219  }
220  if ( msg->fdata_size ) {
221  fdata.resize(max_index);
222  FloatVector *ptr = fdata.begin();
223  for( int i = 0; i < size; ++i ) { ptr[a[i]] = fd[i]; }
224  }
225  --remaining;
226  }
int AtomID
Definition: NamdTypes.h:29
Definition: Vector.h:64
void resize(int i)
Definition: ResizeArray.h:84
FloatVector * fdata
iterator begin(void)
Definition: ResizeArray.h:36
void CollectionMaster::CollectVectorInstance::free ( )
inline
int CollectionMaster::CollectVectorInstance::notfree ( )
inline

Definition at line 198 of file CollectionMaster.h.

198 { return ( seq != -10 ); }
int CollectionMaster::CollectVectorInstance::ready ( void  )
inline

Definition at line 228 of file CollectionMaster.h.

228 { return ( ! remaining ); }
void CollectionMaster::CollectVectorInstance::reset ( int  s)
inline

Definition at line 200 of file CollectionMaster.h.

References data, fdata, NAMD_bug(), PatchMap::Object(), and ResizeArray< T >::resize().

Referenced by CollectVectorInstance().

200  {
201  if ( s == -10 ) NAMD_bug("seq == free in CollectionMaster");
202  seq = s;
203  remaining = (PatchMap::Object())->numNodesWithPatches();
204  data.resize(0);
205  fdata.resize(0);
206  }
static PatchMap * Object()
Definition: PatchMap.h:27
void NAMD_bug(const char *err_msg)
Definition: common.C:123
void resize(int i)
Definition: ResizeArray.h:84

Member Data Documentation

ResizeArray<Vector> CollectionMaster::CollectVectorInstance::data
ResizeArray<FloatVector> CollectionMaster::CollectVectorInstance::fdata

Definition at line 234 of file CollectionMaster.h.

Referenced by append(), CollectionMaster::disposePositions(), and reset().

Lattice CollectionMaster::CollectVectorInstance::lattice

Definition at line 231 of file CollectionMaster.h.

Referenced by CollectionMaster::disposePositions().

int CollectionMaster::CollectVectorInstance::seq

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