ElfPSP_AntColony
Protein Structure Prediction using Ant Colony Optimization
Public Member Functions | Private Attributes | List of all members
HPChain Class Reference

Encapsulates a string representing an HP chain. More...

#include <hpchain.h>

Public Member Functions

 HPChain ()
 Creates an empty HP chain. More...
 
 HPChain (const char *chain)
 Creates an HP chain with the given string representation, which is copied internally. More...
 
 HPChain (std::string chain)
 Creates an HP chain with the given string representation, which is copied internally. More...
 
std::string & get_chain ()
 Reference to the internal string. More...
 
int length () const
 Length of the chain. More...
 
bool validate ()
 Validates the internal HP chain. More...
 
char operator[] (unsigned int i) const
 Returns the i-th bead type. More...
 

Private Attributes

std::string dChain
 The HPChain is represented by this string of characters 'H' and 'P'. More...
 

Detailed Description

Encapsulates a string representing an HP chain.

Constructor & Destructor Documentation

◆ HPChain() [1/3]

HPChain::HPChain ( )
inline

Creates an empty HP chain.

◆ HPChain() [2/3]

HPChain::HPChain ( const char *  chain)
inline

Creates an HP chain with the given string representation, which is copied internally.

◆ HPChain() [3/3]

HPChain::HPChain ( std::string  chain)
inline

Creates an HP chain with the given string representation, which is copied internally.

Member Function Documentation

◆ get_chain()

std::string& HPChain::get_chain ( )
inline

Reference to the internal string.

◆ length()

int HPChain::length ( ) const
inline

Length of the chain.

◆ operator[]()

char HPChain::operator[] ( unsigned int  i) const
inline

Returns the i-th bead type.

Returns
Either 'P' or 'H', the i-th bead's type.

◆ validate()

bool HPChain::validate ( )

Validates the internal HP chain.

Returns 'true' if the internal string contains only 'H' and 'P' characters.

Member Data Documentation

◆ dChain

std::string HPChain::dChain
private

The HPChain is represented by this string of characters 'H' and 'P'.


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