|
seams-core v2.14.0
libyodaLib, the C++ engine of d-SEAMS
|
Functions for generating primitive rings. More...
Classes | |
| struct | Vertex |
| This is a collection of elements, for each point, required for graph traversal. More... | |
| struct | Graph |
| This is a per-frame object, containing all the vertices for the particular frame, along with the vector of rings generated. More... | |
| class | RingUpdater |
| Exact frame-to-frame maintenance of the primitive ring network. More... | |
| struct | RingSearchSplit |
Enumerations | |
| enum class | RingRows { Auto , Vectors , Packed } |
Functions | |
| std::vector< std::vector< int > > | ringNetwork (const std::vector< std::vector< int > > &nList, int maxDepth) |
| std::vector< int > | atomRingSizeCounts (const std::vector< std::vector< int > > &nList, int maxDepth) |
| std::vector< std::vector< int > > | ringNetworkMinSize (const std::vector< std::vector< int > > &nList, int maxDepth, int minDepth) |
| std::vector< std::vector< int > > | ringNetwork (const std::vector< std::vector< int > > &nList, int maxDepth, RingRows rows) |
| std::vector< std::vector< int > > | ringNetwork (const std::vector< std::vector< int > > &nList, int maxDepth, const std::vector< char > &sources) |
| std::vector< std::vector< int > > | ringNetwork (const std::vector< int > &offsets, const std::vector< int > &cols, int maxDepth, const std::vector< char > &sources={}) |
| void | ringSizeCounts (const std::vector< int > &offsets, const std::vector< int > &cols, int maxDepth, int *counts, int countsLen) |
| std::vector< std::vector< int > > | ringNetworkBalls (const std::vector< std::vector< int > > &nList, int maxDepth) |
| int | lastRingSearchUsedBalls () |
| Graph | populateGraphFromNListID (molSys::PointCloud< molSys::Point< double >, double > &yCloud, const std::vector< std::vector< int > > &neighHbondList) |
| Graph | populateGraphFromIndices (const std::vector< std::vector< int > > &nList) |
| void | restoreEdgesFromIndices (Graph &fullGraph, const std::vector< std::vector< int > > &nList) |
| Graph | countAllRingsFromIndex (const std::vector< std::vector< int > > &neighHbondList, int maxDepth) |
| Creates a vector of vectors of all possible rings. | |
| void | removeNonSPrings (Graph &fullGraph) |
| Removes the non-SP rings, using the Franzblau shortest path criterion. | |
| int | findRings (Graph &fullGraph, int v, std::vector< int > &visited, int maxDepth, int depth, int root=-1) |
| Main function that searches for all rings. | |
| int | shortestPath (Graph &fullGraph, int v, int goal, std::vector< int > &path, std::vector< int > &visited, int maxDepth, int depth=1) |
| Calculates the shortest path. | |
| Graph | clearGraph (Graph ¤tGraph) |
| Function for clearing vectors in Graph after multiple usage. | |
| RingSearchSplit | lastRingSearchSplit () |
| Balls, source enumeration and the gather from the last ringNetwork call. | |
| void | setPhaseTiming (bool on) |
| When set, ringNetwork records the primitive-test time in the split. | |
| double | takePrimitiveMs () |
| Primitive-test milliseconds from the last timed ringNetwork, then zero. | |
| void | setSourceWork (double *microseconds) |
Functions for generating primitive rings.
This namespace contains struct definitions and functions that are used for generating primitive (shortest-path) rings (directed cyclic graphs).
The Vertex object is a collection of elements for each point, required for graph traversal. The Graph object is an object for the whole frame, containing the information of all vertices, and a row-ordered vector of vector of the rings generated.
The Franzblau shortest-path criterion has been used. The SP (shortest-path) criterion is midway between the least restrictive and most restrictive criteria in the hierarchy.
The following is the procedure for finding primitive rings:
|
strong |
Which adjacency the ring search packs before it walks. Auto uses one sorted array per row: a single pass on one thread, a team on several. Vectors keeps a std::vector per atom. Packed forces the array even when the team has one thread. The ring set does not depend on the choice.
| Enumerator | |
|---|---|
| Auto | |
| Vectors | |
| Packed | |
Definition at line 138 of file franzblau.hpp.
| std::vector< int > primitive::atomRingSizeCounts | ( | const std::vector< std::vector< int > > & | nList, |
| int | maxDepth ) |
Per-atom primitive-ring counts, without storing the rings. counts[atom * (maxDepth + 1) + size] is how many rings of that size contain the atom.
Function for clearing vectors in Graph after multiple usage.
| Graph primitive::countAllRingsFromIndex | ( | const std::vector< std::vector< int > > & | neighHbondList, |
| int | maxDepth ) |
Creates a vector of vectors of all possible rings.
|
nodiscard |
Main function that searches for all rings.
|
nodiscard |
Balls, source enumeration and the gather from the last ringNetwork call.
|
nodiscard |
0 when the last ringNetwork call answered every primitivity query from the adjacency rows, 1 when it filled the sorted pair table, 2 when it filled the occupancy bitset of a radius-4 ball, 3 when a radius-2 pair table answers distance 4 by a meet in the middle. Rings of size at most 7 report 0. Rings of size 8 and 9 report 1. Rings of size 10 report 3. ringNetworkBalls always reports 1.
| Graph primitive::populateGraphFromIndices | ( | const std::vector< std::vector< int > > & | nList | ) |
Creates a graph object and fills it with the information from a neighbour list of INDICES NOT ATOM IDs created before. NOTE: the neighbourListIndex contains the indices and NOT the atom IDs as in the neighbour list
| Graph primitive::populateGraphFromNListID | ( | molSys::PointCloud< molSys::Point< double >, double > & | yCloud, |
| const std::vector< std::vector< int > > & | neighHbondList ) |
Creates a graph object and fills it with the information from a neighbour list and pointCloud created before. NOTE: the neighbourListIndex contains the indices and NOT the atom IDs as in the neighbour list
| void primitive::removeNonSPrings | ( | Graph & | fullGraph | ) |
Removes the non-SP rings, using the Franzblau shortest path criterion.
| void primitive::restoreEdgesFromIndices | ( | Graph & | fullGraph, |
| const std::vector< std::vector< int > > & | nList ) |
Re-fills the neighbour lists of a graph object from a neighbour list of INDICES NOT ATOM IDs created before. NOTE: the neighbourListIndex contains the indices and NOT the atom IDs as in the neighbour list
| std::vector< std::vector< int > > primitive::ringNetwork | ( | const std::vector< int > & | offsets, |
| const std::vector< int > & | cols, | ||
| int | maxDepth, | ||
| const std::vector< char > & | sources = {} ) |
Rings of a CSR neighbour graph. cols[offsets[i] .. offsets[i + 1]] are the neighbours of vertex i, with no self entry. The ring set is the one ringNetwork returns for those rows with the vertex written in front of each row.
| std::vector< std::vector< int > > primitive::ringNetwork | ( | const std::vector< std::vector< int > > & | nList, |
| int | maxDepth ) |
Returns a vector of vectors containing the rings (of all sizes), by atom index, given the neighbour list also by index (preferably the hydrogen-bonded neighbour list). Each ring starts at its lowest-indexed member and runs toward the lesser of that member's ring neighbours, and the rings are sorted lexicographically.
| std::vector< std::vector< int > > primitive::ringNetwork | ( | const std::vector< std::vector< int > > & | nList, |
| int | maxDepth, | ||
| const std::vector< char > & | sources ) |
The rings ringNetwork returns whose lowest-indexed member is flagged in sources (by index; empty flags every vertex), in the same order
| std::vector< std::vector< int > > primitive::ringNetwork | ( | const std::vector< std::vector< int > > & | nList, |
| int | maxDepth, | ||
| RingRows | rows ) |
| std::vector< std::vector< int > > primitive::ringNetworkBalls | ( | const std::vector< std::vector< int > > & | nList, |
| int | maxDepth ) |
The same ring set, built with a bounded ball at every vertex and a primitivity test of every pair. ringNetwork leaves that table out when the largest ring is at most 7, because a strict shortcut is then a walk of at most two edges. The timing harness compares the two.
| std::vector< std::vector< int > > primitive::ringNetworkMinSize | ( | const std::vector< std::vector< int > > & | nList, |
| int | maxDepth, | ||
| int | minDepth ) |
Primitive rings whose size is at least minDepth and at most maxDepth. ringNetwork(nList, maxDepth) is minDepth 3. A separate name keeps ringNetwork(nList, maxDepth, {}) the empty source mask.
| void primitive::ringSizeCounts | ( | const std::vector< int > & | offsets, |
| const std::vector< int > & | cols, | ||
| int | maxDepth, | ||
| int * | counts, | ||
| int | countsLen ) |
Ring sizes of the same search as ringNetwork(offsets, cols, maxDepth). counts[s] is the number of primitive rings of size s, for s below countsLen. The rings themselves are not gathered.
| void primitive::setPhaseTiming | ( | bool | on | ) |
When set, ringNetwork records the primitive-test time in the split.
| void primitive::setSourceWork | ( | double * | microseconds | ) |
When non-null, ringNetwork adds each source's enumeration time, in microseconds, at that source's index. The buffer must hold one entry per neighbour-list row. A null buffer skips the clock.
|
nodiscard |
Calculates the shortest path.
| double primitive::takePrimitiveMs | ( | ) |
Primitive-test milliseconds from the last timed ringNetwork, then zero.