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 resize (int i)
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
void reduce (void)
int find (const Elem &e)

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->resize(0);
00044       rep->refCount = 1;
00045     }

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

Definition at line 48 of file ResizeArray.h.

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

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

Definition at line 55 of file ResizeArray.h.

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

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

Definition at line 61 of file ResizeArray.h.

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

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

Definition at line 67 of file ResizeArray.h.

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

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

Definition at line 72 of file ResizeArray.h.

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


Member Function Documentation

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

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

Definition at line 97 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(), CollectionMgr::CollectVectorInstance::append(), PatchMap::basePatchIDList(), Molecule::build_extra_bonds(), GlobalMasterTest::calculate(), GlobalMasterIMD::calculate(), WorkDistrib::createAtomLists(), ProxyPatch::depositCombinedResultMsg(), HomePatch::depositMigration(), HomePatch::doAtomMigration(), WorkDistrib::fillOnePatchAtoms(), GromacsTopFile::GromacsTopFile(), PatchMap::homePatchIDList(), ComputePmeMgr::initialize(), SortedArray< PatchElem >::load(), ComputeHomeTuples< BondElem, Bond, BondValue >::loadTuples(), GlobalMaster::processData(), GlobalMasterServer::recvData(), ProxyMgr::recvNodeAwareSpanningTree(), ProxyMgr::recvSpanningTree(), HomePatch::registerProxy(), ProxyMgr::removeUnusedProxies(), GlobalMasterFreeEnergy::requestAtom(), GlobalMasterEasy::requestAtom(), ComputeGlobal::saveTotalForces(), HomePatch::sendProxies(), and ProxyCombinedResultMsg::unpack().

00097                                {
00098       int end=rep->size();
00099       rep->ins(elem, end);
00100       return(end);
00101     }

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(), Molecule::build_extra_bonds(), Molecule::build_fixed_atoms(), GlobalMasterIMD::calculate(), Sequencer::correctMomentum(), WorkDistrib::createAtomLists(), ProxyPatch::depositCombinedResultMsg(), HomePatch::depositMigration(), CollectionMaster::disposePositions(), CollectionMaster::disposeVelocities(), HomePatch::doAtomMigration(), HomePatch::doGroupSizeCheck(), HomePatch::doMarginCheck(), HomePatch::doPairlistCheck(), ComputeHomeTuples< BondElem, Bond, BondValue >::doWork(), ComputeHomePatch::doWork(), WorkDistrib::fillOnePatchAtoms(), PDB::find_extremes(), ProxyResultVarsizeMsg::getANewMsg(), GlobalMaster::getGroupMassBegin(), Sequencer::langevinPiston(), Sequencer::langevinVelocities(), Sequencer::langevinVelocitiesBBK1(), Sequencer::langevinVelocitiesBBK2(), Sequencer::maximumMove(), Sequencer::minimizationQuenchVelocity(), PatchMgr::moveAllBy(), Sequencer::newMinimizeDirection(), Sequencer::newMinimizePosition(), ProxyCombinedResultMsg::pack(), PACK_MSG(), Patch::positionsReady(), HomePatch::positionsReady(), Sequencer::quenchVelocities(), Sequencer::reassignVelocities(), ProxyPatch::receiveAll(), ProxyPatch::receiveData(), CollectionMaster::receiveDataStream(), HomePatch::receiveResults(), GlobalMasterServer::recvData(), ComputeGlobal::recvResults(), HomePatch::registerProxy(), Sequencer::reinitVelocities(), Sequencer::reloadCharges(), ProxyMgr::removeUnusedProxies(), Sequencer::rescaleVelocities(), Sequencer::rescaleVelocitiesByFactor(), CollectionMgr::sendDataStream(), ProxyMgr::sendSpanningTrees(), PatchMgr::setLattice(), CollectionMgr::CollectVectorSequence::submitData(), CollectionMaster::CollectVectorSequence::submitData(), Sequencer::submitHalfstep(), Sequencer::submitMinimizeReductions(), Sequencer::submitMomentum(), Sequencer::submitReductions(), Sequencer::tcoupleVelocities(), ProxyCombinedResultMsg::unpack(), ProxyResultMsg::unpack(), HomePatch::unregisterProxy(), GlobalMasterServer::~GlobalMasterServer(), and ProxyPatch::~ProxyPatch().

00034 { return rep->array; }

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 104 of file ResizeArray.h.

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

00104                                   {
00105       return(rep->del(index,num));
00106     }

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

Definition at line 35 of file ResizeArray.h.

Referenced by Molecule::build_fixed_atoms(), ProxyPatch::depositCombinedResultMsg(), HomePatch::depositMigration(), HomePatch::doAtomMigration(), HomePatch::doGroupSizeCheck(), HomePatch::doMarginCheck(), GlobalMaster::getGroupMassEnd(), PatchMgr::moveAllBy(), Patch::positionsReady(), HomePatch::positionsReady(), ProxyPatch::receiveAll(), HomePatch::receiveResults(), GlobalMasterServer::recvData(), ComputeGlobal::recvResults(), ProxyMgr::removeUnusedProxies(), PatchMgr::setLattice(), CollectionMgr::CollectVectorSequence::submitData(), CollectionMaster::CollectVectorSequence::submitData(), ComputeSelfTuples< CrosstermElem, Crossterm, CrosstermValue >::~ComputeSelfTuples(), GlobalMasterServer::~GlobalMasterServer(), and ProxyPatch::~ProxyPatch().

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

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

