apoCHARMM 1.0.0
High-performance molecular dynamics simulations on GPUs
 
Loading...
Searching...
No Matches
AngleKey Struct Reference

Stores an ordered triple of CHARMM atom-type names for angle lookup. More...

#include <CharmmParameters.h>

Public Member Functions

 AngleKey (const std::string &iatom, const std::string &jatom, const std::string &katom)
 Constructs an angle key from three atom-type names.
 
bool operator== (const AngleKey &other) const
 Returns whether two ordered angle keys are equal.
 

Public Attributes

std::string atom1
 
std::string atom2
 
std::string atom3
 

Friends

bool operator< (const AngleKey &first, const AngleKey &second)
 Orders angle keys in descending lexicographic atom-type order.
 
std::ostream & operator<< (std::ostream &output, const AngleKey &key)
 Writes the three atom-type names followed by a trailing space.
 

Detailed Description

Stores an ordered triple of CHARMM atom-type names for angle lookup.

The parser canonicalizes an angle by sorting its outer atom types before it constructs this value. Direct construction performs no sorting or case conversion.

Constructor & Destructor Documentation

◆ AngleKey()

AngleKey::AngleKey ( const std::string &  iatom,
const std::string &  jatom,
const std::string &  katom 
)
inline

Constructs an angle key from three atom-type names.

Parameters
[in]iatomFirst outer atom-type name to copy.
[in]jatomCentral atom-type name to copy.
[in]katomSecond outer atom-type name to copy.
Exceptions
std::bad_allocIf copying an atom-type name requires an allocation that fails.

Member Function Documentation

◆ operator==()

bool AngleKey::operator== ( const AngleKey other) const
inline

Returns whether two ordered angle keys are equal.

Parameters
[in]otherKey to compare with this key.
Returns
true when all three names match in the same order; otherwise, false.

Friends And Related Symbol Documentation

◆ operator<

bool operator< ( const AngleKey first,
const AngleKey second 
)
friend

Orders angle keys in descending lexicographic atom-type order.

Parameters
[in]firstLeft key to compare.
[in]secondRight key to compare.
Returns
true when first sorts before second by descending atom1, atom2, and then atom3.

◆ operator<<

std::ostream & operator<< ( std::ostream &  output,
const AngleKey key 
)
friend

Writes the three atom-type names followed by a trailing space.

Parameters
[in,out]outputStream that receives the text.
[in]keyAngle key to write.
Returns
output after the write.

Member Data Documentation

◆ atom1

std::string AngleKey::atom1

Stores the first outer atom-type name exactly as supplied.

◆ atom2

std::string AngleKey::atom2

Stores the central atom-type name exactly as supplied.

◆ atom3

std::string AngleKey::atom3

Stores the second outer atom-type name exactly as supplied.