PSCF v1.3
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 // Forward declaration
16 class PolymerSpecies;
17
18 using namespace Util;
19
39 {
40
41 public:
42
48 EdgeIterator(PolymerSpecies const & polymer);
49
54
61 void begin(int sourceId, int targetId);
62
67
71 int currentEdgeId() const;
72
76 int currentDirectionId() const;
77
89 int currentVertexId() const;
90
94 bool isEnd() const;
95
99 bool notEnd() const;
100
101 private:
102
103 // Index of current edge.
104 int currentEdgeId_;
105
106 // Direction index for the current edge.
107 int currentDirectionId_;
108
109 // Index of current vertex.
110 int currentVertexId_;
111
112 // Index of target edge.
113 int targetEdgeId_;
114
115 // Index of target vertex.
116 int targetVertexId_;
117
118 // Pointer to associated PolymerSpecies object.
119 PolymerSpecies const * polymerPtr_;
120
121 };
122
123}
124#endif
int currentVertexId() const
Get index of the current vertex.
int currentEdgeId() const
Get index of the current edge.
~EdgeIterator()
Destructor.
EdgeIterator(PolymerSpecies const &polymer)
Constructor.
int currentDirectionId() const
Get direction index for the path within the current edge.
bool notEnd() const
Return true iff currentId != targetId.
void begin(int sourceId, int targetId)
Initialize iterator.
EdgeIterator & operator++()
Increment operator - move to next vertex.
bool isEnd() const
Return true iff currentId == targetId.
Descriptor for a linear or acyclic branched block polymer.
PSCF package top-level namespace.
Definition param_pc.dox:1