chemfiles::
Selection
¶This class allow to select atoms in a `Frame`, from a selection language.
The selection language is built by combining basic operations. Each basic operation follows the `<selector>[(<variable>)] <operator>
` structure, where `<operator>` is a comparison operator in `== != < <= > >=`. Refer to the full documentation to know the allowed selectors and how to use them.
Public Functions
Selection
(const std::string &selection)¶Create a selection using the given string.
SelectionError
: if there is a error in the selection string evaluate
(const Frame &frame) const¶Evaluates the selection on a given `frame`. This function returns the list of matches in the frame for this selection.
list
(const Frame &frame) const¶Evaluates a selection of size 1 on a given `frame`. This function returns the list of atomic indexes in the frame matching this selection.
SelectionError
: if the selection size is not 1. size
() const¶Size of the matches for this selection.
string
() const¶Get the string used to build this selection.
chemfiles::
Match
¶A match is a set of atomic indexes matching a given selection. The size of a match depends on the associated selection, and can vary from 1 to 4.
Public Functions
operator[]
(size_t i) const¶Get the `i`th index in the match. `i` should be lower than the actual `size()` of the match.
size
() const¶Size of the match, i.e. number of valid indexes in the match. This value is always equals to the size of the `Selection` this match comes from.
Public Static Attributes
MAX_MATCH_SIZE
= 4¶Maximal number of atoms in a match.