PSCF v1.2
VertexIterator.h
1#ifndef PSCF_VERTEX_ITERATOR_H
2#define PSCF_VERTEX_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
38 {
39
40 public:
41
47 VertexIterator(PolymerSpecies const & polymer);
48
53
57 void begin(int sourceId, int targetId);
58
63
67 int currentId() const;
68
72 bool isEnd() const;
73
77 bool notEnd() const;
78
79 private:
80
81 // Index of current vertex.
82 int currentId_;
83
84 // Index of target vertex.
85 int targetId_;
86
87 // Pointer to associated PolymerSpecies object.
88 PolymerSpecies const * polymerPtr_;
89
90 };
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.
VertexIterator & operator++()
Increment operator - move to next vertex.
~VertexIterator()
Destructor.
int currentId() const
Get index of the current vertex.
bool isEnd() const
Return true iff currentId == targetId.
void begin(int sourceId, int targetId)
Initialize iterator.
VertexIterator(PolymerSpecies const &polymer)
Constructor.
PSCF package top-level namespace.
Definition param_pc.dox:1
Utility classes for scientific computation.