ElfPSP_AntColony
Protein Structure Prediction using Ant Colony Optimization
hpchain.h
Go to the documentation of this file.
1 #pragma once
2 
5 #include <string>
6 
8 class HPChain {
9  std::string dChain;
11 public:
13  HPChain() : dChain(""){}
14 
16  HPChain(const char *chain) : dChain(chain){}
17 
19  HPChain(std::string chain) : dChain(chain){}
20 
22  std::string &get_chain(){ return dChain; }
23 
25  int length() const { return dChain.length(); }
26 
30  bool validate();
31 
35  char operator[](unsigned int i) const { return dChain[i]; }
36 };
Encapsulates a string representing an HP chain.
Definition: hpchain.h:8
HPChain(std::string chain)
Creates an HP chain with the given string representation, which is copied internally.
Definition: hpchain.h:19
std::string dChain
The HPChain is represented by this string of characters &#39;H&#39; and &#39;P&#39;.
Definition: hpchain.h:9
std::string & get_chain()
Reference to the internal string.
Definition: hpchain.h:22
bool validate()
Validates the internal HP chain.
Definition: hpchain.cc:8
HPChain(const char *chain)
Creates an HP chain with the given string representation, which is copied internally.
Definition: hpchain.h:16
char operator[](unsigned int i) const
Returns the i-th bead type.
Definition: hpchain.h:35
HPChain()
Creates an empty HP chain.
Definition: hpchain.h:13
int length() const
Length of the chain.
Definition: hpchain.h:25