Simpatico  v1.10
List of all members | Public Member Functions
DdMd::PairIterator Class Reference

Detailed Description

Iterator for pairs in a PairList.

A loop over atom pairs, such as that required to calculated forces or energies, can take the following form:

PairList pairList;
// [build the PairList]
// Loop over pairs
Atom* atom1Ptr;
Atom* atom2Ptr;
for (pairList.begin(iter); iterator.notEnd(); ++iter) {
iterator.getPair(atom1Ptr, atom2Ptr);
// [Do something with atom1Ptr and atom2Ptr]
++iter;
}

Definition at line 48 of file ddMd/neighbor/PairIterator.h.

#include <PairIterator.h>

Public Member Functions

 PairIterator ()
 Default constructor. More...
 
 PairIterator (const PairList &pairList)
 Initializing constructor. More...
 
PairIteratoroperator++ ()
 Increment to next pair. More...
 
bool isEnd () const
 Return true if at end of PairList. More...
 
bool notEnd () const
 Return true if not at end of PairList. More...
 
void getPair (Atom *&atom1Ptr, Atom *&atom2Ptr) const
 Get pointers for current pair of Atoms. More...
 

Constructor & Destructor Documentation

DdMd::PairIterator::PairIterator ( )
inline

Default constructor.

Creates an uninitialized iterator, which is not associated with a parent PairList.

Definition at line 133 of file ddMd/neighbor/PairIterator.h.

DdMd::PairIterator::PairIterator ( const PairList pairList)
inline

Initializing constructor.

Creates an initialized iterator, for which the current pair is the first pair in a parent PairList.

Parameters
pairListparent PairList object.

Definition at line 146 of file ddMd/neighbor/PairIterator.h.

References DdMd::PairList::begin().

Member Function Documentation

PairIterator & DdMd::PairIterator::operator++ ( )
inline

Increment to next pair.

Definition at line 172 of file ddMd/neighbor/PairIterator.h.

bool DdMd::PairIterator::isEnd ( ) const
inline

Return true if at end of PairList.

When isEnd() is true, the current pair is already one past past the end of the pairlist, and is thus invalid.

Definition at line 188 of file ddMd/neighbor/PairIterator.h.

bool DdMd::PairIterator::notEnd ( ) const
inline
void DdMd::PairIterator::getPair ( Atom *&  atom1Ptr,
Atom *&  atom2Ptr 
) const
inline

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