PSCF v1.4.0
VertexIterator.h
1#ifndef PSCF_VERTEX_ITERATOR_H
2#define PSCF_VERTEX_ITERATOR_H
3
4/*
5* PSCF - Polymer Self-Consistent Field
6*
7* Copyright 2015 - 2025, The Regents of the University of Minnesota
8* Distributed under the terms of the GNU General Public License.
9*/
10
11#include <pscf/chem/PolymerSpecies.h>
12
13namespace Pscf {
14
15 using namespace Util;
16
34 template <typename WT>
36 {
37
38 public:
39
45 VertexIterator(PolymerSpecies<WT> const & polymer);
46
51
55 void begin(int sourceId, int targetId);
56
61
65 int currentId() const;
66
70 bool isEnd() const;
71
75 bool notEnd() const;
76
77 private:
78
79 // Index of current vertex.
80 int currentId_;
81
82 // Index of target vertex.
83 int targetId_;
84
85 // Pointer to associated PolymerSpecies object.
86 PolymerSpecies<WT> const * polymerPtr_;
87
88 };
89
90 extern template class VertexIterator<double>;
91
92}
93#endif
Descriptor for a linear or acyclic branched block polymer.
Vertex iterator for graph associated with a polymer.
bool notEnd() const
Return true iff currentId != targetId.
int currentId() const
Get index of the current vertex.
VertexIterator & operator++()
Increment operator - move to next vertex.
bool isEnd() const
Return true iff currentId == targetId.
VertexIterator(PolymerSpecies< WT > const &polymer)
Constructor.
~VertexIterator()
Destructor.
void begin(int sourceId, int targetId)
Initialize iterator.
PSCF package top-level namespace.