PSCF v1.4.0
EdgeIterator.h
1#ifndef PSCF_EDGE_ITERATOR_H
2#define PSCF_EDGE_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
35 template <typename WT>
37 {
38
39 public:
40
46 EdgeIterator(PolymerSpecies<WT> const & polymer);
47
52
59 void begin(int sourceId, int targetId);
60
65
69 int currentEdgeId() const;
70
74 int currentDirectionId() const;
75
87 int currentVertexId() const;
88
92 bool isEnd() const;
93
97 bool notEnd() const;
98
99 private:
100
101 // Index of current edge.
102 int currentEdgeId_;
103
104 // Direction index for the current edge.
105 int currentDirectionId_;
106
107 // Index of current vertex.
108 int currentVertexId_;
109
110 // Index of target edge.
111 int targetEdgeId_;
112
113 // Index of target vertex.
114 int targetVertexId_;
115
116 // Pointer to associated PolymerSpecies object.
117 PolymerSpecies<WT> const * polymerPtr_;
118
119 };
120
121 extern template class EdgeIterator<double>;
122
123}
124#endif
Edge iterator for graph associated with a polymer.
int currentEdgeId() const
Get index of the current edge.
int currentVertexId() const
Get index of the current vertex.
EdgeIterator< WT > & operator++()
Increment operator - move to next vertex.
int currentDirectionId() const
Get direction index for the path within the current edge.
bool isEnd() const
Return true iff currentId == targetId.
void begin(int sourceId, int targetId)
Initialize iterator.
EdgeIterator(PolymerSpecies< WT > const &polymer)
Constructor.
~EdgeIterator()
Destructor.
bool notEnd() const
Return true iff currentId != targetId.
Descriptor for a linear or acyclic branched block polymer.
PSCF package top-level namespace.