Gromacs
5.1.4
|
#include <gromacs/selection/nbsearch.h>
Initialized neighborhood pair search with a fixed set of positions.
This class is used to loop through pairs of neighbors within the cutoff provided to AnalysisNeighborhood. The following code demonstrates its use:
It is not possible to use a single search object from multiple threads concurrently.
This class works like a pointer: copies of it point to the same search. In general, avoid creating copies, and only use the copy/assignment support for moving the variable around. With C++11, this class would best be movable.
Methods in this class do not throw.
Public Types | |
typedef boost::shared_ptr < internal::AnalysisNeighborhoodPairSearchImpl > | ImplPointer |
Internal short-hand type for a pointer to the implementation class. More... | |
Public Member Functions | |
AnalysisNeighborhoodPairSearch (const ImplPointer &impl) | |
Internally initialize the search. More... | |
bool | findNextPair (AnalysisNeighborhoodPair *pair) |
Finds the next pair within the cutoff. More... | |
void | skipRemainingPairsForTestPosition () |
Skip remaining pairs for a test position in the search. More... | |
typedef boost::shared_ptr<internal::AnalysisNeighborhoodPairSearchImpl> gmx::AnalysisNeighborhoodPairSearch::ImplPointer |
Internal short-hand type for a pointer to the implementation class.
See AnalysisNeighborhoodSearch::ImplPointer for rationale of using shared_ptr and ownership semantics.
|
explicit |
Internally initialize the search.
Used to implement AnalysisNeighborhoodSearch::startPairSearch(). Cannot be called from user code.
bool gmx::AnalysisNeighborhoodPairSearch::findNextPair | ( | AnalysisNeighborhoodPair * | pair | ) |
Finds the next pair within the cutoff.
[out] | pair | Information about the found pair. |
If the method returns false, pair
will be invalid.
void gmx::AnalysisNeighborhoodPairSearch::skipRemainingPairsForTestPosition | ( | ) |
Skip remaining pairs for a test position in the search.
When called after findNextPair(), makes subsequent calls to findNextPair() skip any pairs that have the same test position as that previously returned. This is useful if the caller wants to search whether any reference position within the cutoff satisfies some condition. This method can be used to skip remaining pairs after the first such position has been found if the remaining pairs would not have an effect on the outcome.