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

ResizeArray< Elem > Class Template Reference

#include <ResizeArray.h>

Inheritance diagram for ResizeArray< Elem >:

SortableResizeArray< Elem > SortedArray< Elem > UniqueSortedArray< Elem > List of all members.

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)
 ResizeArray (ResizeArray< Elem > &ra)
 ResizeArray (const ResizeArray< Elem > *ra)
 ResizeArray (Elem **array, int arraySize, int allocSize=0)
virtual ~ResizeArray (void)
ResizeArray< Elem > & operator= (ResizeArray< Elem > &ra)
void setParams (int s, float growthFactor)
void resize (int i)
void clear ()
void setall (const Elem &elem)
int add (const Elem &elem)
int 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>

template<class Elem>
class ResizeArray< Elem >


Member Typedef Documentation

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

Definition at line 36 of file ResizeArray.h.

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

Definition at line 33 of file ResizeArray.h.


Constructor & Destructor Documentation

template<class Elem>
ResizeArray< Elem >::ResizeArray void   )  [inline]
 

Definition at line 41 of file ResizeArray.h.

00041                       {
00042       rep = new ResizeArrayRaw<Elem>();
00043       rep->refCount = 1;
00044     }

template<class Elem>
ResizeArray< Elem >::ResizeArray int  s  )  [inline]
 

Definition at line 47 of file ResizeArray.h.

00047                        {
00048       rep = new ResizeArrayRaw<Elem>();
00049       rep->resize(s);
00050       rep->refCount = 1;
00051     }

template<class Elem>
ResizeArray< Elem >::ResizeArray ResizeArray< Elem > &  ra  )  [inline]
 

Definition at line 54 of file ResizeArray.h.

00054                                        {
00055       rep = ra.rep;
00056       rep->refCount++;
00057     }

template<class Elem>
ResizeArray< Elem >::ResizeArray const ResizeArray< Elem > *  ra  )  [inline]
 

Definition at line 60 of file ResizeArray.h.

00060                                              {
00061       rep = new ResizeArrayRaw<Elem>(*(ra->rep));
00062       rep->refCount = 1;
00063     }

template<class Elem>
ResizeArray< Elem >::ResizeArray Elem **  array,
int  arraySize,
int  allocSize = 0
[inline]
 

Definition at line 66 of file ResizeArray.h.

00066                                                                 {
00067       rep = new ResizeArrayRaw<Elem>(array, arraySize, allocSize);
00068       rep->refCount = 1;
00069     }

template<class Elem>
virtual ResizeArray< Elem >::~ResizeArray void   )  [inline, virtual]
 

Definition at line 71 of file ResizeArray.h.

00071                                {
00072       if (!--rep->refCount) delete rep;
00073     }


Member Function Documentation

template<class Elem>
int ResizeArray< Elem >::add const Elem &  elem  )  [inline]
 

Reimplemented in SortedArray< Elem >, UniqueSortedArray< Elem >, SortedArray< MovePatch >, SortedArray< HomePatchElem >, SortedArray< Compute * >, SortedArray< PatchElem >, and UniqueSortedArray< PatchElem >.

Definition at line 105 of file ResizeArray.h.

Referenced by MigrateAtomsCombinedMsg::add(), VDWTable::add14Type(), GenericMol::addAngle(), GenericMol::addAtom(), GenericMol::addBond(), GlobalMasterServer::addClient(), GenericMol::addDihedral(), GlobalMasterFreeEnergy::addForce(), GlobalMasterEasy::addForce(), VDWTable::addType(), ResidueLookupElem::append(), colvarmodule::atom::apply_force(), PatchMap::basePatchIDList(), ComputeNonbondedCUDA::build_exclusions(), GlobalMasterTest::calculate(), GlobalMasterIMD::calculate(), WorkDistrib::createAtomLists(), ProxyPatch::depositCombinedResultMsg(), ProxyPatch::depositCombinedResultRawMsg(), HomePatch::depositMigration(), HomePatch::doAtomMigration(), ProxyCombinedResultMsg::fromRaw(), GromacsTopFile::GromacsTopFile(), PatchMap::homePatchIDList(), colvarproxy_namd::init_namd_atom(), ComputePmeMgr::initialize(), initializePmeMap(), ParallelIOMgr::integrateMigratedAtoms(), SortedArray< PatchElem >::load(), ComputeHomeTuples< TholeElem, Thole, TholeValue >::loadTuples(), ParallelIOMgr::migrateAtomsMGrp(), GlobalMaster::processData(), ParallelIOMgr::recvAtomsMGrp(), ParallelIOMgr::recvAtomsToHomePatchProcs(), ParallelIOMgr::recvClusterCoor(), ParallelIOMgr::recvClusterSize(), GlobalMasterServer::recvData(), ProxyMgr::recvNodeAwareSpanningTree(), ProxyMgr::recvSpanningTree(), register_cuda_compute_pair(), register_cuda_compute_self(), ComputeNonbondedCUDA::registerPatches(), HomePatch::registerProxy(), ProxyMgr::removeUnusedProxies(), GlobalMasterFreeEnergy::requestAtom(), GlobalMasterEasy::requestAtom(), ComputeNonbondedCUDA::requirePatch(), ComputeGlobal::saveTotalForces(), ParallelIOMgr::sendAtomsToHomePatchProcs(), PatchMgr::sendMigrationMsgs(), and ComputeMgr::updateLocalComputes().

