Gromacs  2020.4
 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 (const t_blocka &indexGroup, ArrayRef< char const *const > groupNames)
 Construct from index group and group names. 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 ( const t_blocka &  indexGroup,
ArrayRef< char const *const >  groupNames 
)

Construct from index group and group names.

Parameters
[in]indexGroup
[in]groupNamesnames of the 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: