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

Stores an ordered quartet of CHARMM atom types for torsion lookup. More...

#include <CharmmParameters.h>

Public Member Functions

 DihedralKey (const std::string &iatom, const std::string &jatom, const std::string &katom, const std::string &latom)
 Constructs a torsion key from four atom-type names.
 
bool operator== (const DihedralKey &other) const
 Returns whether two ordered torsion keys are equal.
 

Public Attributes

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

Friends

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

Detailed Description

Stores an ordered quartet of CHARMM atom types for torsion lookup.

The parameter parser canonicalizes forward and reverse atom-type order before constructing this value. Direct construction performs no canonicalization or case conversion. The name X is used by wildcard matching code.

Constructor & Destructor Documentation

◆ DihedralKey()

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

Constructs a torsion key from four atom-type names.

Parameters
[in]iatomFirst atom-type name to copy.
[in]jatomSecond atom-type name to copy.
[in]katomThird atom-type name to copy.
[in]latomFourth atom-type name to copy.
Exceptions
std::bad_allocIf copying an atom-type name requires an allocation that fails.

Member Function Documentation

◆ operator==()

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

Returns whether two ordered torsion keys are equal.

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

Friends And Related Symbol Documentation

◆ operator<

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

Orders torsion 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, atom3, and then atom4.

◆ operator<<

std::ostream & operator<< ( std::ostream &  output,
const DihedralKey dk 
)
friend

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

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

Member Data Documentation

◆ atom1

std::string DihedralKey::atom1

Stores the first atom-type name exactly as supplied.

◆ atom2

std::string DihedralKey::atom2

Stores the second atom-type name exactly as supplied.

◆ atom3

std::string DihedralKey::atom3

Stores the third atom-type name exactly as supplied.

◆ atom4

std::string DihedralKey::atom4

Stores the fourth atom-type name exactly as supplied.