00105                                {
00106       int end=rep->size();
00107       rep->ins(elem, end);
00108       return(end);
00109     }

template<class Elem>
iterator ResizeArray< Elem >::begin void   )  [inline]
 

Definition at line 34 of file ResizeArray.h.

Referenced by HomePatch::addForceToMomentum(), Sequencer::addMovDragToPosition(), Sequencer::addRotDragToPosition(), HomePatch::addVelocityToPosition(), Sequencer::berendsenPressure(), ComputeNonbondedCUDA::build_exclusions(), HomePatch::buildSpanningTree(), GlobalMasterIMD::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(), ComputeNonbondedCUDA::doWork(), ComputeHomeTuples< TholeElem, Thole, TholeValue >::doWork(), ComputeHomePatch::doWork(), ProxyCombinedResultMsg::fromRaw(), HomePatch::gbisP2Ready(), HomePatch::gbisP3Ready(), ProxyResultVarsizeMsg::getANewMsg(), GlobalMaster::getGroupMassBegin(), ComputePmeMgr::initialize(), Sequencer::integrate(), ParallelIOMgr::integrateMigratedAtoms(), Sequencer::langevinPiston(), Sequencer::langevinVelocities(), Sequencer::langevinVelocitiesBBK1(), Sequencer::langevinVelocitiesBBK2(), Sequencer::maximumMove(), ParallelIOMgr::migrateAtomsMGrp(), Sequencer::minimizationQuenchVelocity(), Sequencer::minimize(), Sequencer::minimizeMoveDownhill(), PatchMgr::moveAllBy(), Sequencer::newMinimizeDirection(), Sequencer::newMinimizePosition(), outputCompressedFile(), ComputeMap::pack(), PACK_MSG(), Patch::positionsReady(), HomePatch::positionsReady(), Sequencer::quenchVelocities(), Sequencer::reassignVelocities(), ProxyPatch::receiveAll(), ProxyPatch::receiveData(), CollectionMaster::receiveDataStream(), HomePatch::receiveResults(), GlobalMasterServer::recvData(), ComputeGlobal::recvResults(), ComputeNonbondedCUDA::registerPatches(), HomePatch::registerProxy(), Sequencer::reinitVelocities(), Sequencer::reloadCharges(), ProxyMgr::removeUnusedProxies(), Sequencer::rescaleVelocities(), Sequencer::rescaleVelocitiesByFactor(), HomePatch::revert(), Sequencer::runComputeObjects(), ParallelIOMgr::sendAtomsToHomePatchProcs(), CollectionMgr::sendDataStream(), HomePatch::sendProxies(), ProxyMgr::sendSpanningTrees(), PatchMgr::setLattice(), CollectionMgr::submitForces(), Sequencer::submitHalfstep(), Sequencer::submitMinimizeReductions(), Sequencer::submitMomentum(), CollectionMgr::submitPositions(), Sequencer::submitReductions(), CollectionMgr::submitVelocities(), Sequencer::tcoupleVelocities(), ProxyCombinedResultMsg::toRaw(), ProxyResultMsg::unpack(), ComputeMap::unpack(), HomePatch::unregisterProxy(), GlobalMasterServer::~GlobalMasterServer(), HomePatch::~HomePatch(), and ProxyPatch::~ProxyPatch().

