24 std::vector<std::vector<int>> tempEmpty;
26 rings.swap(tempEmpty);
41 std::vector<int> *atomTypes,
42 std::vector<int> nRings) {
56 for (
int iring = 0; iring < rings.size(); iring++) {
57 ringSize = rings[iring].size();
59 for (
int j = 0; j < ringSize; j++) {
60 iatom = rings[iring][j];
62 if ((*atomTypes)[iatom] == 1) {
63 (*atomTypes)[iatom] = ringSize;
67 prevRingSize = (*atomTypes)[iatom];
68 if (ringSize > prevRingSize) {
69 (*atomTypes)[iatom] = ringSize;
86 std::vector<int> ring2) {
88 std::vector<int> common;
91 for (
int i = 0; i < ring1.size(); i++) {
95 auto it = std::find(ring2.begin(), ring2.end(), iatom);
97 if (it != ring2.end()) {
98 common.push_back(iatom);
115 std::vector<int> ring2,
116 std::vector<int> ring3) {
124 if (common1.size() == 0) {
132 if (common2.size() == 0) {
150 int ringSize =
ring.size();
151 std::vector<int> ringTriplet;
155 for (
int i = 0; i < ringSize; i++) {
158 ringTriplet.push_back(
ring[i]);
161 for (
int k = 1; k < 3; k++) {
164 if (kIndex >= ringSize) {
167 ringTriplet.push_back(
ring[kIndex]);
172 if (triplet == ringTriplet) {
177 std::reverse(ringTriplet.begin(), ringTriplet.end());
180 if (triplet == ringTriplet) {
199std::vector<std::vector<int>>
202 std::vector<std::vector<int>> ringSingleSize;
207 for (
int iring = 0; iring < rings.size(); iring++) {
210 if (rings[iring].size() == ringSize) {
211 ringSingleSize.push_back(rings[iring]);
215 return ringSingleSize;
227 std::vector<int> commonElements;
230 sort(ring1.begin(), ring1.end());
231 sort(ring2.begin(), ring2.end());
235 std::set_intersection(ring1.begin(), ring1.end(), ring2.begin(),
236 ring2.end(), std::back_inserter(commonElements));
239 if (commonElements.size() == 0) {
260 sort(ring1.begin(), ring1.end());
261 sort(ring2.begin(), ring2.end());
264 (ring1 == ring2) ? result =
true : result =
false;
bool commonElementsInThreeRings(std::vector< int > ring1, std::vector< int > ring2, std::vector< int > ring3)
Common elements in 3 rings.
bool findTripletInRing(std::vector< int > ring, std::vector< int > triplet)
Searches a particular ring for a triplet.
int assignPolygonType(std::vector< std::vector< int > > rings, std::vector< int > *atomTypes, std::vector< int > nRings)
int clearRingList(std::vector< std::vector< int > > &rings)
Erases memory for a vector of vectors for a list of rings.
bool hasCommonElements(std::vector< int > ring1, std::vector< int > ring2)
std::vector< std::vector< int > > getSingleRingSize(std::vector< std::vector< int > > rings, int ringSize)
Returns a vector of vectors of rings of a single size.
std::vector< int > findsCommonElements(std::vector< int > ring1, std::vector< int > ring2)
Returns the common elements of two rings.
bool compareRings(std::vector< int > ring1, std::vector< int > ring2)
Topological network criteria functions.
File containing common functions used by bulk and confined topological network critera.