Gromacs
5.1.2
|
#include <gromacs/selection/nbsearch.h>
Input positions for neighborhood searching.
This class supports uniformly specifying sets of positions for various methods in the analysis neighborhood searching classes (AnalysisNeighborhood and AnalysisNeighborhoodSearch).
Note that copies are not made: only a reference to the positions passed to the constructors are kept. The caller is responsible to ensure that those positions remain in scope as long as the neighborhood search object requires access to them.
Also note that in addition to constructors here, Selection and SelectionPosition provide conversions operators to this type. It is done this way to not introduce a cyclic dependency between the selection code and the neighborhood search code, which in turn allows splitting this search code into a separate lower-level module if desired at some point.
Methods in this class do not throw.
Public Member Functions | |
AnalysisNeighborhoodPositions (const rvec &x) | |
Initializes positions from a single position vector. More... | |
AnalysisNeighborhoodPositions (const rvec x[], int count) | |
Initializes positions from an array of position vectors. | |
AnalysisNeighborhoodPositions (const std::vector< RVec > &x) | |
Initializes positions from a vector of position vectors. | |
AnalysisNeighborhoodPositions & | exclusionIds (ConstArrayRef< int > ids) |
Sets indices to use for mapping exclusions to these positions. More... | |
AnalysisNeighborhoodPositions & | indexed (ConstArrayRef< int > indices) |
Sets indices that select a subset of all positions from the array. More... | |
AnalysisNeighborhoodPositions & | selectSingleFromArray (int index) |
Selects a single position to use from an array. More... | |
Friends | |
class | internal::AnalysisNeighborhoodSearchImpl |
To access the positions for initialization. | |
class | internal::AnalysisNeighborhoodPairSearchImpl |
To access the positions for initialization. | |
|
inline |
Initializes positions from a single position vector.
For positions initialized this way, AnalysisNeighborhoodPair always returns zero in the corresponding index.
This constructor is not explicit to allow directly passing an rvec to methods that accept positions.
|
inline |
Sets indices to use for mapping exclusions to these positions.
The exclusion IDs can always be set, but they are ignored unless actual exclusions have been set with AnalysisNeighborhood::setTopologyExclusions().
|
inline |
Sets indices that select a subset of all positions from the array.
If called, selected positions from the array of positions passed to the constructor is used instead of the whole array. All returned indices from AnalysisNeighborhoodPair objects are indices to the indices
array passed here.
|
inline |
Selects a single position to use from an array.
If called, a single position from the array of positions passed to the constructor is used instead of the whole array. In contrast to the AnalysisNeighborhoodPositions(const rvec &) constructor, AnalysisNeighborhoodPair objects return index
instead of zero.
If used together with indexed(), index
references the index array passed to indexed() instead of the position array.