00034 { return rep->array; }

template<class Elem>
void ResizeArray< Elem >::clear  )  [inline]
 

Definition at line 95 of file ResizeArray.h.

Referenced by ParallelIOMgr::createHomePatches(), ParallelIOMgr::integrateMigratedAtoms(), ParallelIOMgr::migrateAtomsMGrp(), outputProxyTree(), ParallelIOMgr::sendAtomsToHomePatchProcs(), and ComputeMgr::updateLocalComputes3().

00095 { rep->clear(); }

template<class Elem>
const_iterator ResizeArray< Elem >::const_begin void   )  const [inline]
 

Definition at line 37 of file ResizeArray.h.

Referenced by HomePatch::addForceToMomentum().

00037 { return rep->array; }

template<class Elem>
const_iterator ResizeArray< Elem >::const_end void   )  const [inline]
 

Definition at line 38 of file ResizeArray.h.

00038 { return rep->array + rep->arraySize; }

template<class Elem>
int ResizeArray< Elem >::del int  index,
int  num = 1
[inline]
 

Definition at line 112 of file ResizeArray.h.

Referenced by SortedArray< PatchElem >::del(), HomePatch::doAtomMigration(), GlobalMasterIMD::get_vmd_forces(), and HomePatch::unregisterProxy().

00112                                   {
00113       return(rep->del(index,num));
00114     }

template<class Elem>
iterator ResizeArray< Elem >::end void   )  [inline]
 

Definition at line 35 of file ResizeArray.h.

Referenced by ComputeNonbondedCUDA::build_exclusions(), HomePatch::buildSpanningTree(), ProxyPatch::depositCombinedResultMsg(), HomePatch::depositMigration(), HomePatch::doAtomMigration(), HomePatch::doGroupSizeCheck(), HomePatch::doMarginCheck(), ComputeNonbondedCUDA::doWork(), GlobalMaster::getGroupMassEnd(), Sequencer::integrate(), ParallelIOMgr::integrateMigratedAtoms(), Sequencer::minimize(), PatchMgr::moveAllBy(), Patch::positionsReady(), HomePatch::positionsReady(), ProxyPatch::receiveAll(), HomePatch::receiveResults(), GlobalMasterServer::recvData(), ComputeGlobal::recvResults(), ProxyMgr::removeUnusedProxies(), HomePatch::revert(), PatchMgr::setLattice(), ComputeSelfTuples< TholeElem, Thole, TholeValue >::~ComputeSelfTuples(), GlobalMasterServer::~GlobalMasterServer(), HomePatch::~HomePatch(), and ProxyPatch::~ProxyPatch().

00035 { return rep->array + rep->arraySize; }

template<class Elem>
int ResizeArray< Elem >::find const Elem &  e  )  const [inline]
 

Definition at line 140 of file ResizeArray.h.

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

00140 { return rep->find(e); }

template<class Elem>
int ResizeArray< Elem >::insert const Elem &  elem,
int  index
[inline]
 

Definition at line 117 of file ResizeArray.h.

Referenced by ComputePmeMgr::initialize(), UniqueSortedArray< Elem >::insert(), and SortedArray< Elem >::insert().

00117                                              {
00118       rep->ins(elem,index);
00119       return (index);
00120     }

template<class Elem>
Elem& ResizeArray< Elem >::item int  i  )  [inline]
 

Definition at line 123 of file ResizeArray.h.

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

00123                               {
00124       i = ( i < 0 ? 0 : i );
00125       if ((i+1) > size())
00126           resize(i+1);
00127       return rep->array[i];
00128     }

template<class Elem>
ResizeArray<Elem>& ResizeArray< Elem >::operator= ResizeArray< Elem > &  ra  )  [inline]
 

Definition at line 76 of file ResizeArray.h.

Referenced by SortableResizeArray< PatchElem >::operator=().

00076                                                           {
00077       if ( !(--rep->refCount) )
00078         delete rep;
00079       rep = ra.rep;
00080       rep->refCount++;
00081       return (*this);
00082     }

template<class Elem>
const Elem& ResizeArray< Elem >::operator[] int  index  )  const [inline]
 

Definition at line 132 of file ResizeArray.h.

00132 { return rep->array[index]; }

