SpinParser  1.0
Public Member Functions | Protected Attributes | List of all members
SublatticeIterator Struct Reference

Sublattice iterator object. More...

#include <Lattice.hpp>

Inheritance diagram for SublatticeIterator:
Inheritance graph
[legend]
Collaboration diagram for SublatticeIterator:
Collaboration graph
[legend]

Public Member Functions

 SublatticeIterator (int *allowedIds)
 Construct a new SublatticeIterator object over a list of representative ids. More...
 
SublatticeIteratoroperator++ ()
 Prefix increment operator. More...
 
SublatticeIteratoroperator-- ()
 Prefix decrement operator. More...
 
- Public Member Functions inherited from LatticeIterator
 LatticeIterator ()
 Construct a new LatticeIterator object, which points to the representative id 0 per default.
 
 LatticeIterator (int id)
 Construct a new LatticeIterator object and initialize it to any representative id. More...
 
bool operator== (const LatticeIterator &rhs) const
 Comparison operator. More...
 
bool operator!= (const LatticeIterator &rhs) const
 Negative comparison operator. More...
 
int operator- (const LatticeIterator &rhs) const
 Subtraction operator. More...
 

Protected Attributes

int offset
 Offset relative to the first entry of SublatticeIterator::allowedIds.
 
int * allowedIds
 List of representative ids that make up the sublattice. Memory is not owned by the iterator.
 
- Protected Attributes inherited from LatticeIterator
int id
 Representative id which the iterator points to.
 

Detailed Description

Sublattice iterator object.

Constructor & Destructor Documentation

◆ SublatticeIterator()

SublatticeIterator::SublatticeIterator ( int *  allowedIds)
inline

Construct a new SublatticeIterator object over a list of representative ids.

The SublatticeIterator does not take ownership of the list. It must be guaranteed that the list remains valid during the entire lifetiem of the iterator object. The list mus be terminated by a lattice->end() entry.

Parameters
allowedIdsList of representative ids that make up the sublattice. Must be terminated by lattice->end().

Member Function Documentation

◆ operator++()

SublatticeIterator& SublatticeIterator::operator++ ( )
inlinevirtual

Prefix increment operator.

Returns
SublatticeIterator& Reference to self.

Reimplemented from LatticeIterator.

◆ operator--()

SublatticeIterator& SublatticeIterator::operator-- ( )
inlinevirtual

Prefix decrement operator.

Returns
SublatticeIterator& Reference to self.

Reimplemented from LatticeIterator.


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