NAMD
Public Types | Public Member Functions | Protected Attributes | Friends | List of all members
ResizeArray< T > Class Template Reference

#include <packmsg.h>

Inheritance diagram for ResizeArray< T >:
SortableResizeArray< Elem > SortableResizeArray< HydrogenGroupID > SortedArray< Type > UniqueSortedArray< PatchElem >

Public Types

typedef Elem * iterator
 
typedef const Elem * const_iterator
 

Public Member Functions

iterator begin (void)
 
iterator end (void)
 
const_iterator const_begin (void) const
 
const_iterator const_end (void) const
 
 ResizeArray (void)
 
 ResizeArray (int s)
 
void copy (ResizeArray< Elem > &ra)
 
void swap (ResizeArray< Elem > &ra)
 
bool shared () const
 
 ResizeArray (Elem **array, int arraySize, int allocSize=0)
 
 ~ResizeArray (void)
 
void resize (int i)
 
void clear ()
 
void setall (const Elem &elem)
 
int add (const Elem &elem)
 
void del (int index, int num=1)
 
int insert (const Elem &elem, int index)
 
Elem & item (int i)
 
Elem & operator[] (int index)
 
const Elem & operator[] (int index) const
 
int size (void) const
 
int find (const Elem &e) const
 

Protected Attributes

ResizeArrayRaw< Elem > rep
 

Friends

class ResizeArrayIter< Elem >
 

Detailed Description

template<class T>
class ResizeArray< T >

Definition at line 29 of file packmsg.h.

Member Typedef Documentation

template<class T>
typedef const Elem* ResizeArray< T >::const_iterator

Definition at line 38 of file ResizeArray.h.

template<class T>
typedef Elem* ResizeArray< T >::iterator

Definition at line 35 of file ResizeArray.h.

Constructor & Destructor Documentation

template<class T>
ResizeArray< T >::ResizeArray ( void  )
inline

Definition at line 43 of file ResizeArray.h.

43 { }
template<class T>
ResizeArray< T >::ResizeArray ( int  s)
inline

Definition at line 46 of file ResizeArray.h.

46  {
47  rep.resize(s);
48  }
ResizeArrayRaw< Elem > rep
Definition: ResizeArray.h:31
template<class T>
ResizeArray< T >::ResizeArray ( Elem **  array,
int  arraySize,
int  allocSize = 0 
)
inline

Definition at line 77 of file ResizeArray.h.

77  :
78  rep(array, arraySize, allocSize) { }
ResizeArrayRaw< Elem > rep
Definition: ResizeArray.h:31
template<class T>
ResizeArray< T >::~ResizeArray ( void  )
inline

Definition at line 80 of file ResizeArray.h.

80 { rep.free(); }
ResizeArrayRaw< Elem > rep
Definition: ResizeArray.h:31

Member Function Documentation

template<class T>
int ResizeArray< T >::add ( const Elem &  elem)
inline

Definition at line 97 of file ResizeArray.h.