template<class Elem>
Elem& ResizeArray< Elem >::operator[] int  index  )  [inline]
 

Definition at line 131 of file ResizeArray.h.

00131 { return rep->array[index]; }

template<class Elem>
void ResizeArray< Elem >::resize int  i  )  [inline]
 

Definition at line 92 of file ResizeArray.h.

Referenced by ComputeMap::allocateCids(), PatchMap::basePatchIDList(), ComputeNonbondedCUDA::build_exclusions(), HomePatch::buildSpanningTree(), ProxyMgr::buildSpanningTree0(), GlobalMasterTest::calculate(), GlobalMasterTcl::calculate(), GlobalMasterIMD::calculate(), colvarproxy_namd::calculate(), ComputeMap::cloneCompute(), ComputeGlobal::ComputeGlobal(), ComputeTclBC::ComputeTclBC(), Rebalancer::createSpanningTree(), MigrateAtomsCombinedMsg::distribute(), HomePatch::doAtomMigration(), HomePatch::doPairlistCheck(), ComputeNonbondedCUDA::doWork(), PDB::find_extremes(), ProxyCombinedResultMsg::fromRaw(), generatePmePeList(), generatePmePeList2(), PatchMap::homePatchIDList(), ParallelIOMgr::initialize(), ComputePmeMgr::initialize(), ComputeHomePatches::initialize(), initializePmeMap(), ParallelIOMgr::integrateClusterSize(), ComputeHomeTuples< TholeElem, Thole, TholeValue >::loadTuples(), HomePatch::loweAndersenFinish(), HomePatch::loweAndersenVelocities(), HomePatch::mollyAverage(), HomePatch::mollyMollify(), outputCompressedFile(), Patch::positionsReady(), HomePatch::positionsReady(), GlobalMaster::processData(), ProxyPatch::receiveAll(), ProxyPatch::receiveData(), GlobalMasterServer::recvData(), ProxyMgr::recvPatchProxyInfo(), ProxyMgr::recvProxies(), HomePatch::recvSpanningTree(), HomePatch::saveForce(), CollectionMgr::sendDataStream(), PatchMgr::sendMigrationMsgs(), PatchMgr::sendMovePatches(), HomePatch::setGBISIntrinsicRadii(), HomePatch::setLcpoType(), ComputeMap::storeCompute(), ProxyResultMsg::unpack(), ComputeMap::unpack(), ComputeMgr::updateLocalComputes(), Parameters::~Parameters(), and ProxyPatch::~ProxyPatch().

00092 { rep->resize(i); }

template<class Elem>
void ResizeArray< Elem >::setall const Elem &  elem  )  [inline]
 

Definition at line 98 of file ResizeArray.h.

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

00098                                   {
00099       iterator i = begin();
00100       iterator e = end();
00101       for ( ; i != e; ++i ) *i = elem;
00102     }

template<class Elem>
void ResizeArray< Elem >::setParams int  s,
float  growthFactor
[inline]
 

Definition at line 85 of file ResizeArray.h.

Referenced by ParallelIOMgr::initialize().

00085                                               {      
00086       rep->setResizeParams(s, growthFactor);
00087     }

template<class Elem>
int ResizeArray< Elem >::size void   )  const [inline]
 

Definition at line 135 of file ResizeArray.h.

