PSCF v1.2
EdgeIterator.h
1#ifndef PSCF_EDGE_ITERATOR_H
2#define PSCF_EDGE_ITERATOR_H
3
4/*
5* PSCF - Polymer Self-Consistent Field Theory
6*
7* Copyright 2016 - 2022, 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 reference
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
84 int currentVertexId() const;
85
89 bool isEnd() const;
90
94 bool notEnd() const;
95
96 private:
97
98 // Index of current edge.
99 int currentEdgeId_;
100
101 // Index of current vertex.
102 int currentVertexId_;
103
104 // Index of target edge.
105 int targetEdgeId_;
106
107 // Index of target vertex.
108 int targetVertexId_;
109
110 // Pointer to associated PolymerSpecies object.
111 PolymerSpecies const * polymerPtr_;
112
113 };
114
115}
116#endif
Edge iterator for graph associated with a polymer.
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.
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
Utility classes for scientific computation.