Referenced by MigrateAtomsCombinedMsg::add(), VDWTable::add14Type(), GenericMol::addAngle(), GenericMol::addAtom(), GenericMol::addBond(), GenericMol::addDihedral(), GlobalMasterEasy::addForce(), GlobalMasterFreeEnergy::addForce(), PairTable::addPairGaussType2(), PairTable::addPairLJType2(), AtomTable::addType(), BondTable::addType(), AngleTable::addType(), DihedralTable::addType(), VDWTable::addType(), CollectionMgr::CollectVectorInstance::append(), ComputeNonbondedCUDA::assignPatches(), CudaComputeNonbonded::assignPatchesOnPe(), PatchMap::basePatchIDList(), ComputeNonbondedCUDA::build_exclusions(), Molecule::build_go_sigmas2(), GlobalMasterTest::calculate(), GlobalMasterIMD::calculate(), colvarproxy_namd::calculate(), WorkDistrib::createAtomLists(), ProxyPatch::depositCombinedResultMsg(), ProxyPatch::depositCombinedResultRawMsg(), HomePatch::depositMigration(), HomePatch::doAtomMigration(), ComputeGlobal::doWork(), CollectionMaster::CollectVectorSequence::enqueue(), ProxyCombinedResultMsg::fromRaw(), BondTable::getIndex(), AngleTable::getIndex(), ObjectArena< char >::getNewArray(), GromacsTopFile::GromacsTopFile(), PatchMap::homePatchIDList(), colvarproxy_namd::init_atom(), colvarproxy_namd::init_volmap(), ComputeQM::initialize(), ParallelIOMgr::migrateAtomsMGrp(), ComputePme::noWork(), ComputeQM::processFullQM(), ComputeMgr::recvComputeGlobalResults(), ProxyMgr::recvNodeAwareSpanningTree(), ComputeQMMgr::recvPartQM(), ProxyMgr::recvSpanningTree(), ComputeNonbondedCUDA::registerPatches(), HomePatch::registerProxy(), ProxyMgr::removeUnusedProxies(), GlobalMasterEasy::requestAtom(), GlobalMasterFreeEnergy::requestAtom(), ComputeNonbondedCUDA::requirePatch(), ComputeGlobal::saveTotalForces(), ParallelIOMgr::sendAtomsToHomePatchProcs(), PatchMgr::sendMigrationMsgs(), ComputeMgr::updateLocalComputes(), and ParallelIOMgr::wrapCoor().

97  {
98  int end=rep.size();
99  rep.ins(elem, end);
100  return(end);
101  }
ResizeArrayRaw< Elem > rep
Definition: ResizeArray.h:31
iterator end(void)
Definition: ResizeArray.h:37
template<class T>
iterator ResizeArray< T >::begin ( void  )
inline

Definition at line 36 of file ResizeArray.h.