Referenced by MigrateAtomsCombinedMsg::add(), ComputeNonbondedCUDA::assignPatches(), ParallelIOMgr::bcastMolInfo(), HomePatch::boxClosed(), SortableResizeArray< PatchElem >::bsearch(), ComputeNonbondedCUDA::build_exclusions(), ProxyMgr::buildProxySpanningTree(), ProxyMgr::buildProxySpanningTree2(), HomePatch::buildSpanningTree(), ProxyMgr::buildSpanningTree0(), ParallelIOMgr::calcAtomsInEachPatch(), GlobalMasterTest::calculate(), GlobalMasterIMD::calculate(), GlobalMaster::check(), ComputeMap::cloneCompute(), ComputeHomeTuples< TholeElem, Thole, TholeValue >::ComputeHomeTuples(), WorkDistrib::createAtomLists(), WorkDistrib::createHomePatches(), ParallelIOMgr::createHomePatches(), ProxyMgr::createProxies(), Rebalancer::decrSTLoad(), SortedArray< PatchElem >::del(), HomePatch::depositMigration(), CollectionMaster::disposeForces(), CollectionMaster::disposePositions(), CollectionMaster::disposeVelocities(), MigrateAtomsCombinedMsg::distribute(), HomePatch::doAtomMigration(), ComputeNonbondedCUDA::doWork(), ComputeHomeTuples< TholeElem, Thole, TholeValue >::doWork(), ResizeArrayPrimIter< Compute * >::end(), ResizeArrayIter< PatchElem >::end(), ComputeMap::extendPtrs(), SortedArray< PatchElem >::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(), GenericMol::getNumAngles(), GromacsTopFile::getNumAngles(), GenericMol::getNumAtoms(), GromacsTopFile::getNumAtoms(), GenericMol::getNumBonds(), GromacsTopFile::getNumBonds(), GenericMol::getNumDihedrals(), GromacsTopFile::getNumDihedrals(), GenericMol::getNumRes(), AtomTable::getType(), GlobalMasterSMD::GlobalMasterSMD(), GromacsTopFile::GromacsTopFile(), Rebalancer::incrSTLoad(), ComputePmeMgr::initialize(), ComputeHomePatches::initialize(), initializePmeMap(), UniqueSortedArray< Elem >::insert(), SortedArray< Elem >::insert(), ParallelIOMgr::integrateClusterSize(), ParallelIOMgr::integrateMigratedAtoms(), OptPmeZPencil::many_to_many_recv_grid(), OptPmeZPencil::many_to_many_send_ungrid(), ParallelIOMgr::migrateAtomsMGrp(), PmeZPencil::node_process_grid(), ComputeNonbondedCUDA::noWork(), outputProxyTree(), PACK_MSG(), HomePatch::positionsReady(), GlobalMaster::processData(), HomePatch::receiveResult(), OptPmeZPencil::recv_grid(), ComputeMgr::recvComputeConsForceMsg(), GlobalMasterServer::recvData(), ParallelIOMgr::recvFinalClusterCoor(), PatchMgr::recvMigrateAtomsCombined(), ProxyMgr::recvNodeAwareSpanningTree(), ComputeGlobal::recvResults(), ProxyMgr::recvSpanningTree(), HomePatch::recvSpanningTree(), ComputeNonbondedCUDA::recvYieldDevice(), Patch::registerDEdaSumDeposit(), Patch::registerForceDeposit(), ComputeNonbondedCUDA::registerPatches(), HomePatch::registerProxy(), Patch::registerPsiSumDeposit(), HomePatch::revert(), PmeZPencil::send_all_ungrid(), GlobalMasterIMD::send_energies(), GlobalMasterIMD::send_fcoords(), ParallelIOMgr::sendAtomsToHomePatchProcs(), PatchMgr::sendMigrationMsgs(), PatchMgr::sendMovePatches(), ComputeMgr::sendNonbondedCUDASlaveEnqueue(), OptPmeCompute::sendPencils(), HomePatch::sendProxies(), HomePatch::sendSpanningTree(), ProxyMgr::sendSpanningTrees(), DihedralTable::size(), AngleTable::size(), BondTable::size(), AtomTable::size(), CollectionMgr::submitForces(), CollectionMgr::submitPositions(), CollectionMgr::submitVelocities(), ProxyCombinedResultMsg::toRaw(), SortableResizeArray< Elem >::uniq(), ComputeMgr::updateLocalComputes3(), ParallelIOMgr::updateMolInfo(), ParallelIOMgr::wrapCoor(), GlobalMasterIMD::~GlobalMasterIMD(), and Parameters::~Parameters().

00135 { return rep->size(); }


Friends And Related Function Documentation

template<class Elem>
friend class ResizeArrayIter<Elem> [friend]
 

Definition at line 26 of file ResizeArray.h.


Member Data Documentation

template<class Elem>
ResizeArrayRaw<Elem>* ResizeArray< Elem >::rep [protected]
 

Definition at line 29 of file ResizeArray.h.

Referenced by ResizeArrayIter< PatchElem >::operator *(), ResizeArrayIter< PatchElem >::operator->(), ResizeArray< AngleElem >::operator=(), and ResizeArray< AngleElem >::ResizeArray().


The documentation for this class was generated from the following file:
Generated on Fri May 25 04:07:24 2012 for NAMD by  doxygen 1.3.9.1