Reimplemented in SortedArray< Elem >, SortedArray< MovePatch >, SortedArray< ComputeID >, SortedArray< HomePatchElem >, and SortedArray< PatchElem >.

Definition at line 132 of file ResizeArray.h.

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

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

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

Definition at line 109 of file ResizeArray.h.

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

00109                                              {
00110       rep->ins(elem,index);
00111       return (index);
00112     }

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

Definition at line 115 of file ResizeArray.h.

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

00115                               {
00116       i = ( i < 0 ? 0 : i );
00117       if ((i+1) > size())
00118           resize(i+1);
00119       return rep->array[i];
00120     }

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

Definition at line 77 of file ResizeArray.h.

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

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

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

Definition at line 124 of file ResizeArray.h.

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

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

Definition at line 123 of file ResizeArray.h.

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

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

Definition at line 130 of file ResizeArray.h.

00130 { rep->reduce(); }

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

Definition at line 87 of file ResizeArray.h.

Referenced by ComputeMap::allocateCids(), PatchMap::basePatchIDList(), HomePatch::buildSpanningTree(), ProxyMgr::buildSpanningTree0(), GlobalMasterTest::calculate(), GlobalMasterTcl::calculate(), GlobalMasterIMD::calculate(), ComputeGlobal::ComputeGlobal(), ComputeTclBC::ComputeTclBC(), Rebalancer::createSpanningTree(), MigrateAtomsCombinedMsg::distribute(), HomePatch::doAtomMigration(), HomePatch::doPairlistCheck(), PDB::find_extremes(), generatePmePeList(), generatePmePeList2(), PatchMap::homePatchIDList(), ComputeHomePatches::initialize(), ComputeHomeTuples< BondElem, Bond, BondValue >::loadTuples(), HomePatch::mollyAverage(), HomePatch::mollyMollify(), Patch::positionsReady(), HomePatch::positionsReady(), GlobalMaster::processData(), ProxyPatch::receiveAll(), ProxyPatch::receiveData(), GlobalMasterServer::recvData(), ProxyMgr::recvProxies(), HomePatch::recvSpanningTree(), HomePatch::saveForce(), CollectionMgr::sendDataStream(), PatchMgr::sendMovePatches(), ComputeMap::storeCompute(), ProxyCombinedResultMsg::unpack(), ProxyResultMsg::unpack(), Parameters::~Parameters(), and ProxyPatch::~ProxyPatch().

00087 { rep->resize(i); }

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

Definition at line 90 of file ResizeArray.h.

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

00090                                   {
00091       iterator i = begin();
00092       iterator e = end();
00093       for ( ; i != e; ++i ) *i = elem;
00094     }

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

Definition at line 127 of file ResizeArray.h.

Referenced by MigrateAtomsCombinedMsg::add(), CollectionMgr::CollectVectorInstance::append(), CollectionMaster::CollectVectorInstance::append(), SortableResizeArray< PatchElem >::bsearch(), Molecule::build_extra_bonds(), ProxyMgr::buildProxySpanningTree(), ProxyMgr::buildProxySpanningTree2(), HomePatch::buildSpanningTree(), ProxyMgr::buildSpanningTree0(), GlobalMasterTest::calculate(), GlobalMasterIMD::calculate(), GlobalMaster::check(), ComputeHomeTuples< BondElem, Bond, BondValue >::ComputeHomeTuples(), WorkDistrib::createAtomLists(), WorkDistrib::createHomePatches(), ProxyMgr::createProxies(), Rebalancer::decrSTLoad(), SortedArray< PatchElem >::del(), HomePatch::depositMigration(), CollectionMaster::disposePositions(), CollectionMaster::disposeVelocities(), MigrateAtomsCombinedMsg::distribute(), HomePatch::doAtomMigration(), ComputeHomeTuples< BondElem, Bond, BondValue >::doWork(), ResizeArrayPrimIter< ComputeID >::end(), ResizeArrayIter< PatchElem >::end(), WorkDistrib::fillOnePatchAtoms(), SortedArray< PatchElem >::find(), 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(), UniqueSortedArray< Elem >::insert(), SortedArray< Elem >::insert(), ProxyCombinedResultMsg::pack(), PACK_MSG(), HomePatch::positionsReady(), GlobalMaster::processData(), ProxyPatch::receiveAtoms(), HomePatch::receiveResults(), ComputeMgr::recvComputeConsForceMsg(), GlobalMasterServer::recvData(), PatchMgr::recvMigrateAtomsCombined(), ProxyMgr::recvNodeAwareSpanningTree(), ComputeGlobal::recvResults(), ProxyMgr::recvSpanningTree(), HomePatch::recvSpanningTree(), Patch::registerForceDeposit(), HomePatch::registerProxy(), HomePatch::revert(), GlobalMasterIMD::send_energies(), GlobalMasterIMD::send_fcoords(), PatchMgr::sendMovePatches(), HomePatch::sendProxies(), HomePatch::sendSpanningTree(), ProxyMgr::sendSpanningTrees(), DihedralTable::size(), AngleTable::size(), BondTable::size(), AtomTable::size(), CollectionMgr::submitPositions(), CollectionMgr::submitVelocities(), SortableResizeArray< Elem >::uniq(), GlobalMasterIMD::~GlobalMasterIMD(), and Parameters::~Parameters().

00127 { 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 Sun Jul 6 04:07:48 2008 for NAMD by  doxygen 1.3.9.1