Referenced by Sequencer::addForceToMomentum(), Sequencer::addForceToMomentum3(), Sequencer::addMovDragToPosition(), Sequencer::addRotDragToPosition(), Sequencer::addVelocityToPosition(), CollectionMaster::CollectVectorInstance::append(), Sequencer::berendsenPressure(), ComputeNonbondedCUDA::build_exclusions(), Molecule::build_go_sigmas2(), WorkDistrib::buildNodeAwarePeOrdering(), HomePatch::buildSpanningTree(), Sequencer::calcFixVirial(), Sequencer::calcKineticEnergy(), colvarproxy_namd::calculate(), Sequencer::correctMomentum(), WorkDistrib::createAtomLists(), ProxyPatch::depositCombinedResultMsg(), ProxyPatch::depositCombinedResultRawMsg(), HomePatch::depositMigration(), CollectionMaster::disposeForces(), CollectionMaster::disposePositions(), CollectionMaster::disposeVelocities(), HomePatch::doAtomMigration(), HomePatch::doGroupSizeCheck(), HomePatch::doMarginCheck(), HomePatch::doPairlistCheck(), ComputeHomePatch::doWork(), ComputePme::doWork(), ComputeNonbondedCUDA::doWork(), ComputeHomeTuples< TholeElem, Thole, TholeValue >::doWork(), HomePatch::exchangeAtoms(), Patch::forceBoxClosed(), ProxyCombinedResultMsg::fromRaw(), HomePatch::gbisP2Ready(), HomePatch::gbisP3Ready(), ProxyResultVarsizeMsg::getANewMsg(), Patch::getCompAtomExtInfo(), PairTable::getPairGaussArrays2(), PairTable::getPairLJArrays2(), Sequencer::integrate(), Sequencer::langevinPiston(), Sequencer::langevinVelocities(), Sequencer::langevinVelocitiesBBK1(), Sequencer::langevinVelocitiesBBK2(), Sequencer::maximumMove(), ParallelIOMgr::migrateAtomsMGrp(), Sequencer::minimizationQuenchVelocity(), Sequencer::minimize(), HomePatch::minimize_rattle2(), Sequencer::minimizeMoveDownhill(), PatchMgr::moveAllBy(), Sequencer::multigratorPressure(), Sequencer::multigratorTemperature(), Sequencer::newMinimizeDirection(), Sequencer::newMinimizePosition(), outputCompressedFile(), Patch::positionsReady(), HomePatch::positionsReady(), Molecule::prepare_qm(), HomePatch::qmSwapAtoms(), Sequencer::quenchVelocities(), Sequencer::reassignVelocities(), ProxyPatch::receiveAll(), ProxyPatch::receiveData(), CollectionMaster::receiveDataStream(), HomePatch::receiveResults(), PmeZPencil::recv_grid(), HomePatch::recvCheckpointLoad(), HomePatch::recvCheckpointReq(), HomePatch::recvCheckpointStore(), GlobalMasterServer::recvData(), HomePatch::recvExchangeMsg(), ComputeGlobal::recvResults(), ComputeNonbondedCUDA::registerPatches(), HomePatch::registerProxy(), Sequencer::reinitVelocities(), Sequencer::reloadCharges(), ProxyMgr::removeUnusedProxies(), Sequencer::rescaleSoluteCharges(), Sequencer::rescaleVelocities(), Sequencer::rescaleVelocitiesByFactor(), HomePatch::revert(), ComputeGlobal::saveTotalForces(), Sequencer::scalePositionsVelocities(), Sequencer::scaleVelocities(), ParallelIOMgr::sendAtomsToHomePatchProcs(), CollectionMgr::sendDataStream(), HomePatch::sendProxies(), ProxyMgr::sendSpanningTrees(), PmeRealSpace::set_num_atoms(), ResizeArray< GromacsPairElem >::setall(), PatchMgr::setLattice(), WorkDistrib::sortPmePes(), Sequencer::stochRescaleVelocities(), CollectionMgr::submitForces(), Sequencer::submitHalfstep(), Sequencer::submitMinimizeReductions(), Sequencer::submitMomentum(), CollectionMgr::submitPositions(), Sequencer::submitReductions(), CollectionMgr::submitVelocities(), Sequencer::tcoupleVelocities(), ProxyCombinedResultMsg::toRaw(), ComputePme::ungridForces(), ProxyResultMsg::unpack(), HomePatch::unregisterProxy(), HomePatch::~HomePatch(), and ProxyPatch::~ProxyPatch().

36 { return rep.array; }
ResizeArrayRaw< Elem > rep
Definition: ResizeArray.h:31
template<class T>
void ResizeArray< T >::clear ( )
inline
template<class T>
const_iterator ResizeArray< T >::const_begin ( void  ) const
inline

Definition at line 39 of file ResizeArray.h.

Referenced by Sequencer::addForceToMomentum(), Sequencer::addForceToMomentum3(), and Sequencer::rattle1().

39 { return rep.array; }
ResizeArrayRaw< Elem > rep
Definition: ResizeArray.h:31
template<class T>
const_iterator ResizeArray< T >::const_end ( void  ) const
inline

Definition at line 40 of file ResizeArray.h.

40 { return rep.array + rep.arraySize; }
ResizeArrayRaw< Elem > rep
Definition: ResizeArray.h:31
template<class T>
void ResizeArray< T >::copy ( ResizeArray< Elem > &  ra)
inline

Definition at line 59 of file ResizeArray.h.

Referenced by HomePatch::checkpoint(), ProxyMgr::recvSpanningTree(), HomePatch::revert(), and HomePatch::sendSpanningTree().

59  {
60  rep.copy(ra.rep);
61  }
ResizeArrayRaw< Elem > rep
Definition: ResizeArray.h:31
template<class T>
void ResizeArray< T >::del ( int  index,
int  num = 1 
)
inline
template<class T>
iterator ResizeArray< T >::end ( void  )
inline
template<class T>
int ResizeArray< T >::find ( const Elem &  e) const
inline

Definition at line 137 of file ResizeArray.h.

Referenced by HomePatch::buildSpanningTree(), and ProxyMgr::buildSpanningTree0().

