Gromacs  2024.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions
gmx::IndexGroupsAndNames Class Reference

#include <gromacs/selection/indexutil.h>

Description

Bundle index groups with their names.

Note
This class has to outlive the t_blocka &indexGroup it is given. We want to avoid a deep-copy due to the potentially very large data stored in the t_blocka.
Todo:
update this class, once the two legacy data structures, t_blocka and the char ** of group names are refactored.

Public Member Functions

 IndexGroupsAndNames (gmx::ArrayRef< const IndexGroup > indexGroups)
 Construct from list of index groups. More...
 
bool containsGroupName (const std::string &groupName) const
 Return if a group name is contained in the groups. More...
 
std::vector< Indexindices (const std::string &groupName) const
 Return the integer indices of a group. More...
 

Constructor & Destructor Documentation

gmx::IndexGroupsAndNames::IndexGroupsAndNames ( gmx::ArrayRef< const IndexGroup indexGroups)

Construct from list of index groups.

Parameters
[in]indexGroupsThe list of index groups

Member Function Documentation

bool gmx::IndexGroupsAndNames::containsGroupName ( const std::string &  groupName) const

Return if a group name is contained in the groups.

String comparison is case insensitive

Parameters
[in]groupNamethe group name to be queried
Returns
true if index group name is contained
std::vector< Index > gmx::IndexGroupsAndNames::indices ( const std::string &  groupName) const

Return the integer indices of a group.

If two index groups share a name, return the one found first.

Indices may be empty.

Parameters
[in]groupNamethe name of the group whose indices shall be returned
Returns
atom indices of the selected index group
Exceptions
ifgroupName is not present as index group

The documentation for this class was generated from the following files: