Generated on Mon Jun 23 17:18:18 2008 for ell-2.3.0 by doxygen 1.5.1

ell::IterableNeighbors Class Reference

#include <IterableNeighbors.hh>

Inheritance diagram for ell::IterableNeighbors:

Inheritance graph
[legend]

Detailed Description

The IterableNeighbors interface allows a generic NeighborList for neighborhood generation. Therefore, a neighbor indexing and access has to be provided by the implementing State subclass.

Author:
Martin Mann

Definition at line 16 of file IterableNeighbors.hh.

Public Member Functions

virtual StateapplyNeighborChange (const size_t index, State *const copy) const =0
virtual StategetNeighbor (const size_t index, State *neigh) const=0
virtual size_t getNeighborNumber (void) const =0
virtual StateundoNeighborChange (const size_t index, State *const neigh) const =0
virtual ~IterableNeighbors ()


Constructor & Destructor Documentation

virtual ell::IterableNeighbors::~IterableNeighbors (  )  [inline, virtual]

Definition at line 20 of file IterableNeighbors.hh.


Member Function Documentation

virtual State* ell::IterableNeighbors::applyNeighborChange ( const size_t  index,
State *const   copy 
) const [pure virtual]

Applies the necessary changes to a given state to get the neighbor. Note: @copy is expected to be a copy (i.e. *this == *copy) and therefore direct changes are possible and != NULL.

Parameters:
index the neighbor to generate
copy a copy of *this the changes should be applied to
Returns:
copy = the neighbor state of the given index or NULL if the index is out of range

Implemented in ell::S_LP, ell::S_SG_Ising, and ell::S_SG_NPP.

virtual State* ell::IterableNeighbors::getNeighbor ( const size_t  index,
State neigh 
) const [pure virtual]

Access to a specific neighbor.

Parameters:
index the index of the neighbor in [0, getNeighborNumber())
neigh if != NULL this state should be converted into the neighbor otherwise a new one is created and returned
Returns:
the new neighbor state or NULL if the index is >= getNeighborNumber()

Implemented in ell::S_LP, ell::S_SG_Ising, and ell::S_SG_NPP.

virtual size_t ell::IterableNeighbors::getNeighborNumber ( void   )  const [pure virtual]

How many neighbor indices are accessible.

Returns:
the number of neighbors

Implemented in ell::S_LP, and ell::S_SG_Ising.

virtual State* ell::IterableNeighbors::undoNeighborChange ( const size_t  index,
State *const   neigh 
) const [pure virtual]

Undo the changes done to this state to generate the given neighbor. The goal is to do less operations than doing a full copy like (*neigh = *this).

Parameters:
index the neighbor index that was applied last [ 0, getNeighborNumber() )
neigh the state resulting from the last changes
Returns:
the copy of this object via undoing the last changes in neigh or NULL if neigh == NULL

Implemented in ell::S_LP, and ell::S_SG_Ising.


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