137 { return rep.find(e); }
ResizeArrayRaw< Elem > rep
Definition: ResizeArray.h:31
template<class T>
int ResizeArray< T >::insert ( const Elem &  elem,
int  index 
)
inline

Definition at line 109 of file ResizeArray.h.

Referenced by UniqueSortedArray< Type >::insert().

109  {
110  rep.ins(elem,index);
111  return (index);
112  }
ResizeArrayRaw< Elem > rep
Definition: ResizeArray.h:31
Index index
Definition: Parameters.C:148
template<class T>
Elem& ResizeArray< T >::item ( int  i)
inline

Definition at line 115 of file ResizeArray.h.

Referenced by GlobalMasterTest::calculate(), GlobalMasterIMD::calculate(), and ProxyMgr::recvNodeAwareSpanningTree().

115  {
116  i = ( i < 0 ? 0 : i );
117  if ((i+1) > size())
118  resize(i+1);
119  return rep.array[i];
120  }
ResizeArrayRaw< Elem > rep
Definition: ResizeArray.h:31
void resize(int i)
Definition: ResizeArray.h:84
int size(void) const
Definition: ResizeArray.h:127
template<class T>
Elem& ResizeArray< T >::operator[] ( int  index)
inline

Definition at line 123 of file ResizeArray.h.

123 { return rep.array[index]; }
ResizeArrayRaw< Elem > rep
Definition: ResizeArray.h:31
Index index
Definition: Parameters.C:148
template<class T>
const Elem& ResizeArray< T >::operator[] ( int  index) const
inline

Definition at line 124 of file ResizeArray.h.

124 { return rep.array[index]; }
ResizeArrayRaw< Elem > rep
Definition: ResizeArray.h:31
Index index
Definition: Parameters.C:148
template<class T>
void ResizeArray< T >::resize ( int  i)
inline

Definition at line 84 of file ResizeArray.h.

Referenced by CollectionMaster::CollectVectorInstance::append(), PatchMap::basePatchIDList(), HomePatch::buildSpanningTree(), ProxyMgr::buildSpanningTree0(), GlobalMasterTest::calculate(), GlobalMasterTcl::calculate(), GlobalMasterIMD::calculate(), colvarproxy_namd::calculate(), ComputeGlobal::ComputeGlobal(), ComputeTclBC::ComputeTclBC(), Rebalancer::createSpanningTree(), MigrateAtomsCombinedMsg::distribute(), HomePatch::doAtomMigration(), HomePatch::doPairlistCheck(), ComputePme::doWork(), ComputeNonbondedCUDA::doWork(), Patch::forceBoxClosed(), ProxyCombinedResultMsg::fromRaw(), PatchMap::homePatchIDList(), colvarproxy_namd::init_atom_group(), ComputeHomePatches::initialize(), ComputeQM::initialize(), ResizeArray< GromacsPairElem >::item(), lssDistSort::lssDistSort(), HomePatch::mollyAverage(), HomePatch::mollyMollify(), lssDistSort::operator=(), outputCompressedFile(), Patch::positionsReady(), HomePatch::positionsReady(), ProxyPatch::receiveAll(), ProxyPatch::receiveData(), HomePatch::recvCheckpointLoad(), HomePatch::recvCheckpointStore(), HomePatch::recvExchangeMsg(), ProxyMgr::recvPatchProxyInfo(), ProxyMgr::recvProxies(), ComputeGlobal::recvResults(), HomePatch::recvSpanningTree(), CollectionMgr::CollectVectorInstance::reset(), CollectionMaster::CollectVectorInstance::reset(), HomePatch::saveForce(), CollectionMgr::sendDataStream(), PatchMgr::sendMigrationMsgs(), PatchMgr::sendMovePatches(), PmeRealSpace::set_num_atoms(), HomePatch::setGBISIntrinsicRadii(), HomePatch::setLcpoType(), ComputePmeMgr::submitReductions(), ComputePme::ungridForces(), ProxyResultMsg::unpack(), ComputeMgr::updateLocalComputes(), Parameters::~Parameters(), and ProxyPatch::~ProxyPatch().

84 { rep.resize(i); }
ResizeArrayRaw< Elem > rep
Definition: ResizeArray.h:31
template<class T>
void ResizeArray< T >::setall ( const Elem &  elem)
inline

Definition at line 90 of file ResizeArray.h.

Referenced by HomePatch::buildSpanningTree(), ProxyMgr::buildSpanningTree0(), GlobalMasterTcl::calculate(), colvarproxy_namd::calculate(), Patch::positionsReady(), and HomePatch::setGBISIntrinsicRadii().

90  {
91  iterator i = begin();
92  iterator e = end();
93  for ( ; i != e; ++i ) *i = elem;
94  }
Elem * iterator
Definition: ResizeArray.h:35
iterator end(void)
Definition: ResizeArray.h:37
iterator begin(void)
Definition: ResizeArray.h:36
template<class T>
bool ResizeArray< T >::shared ( ) const
inline

Definition at line 72 of file ResizeArray.h.

Referenced by PatchMgr::sendAtoms(), PatchMgr::sendMovePatches(), and PatchMgr::sendOneHomePatch().

72  {
73  return 0;
74  }
template<class T>
int ResizeArray< T >::size ( void  ) const
inline

Definition at line 127 of file ResizeArray.h.

Referenced by MigrateAtomsCombinedMsg::add(), CollectionMgr::CollectVectorInstance::append(), ComputeNonbondedCUDA::assignPatches(), CudaComputeNonbonded::assignPatchesOnPe(), HomePatch::boxClosed(), ComputeNonbondedCUDA::build_exclusions(), ProxyMgr::buildProxySpanningTree(), ProxyMgr::buildProxySpanningTree2(), HomePatch::buildSpanningTree(), ProxyMgr::buildSpanningTree0(), GlobalMasterTest::calculate(), GlobalMasterIMD::calculate(), ComputePmeMgr::chargeGridReady(), GlobalMaster::check(), ComputeHomeTuples< TholeElem, Thole, TholeValue >::ComputeHomeTuples(), ComputePmeCUDA::ComputePmeCUDA(), WorkDistrib::createAtomLists(), WorkDistrib::createHomePatches(), ProxyMgr::createProxies(), Rebalancer::decrSTLoad(), SortedArray< ComputeQMPntChrg >::del(), HomePatch::depositMigration(), CollectionMaster::disposeForces(), CollectionMaster::disposePositions(), CollectionMaster::disposeVelocities(), MigrateAtomsCombinedMsg::distribute(), HomePatch::doAtomMigration(), ComputeMsm::doWork(), ComputePme::doWork(), ComputeNonbondedCUDA::doWork(), ComputeQM::doWork(), ComputeHomeTuples< TholeElem, Thole, TholeValue >::doWork(), ComputeMgr::enableComputeGlobalResults(), SortedArray< Elem >::find(), ComputeNonbondedCUDA::finishWork(), HomePatch::gbisP2Ready(), HomePatch::gbisP3Ready(), GlobalMasterIMD::get_vmd_forces(), ProxyResultVarsizeMsg::getANewMsg(), GenericMol::getAngle(), GromacsTopFile::getAngle(), GenericMol::getAtom(), GromacsTopFile::getAtom(), GenericMol::getBond(), GromacsTopFile::getBond(), GenericMol::getDihedral(), GromacsTopFile::getDihedral(), GromacsTopFile::getExclusions(), BondTable::getIndex(), AngleTable::getIndex(), DihedralTable::getIndex(), GenericMol::getNumAngles(), GromacsTopFile::getNumAngles(), GenericMol::getNumAtoms(), GromacsTopFile::getNumAtoms(), GenericMol::getNumBonds(), GromacsTopFile::getNumBonds(), Patch::getNumComputes(), GenericMol::getNumDihedrals(), GromacsTopFile::getNumDihedrals(), GenericMol::getNumRes(), AtomTable::getParams(), BondTable::getParams(), AngleTable::getParams(), DihedralTable::getParams(), AtomTable::getType(), GromacsTopFile::GromacsTopFile(), Rebalancer::incrSTLoad(), colvarproxy_namd::init_atom_group(), ComputeHomePatches::initialize(), SortedArray< Elem >::insert(), ResizeArray< GromacsPairElem >::item(), lssDistSort::lssDistSort(), ParallelIOMgr::migrateAtomsMGrp(), PmeZPencil::node_process_grid(), ComputePme::noWork(), ComputeNonbondedCUDA::noWork(), lssDistSort::operator=(), lssDistSort::operator==(), outputProxyTree(), Patch::positionsReady(), HomePatch::positionsReady(), Molecule::prepare_qm(), ComputeQM::processFullQM(), ComputeQMMgr::procQMRes(), HomePatch::receiveResult(), ComputeMgr::recvComputeConsForceMsg(), GlobalMasterServer::recvData(), ParallelIOMgr::recvFinalClusterCoor(), ComputeQMMgr::recvFullQM(), PatchMgr::recvMigrateAtomsCombined(), ProxyMgr::recvNodeAwareSpanningTree(), ComputeQMMgr::recvPartQM(), ComputeQMMgr::recvPntChrg(), ComputePmeMgr::recvRecipEvir(), ComputeGlobal::recvResults(), ProxyMgr::recvSpanningTree(), HomePatch::recvSpanningTree(), ComputeNonbondedCUDA::recvYieldDevice(), Patch::registerDEdaSumDeposit(), Patch::registerForceDeposit(), ComputeNonbondedCUDA::registerPatches(), HomePatch::registerProxy(), Patch::registerPsiSumDeposit(), CollectionMaster::CollectVectorSequence::removeReady(), HomePatch::revert(), ComputeQM::saveResults(), PmeZPencil::send_all_ungrid(), GlobalMasterIMD::send_energies(), GlobalMasterIMD::send_fcoords(), ParallelIOMgr::sendAtomsToHomePatchProcs(), ComputePmeMgr::sendChargeGridReady(), PatchMgr::sendMigrationMsgs(), PatchMgr::sendMovePatches(), ComputeMgr::sendNonbondedCUDASlaveEnqueue(), ComputeMgr::sendNonbondedMICSlaveEnqueue(), HomePatch::sendProxies(), HomePatch::sendSpanningTree(), ProxyMgr::sendSpanningTrees(), colvarproxy_namd::setup(), AtomTable::size(), BondTable::size(), AngleTable::size(), DihedralTable::size(), ComputeNonbondedCUDA::skip(), CollectionMgr::submitForces(), CollectionMgr::submitPositions(), ComputePmeMgr::submitReductions(), CollectionMgr::submitVelocities(), ProxyCombinedResultMsg::toRaw(), ComputePmeMgr::ungridCalc(), colvarproxy_namd::update_group_properties(), ComputeMgr::updateLocalComputes3(), ParallelIOMgr::wrapCoor(), GlobalMasterIMD::~GlobalMasterIMD(), ObjectArena< char >::~ObjectArena(), and Parameters::~Parameters().

127 { return rep.size(); }
ResizeArrayRaw< Elem > rep
Definition: ResizeArray.h:31
template<class T>
void ResizeArray< T >::swap ( ResizeArray< Elem > &  ra)
inline

Definition at line 64 of file ResizeArray.h.

Referenced by HomePatch::buildSpanningTree(), ProxyMgr::buildSpanningTree0(), ComputeNonbondedCUDA::doWork(), and MovePatchesMsg::MovePatchesMsg().

64  {
65  // uses synthesized copy constructor and assignment operator
67  rep = ra.rep;
68  ra.rep = tmp;
69  }
ResizeArrayRaw< Elem > rep
Definition: ResizeArray.h:31

Friends And Related Function Documentation

template<class T>
friend class ResizeArrayIter< Elem >
friend

Definition at line 28 of file ResizeArray.h.

Member Data Documentation

template<class T>
ResizeArrayRaw<Elem> ResizeArray< T >::rep
protected

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