ell::LandscapeTopology Class Reference
#include <LandscapeTopology.hh>
Inheritance diagram for ell::LandscapeTopology:
Detailed Description
An abstract representation of the landscapes topology that represents minima and adjacency information like saddle points or barriers between them.
Definition at line 23 of file LandscapeTopology.hh.
Public Types | |
typedef std::map< int, size_t > | Int2SizeT_MAP |
Public Member Functions | |
virtual const size_t | addMin (const State *const m)=0 |
virtual bool | addSaddle (const State *const m_i, const State *const m_j, const State *const s)=0 |
virtual bool | addSaddle (const size_t i, const size_t j, const State *const s)=0 |
virtual void | clear ()=0 |
virtual double | getDistance (const LandscapeTopology *const lt) const |
virtual const State *const | getMFEState () const=0 |
virtual const State *const | getMin (size_t i) const =0 |
virtual const size_t | getMinCount () const=0 |
virtual const size_t | getMinIndex (const State *const m) const=0 |
virtual bool | isSorted () const=0 |
virtual std::pair< int, std::string > | read (std::istream &in, const State *const templateState)=0 |
virtual void | sort ()=0 |
virtual void | write (std::ostream &out, const bool writeGraph=false) const =0 |
virtual | ~LandscapeTopology () |
Static Public Member Functions | |
static std::pair< int, std::string > | parseBarrier (LandscapeTopology &toFill, const std::string &line, const State *const templateState, const Int2SizeT_MAP &idx2min) |
static std::pair< int, std::string > | parseHeader (const std::string &line, std::string <_ID, size_t &minNumber, std::string &StateDescription) |
static std::pair< int, std::string > | parseMinimum (LandscapeTopology &toFill, const std::string &line, const State *const templateState, Int2SizeT_MAP &idx2min) |
static std::pair< int, std::string > | parseSaddle (LandscapeTopology &toFill, const std::string &line, const State *const templateState, const Int2SizeT_MAP &idx2min) |
static void | writeBarrier (std::ostream &out, const State *const barrier, const size_t index, const std::vector< size_t > &minConnected) |
static void | writeHeader (std::ostream &out, const std::string <_ID, const size_t minNumber, const std::string &StateDescription) |
static void | writeMinimum (std::ostream &out, const std::vector< const State * > &minima, const size_t index) |
static void | writeMinimum (std::ostream &out, const State *const minimum, const size_t index) |
static void | writeSaddle (std::ostream &out, const State *const saddle, const size_t index, const std::vector< size_t > &minConnected) |
Static Public Attributes | |
static const double | AVOGADRO_CONSTANT_NA |
static const double | BOLTZMANN_CONSTANT_KB |
static double | BOLTZMANN_KT |
static const double | GAS_CONSTANT_R |
static const size_t | INVALID_INDEX |
static double | MISSING_MINIMUM_PENALTY |
Static Protected Member Functions | |
static double | getSortedMinimaDistance (const std::vector< const State * > &m1, const std::vector< const State * > &m2) |
static std::pair< State *, std::string > | parseConnection (const std::string &line, const State *const templateState, const Int2SizeT_MAP &idx2min, const std::string &connectionKey, std::vector< size_t > &connectedMinima) |
static void | writeConnection (std::ostream &out, const State *const connectionState, const size_t index, const std::vector< size_t > &minConnected, const std::string &connectionKey) |
Static Protected Attributes | |
static const std::string | OUTPUT_KEY_BARRIER |
static const std::string | OUTPUT_KEY_ELL_HEAD |
static const std::string | OUTPUT_KEY_MINIMUM |
static const std::string | OUTPUT_KEY_SADDLE |
Member Typedef Documentation
typedef std::map< int, size_t > ell::LandscapeTopology::Int2SizeT_MAP |
Definition at line 30 of file LandscapeTopology.hh.
Constructor & Destructor Documentation
ell::LandscapeTopology::~LandscapeTopology | ( | ) | [virtual] |
Member Function Documentation
virtual const size_t ell::LandscapeTopology::addMin | ( | const State *const | m | ) | [pure virtual] |
Adds an UNKNOWN minimum to the topology. NOTE : this operation should NOT change the indices of already existing minima in the topology ! FURTHER : the minimum is not checked if it is already known
- Parameters:
-
m the minimum to add
- Returns:
- the index of the minimum in the landscape
Implemented in ell::LT_AutoFlood, ell::LT_BarrierTree, ell::LT_MinimaSet, and ell::LT_SaddleNet_AM.
virtual bool ell::LandscapeTopology::addSaddle | ( | const State *const | m_i, | |
const State *const | m_j, | |||
const State *const | s | |||
) | [pure virtual] |
Sets a saddle point that connects two minima
- Parameters:
-
m_i the first minimum to connect m_j the second minimum to connect s the State representating the saddle point
- Returns:
- whether or not the data structure has been changed
Implemented in ell::LT_AutoFlood, ell::LT_BarrierTree, ell::LT_MinimaSet, and ell::LT_SaddleNet_AM.
virtual bool ell::LandscapeTopology::addSaddle | ( | const size_t | i, | |
const size_t | j, | |||
const State *const | s | |||
) | [pure virtual] |
Sets a saddle point that connects two minima
- Parameters:
-
i index of the first minimum to connect j index of the second minimum to connect s the State representating the saddle point
- Returns:
- whether or not the data structure has been changed
Implemented in ell::LT_AutoFlood, ell::LT_BarrierTree, ell::LT_MinimaSet, and ell::LT_SaddleNet_AM.
virtual void ell::LandscapeTopology::clear | ( | ) | [pure virtual] |
Clears the data structure and removes all stored information to be filled again afterwards.
Implemented in ell::LT_AutoFlood, ell::LT_BarrierTree, ell::LT_MinimaSet, and ell::LT_SaddleNet_AM.
double ell::LandscapeTopology::getDistance | ( | const LandscapeTopology *const | lt | ) | const [virtual] |
Calculates the relative 'distance' between landscape topologies. On the LandscapeTopology level it is done on the minima only. For each minimum m present in only one of the two LTs a value of MISSING_MINIMUM_PENALTY*(e^(-energy(m)/BOLTZMANN_KT)) is summed. The resulting sum is normalized by the number of (unique) minima in both topologies.
- Parameters:
-
lt the landscape topology to calculate the distance to
- Returns:
- the distance
Reimplemented in ell::LT_AutoFlood, ell::LT_BarrierTree, ell::LT_MinimaSet, and ell::LT_SaddleNet.
Definition at line 88 of file LandscapeTopology.cc.
virtual const State* const ell::LandscapeTopology::getMFEState | ( | ) | const [pure virtual] |
Access to the global minimum of the landscape with minimal free energy (mfe).
- Returns:
- the minimum with smallest energy (and smallest string representation for tiebreaking)
Implemented in ell::LT_AutoFlood, ell::LT_MinimaSet, and ell::LT_SaddleNet_AM.
virtual const State* const ell::LandscapeTopology::getMin | ( | size_t | i | ) | const [pure virtual] |
Access to a minimum.
- Parameters:
-
i index of the minimum to access
- Returns:
- the State with the specified minimum index
Implemented in ell::LT_AutoFlood, ell::LT_MinimaSet, and ell::LT_SaddleNet_AM.
virtual const size_t ell::LandscapeTopology::getMinCount | ( | ) | const [pure virtual] |
Access to the number of stored minima.
- Returns:
- the number of minima
Implemented in ell::LT_AutoFlood, ell::LT_MinimaSet, and ell::LT_SaddleNet_AM.
virtual const size_t ell::LandscapeTopology::getMinIndex | ( | const State *const | m | ) | const [pure virtual] |
Access to the minimum index.
- Parameters:
-
m the minimum of that the index should be accessed
- Returns:
- the index of the minimum, or INVALID_INDEX if 'm' is no known minimum
Implemented in ell::LT_AutoFlood, ell::LT_MinimaSet, and ell::LT_SaddleNet_AM.
double ell::LandscapeTopology::getSortedMinimaDistance | ( | const std::vector< const State * > & | m1, | |
const std::vector< const State * > & | m2 | |||
) | [static, protected] |
Definition at line 121 of file LandscapeTopology.cc.
virtual bool ell::LandscapeTopology::isSorted | ( | ) | const [pure virtual] |
Check if the minima of the landscape are sorted ascendingly by their energy (mfe minimum gets index 0). If energy is equal they are sorted by their string representation.
Implemented in ell::LT_AutoFlood, ell::LT_MinimaSet, and ell::LT_SaddleNet_AM.
std::pair< int, std::string > ell::LandscapeTopology::parseBarrier | ( | LandscapeTopology & | toFill, | |
const std::string & | line, | |||
const State *const | templateState, | |||
const Int2SizeT_MAP & | idx2min | |||
) | [static] |
Parses a barrier string encoding produced by 'writeBarrier' method and adds the encoded BARRIER as a SADDLE to the topology given.
- Parameters:
-
toFill the landscape topology to add the barrier to line the string that encodes the barrier (encoding follows 'write' method) templateState the State template to create new State objects via its 'fromString' function idx2min the mapping of minima indices in the string to the indices in the given landscape topology 'toFill'
- Returns:
- an error encoding and an error string : 0 = no error occured, read was successfull -3 = read error (see error string)
Definition at line 458 of file LandscapeTopology.cc.
std::pair< State *, std::string > ell::LandscapeTopology::parseConnection | ( | const std::string & | line, | |
const State *const | templateState, | |||
const Int2SizeT_MAP & | idx2min, | |||
const std::string & | connectionKey, | |||
std::vector< size_t > & | connectedMinima | |||
) | [static, protected] |
Parses a string encoding of a minima connection of a topology produced by 'writeBarrier' method and returns the connection state and the list of minima connected.
- Parameters:
-
line the string that encodes the connection (encoding follows 'write' method) templateState the State template to create new State objects via its 'fromString' function idx2min the mapping of minima indices in the string to the indices in the given landscape topology 'toFill' connectionKey the key used to encode the connection connectedMinima OUTPUT parameter where the indices of the connected minima of the parsed connection are stored to
Definition at line 533 of file LandscapeTopology.cc.
std::pair< int, std::string > ell::LandscapeTopology::parseHeader | ( | const std::string & | line, | |
std::string & | LT_ID, | |||
size_t & | minNumber, | |||
std::string & | StateDescription | |||
) | [static] |
Parses the descriptive header of a landscape topology produced by 'writeHeader' method.
- Parameters:
-
line the string that encodes the header information (encoding follows 'write' method) LT_ID the ID string of the topology in stream minNumber the number of minima the topology in stream holds, if minima are grouped in the topology the number of groups is given. StateDescription a string description of the State model represented by the topology in the stream
- Returns:
- an error encoding and an error string : 0 = no error occured, read was successfull, the string contains the remaining line content, -3 = read error (see error string)
Definition at line 204 of file LandscapeTopology.cc.
std::pair< int, std::string > ell::LandscapeTopology::parseMinimum | ( | LandscapeTopology & | toFill, | |
const std::string & | line, | |||
const State *const | templateState, | |||
Int2SizeT_MAP & | idx2min | |||
) | [static] |
Parses a minimum string encoding produced by 'writeMinimum' method and adds the encoded minimum state to the given topology. Furthermore, it returns the remaining line content that can contain further minima that were merged with the first (already added) 'main' minimum. Thus a further parsing can be done later if necessary.
- Parameters:
-
toFill the barrier tree to add the barrier to line the string that encodes the minimum (encoding follows 'write' method) templateState the State template to create new State objects via its 'fromString' function idx2min the mapping of minima indices in the string to the indices in the given landscape topology 'toFill'
- Returns:
- an error encoding and an error string : 0 = no error occured, read was successfull, the string contains the remaining line content, -3 = read error (see error string)
Definition at line 315 of file LandscapeTopology.cc.
std::pair< int, std::string > ell::LandscapeTopology::parseSaddle | ( | LandscapeTopology & | toFill, | |
const std::string & | line, | |||
const State *const | templateState, | |||
const Int2SizeT_MAP & | idx2min | |||
) | [static] |
Parses a saddle string encoding produced by 'writeBarrier' method and adds the encoded direct saddle to the topology given.
- Parameters:
-
toFill the landscape topology to add the saddle to line the string that encodes the saddle (encoding follows 'write' method) templateState the State template to create new State objects via its 'fromString' function idx2min the mapping of minima indices in the string to the indices in the given landscape topology 'toFill'
- Returns:
- an error encoding and an error string : 0 = no error occured, read was successfull -3 = read error (see error string)
Definition at line 494 of file LandscapeTopology.cc.
virtual std::pair<int,std::string> ell::LandscapeTopology::read | ( | std::istream & | in, | |
const State *const | templateState | |||
) | [pure virtual] |
Fills the landscape topology from stream.
- Parameters:
-
in the input stream to read from. templateState the State template to create new State objects via its 'fromString' function
- Returns:
- an error encoding and an error string : 0 = no error occured, read was successfull -1 = landscape topology type not supported -2 = state description differs from the given one -3 = other read errors
Implemented in ell::LT_AutoFlood, ell::LT_BarrierTree, ell::LT_MinimaSet, and ell::LT_SaddleNet_AM.
virtual void ell::LandscapeTopology::sort | ( | ) | [pure virtual] |
Sorts the minima ascending by their energy (mfe minimum gets index 0). If energy is equal they are sorted by their string representation.
Implemented in ell::LT_AutoFlood, ell::LT_MinimaSet, and ell::LT_SaddleNet_AM.
virtual void ell::LandscapeTopology::write | ( | std::ostream & | out, | |
const bool | writeGraph = false | |||
) | const [pure virtual] |
Writes the current landscape topology to stream.
- Parameters:
-
out the output stream to write to. writeGraph whether or not the output should contain a graph representation of the topology in graphviz DOT format
Implemented in ell::LT_AutoFlood, ell::LT_BarrierTree, ell::LT_MinimaSet, and ell::LT_SaddleNet_AM.
void ell::LandscapeTopology::writeBarrier | ( | std::ostream & | out, | |
const State *const | barrier, | |||
const size_t | index, | |||
const std::vector< size_t > & | minConnected | |||
) | [static] |
Writes a barrier of a landscape topology to stream.
- Parameters:
-
out the output stream to write to. barrier the barrier to add index the index of the barrier minConnected the minima connected by the barrier
Definition at line 398 of file LandscapeTopology.cc.
void ell::LandscapeTopology::writeConnection | ( | std::ostream & | out, | |
const State *const | connectionState, | |||
const size_t | index, | |||
const std::vector< size_t > & | minConnected, | |||
const std::string & | connectionKey | |||
) | [static, protected] |
Writes a minima connection of a landscape topology to stream.
- Parameters:
-
out the output stream to write to. connectionState the State representing the connection index the index of the connection minConnected the minima connected connectionKey the key used to encode the connection
Definition at line 430 of file LandscapeTopology.cc.
void ell::LandscapeTopology::writeHeader | ( | std::ostream & | out, | |
const std::string & | LT_ID, | |||
const size_t | minNumber, | |||
const std::string & | StateDescription | |||
) | [static] |
Writes the descriptive header of a landscape topology to stream.
- Parameters:
-
out the output stream to write to. LT_ID the ID string of the topology to write minNumber the number of minima the topology holds, if minima are grouped in the topology the number of groups has to be given. StateDescription a string description of the State model represented by the topology
Definition at line 188 of file LandscapeTopology.cc.
void ell::LandscapeTopology::writeMinimum | ( | std::ostream & | out, | |
const std::vector< const State * > & | minima, | |||
const size_t | index | |||
) | [static] |
Writes a group of minima of a landscape topology to stream. NOTE: The FIRST minimum is the only one read by the read function and thus the representative for the whole group!
- Parameters:
-
out the output stream to write to. minima the minima to add index the index of the minimum
Definition at line 296 of file LandscapeTopology.cc.
void ell::LandscapeTopology::writeMinimum | ( | std::ostream & | out, | |
const State *const | minimum, | |||
const size_t | index | |||
) | [static] |
Writes a minimum of a landscape topology to stream.
- Parameters:
-
out the output stream to write to. minimum the minimum to add index the index of the minimum
Definition at line 280 of file LandscapeTopology.cc.
void ell::LandscapeTopology::writeSaddle | ( | std::ostream & | out, | |
const State *const | saddle, | |||
const size_t | index, | |||
const std::vector< size_t > & | minConnected | |||
) | [static] |
Writes a saddle of a landscape topology to stream.
- Parameters:
-
out the output stream to write to. saddle the saddle to write index the index of the saddle minConnected the minima connected by the saddle
Definition at line 414 of file LandscapeTopology.cc.
Field Documentation
const double ell::LandscapeTopology::AVOGADRO_CONSTANT_NA [static] |
Avogadro constant N_A = 6.02214179 * 10^(23) unit : 1/mol
Definition at line 41 of file LandscapeTopology.hh.
const double ell::LandscapeTopology::BOLTZMANN_CONSTANT_KB [static] |
Boltzmann constant K_b = R / N_A = 1.3806504 * 10^(-23) unit : Joule / Kelvin
Definition at line 47 of file LandscapeTopology.hh.
double ell::LandscapeTopology::BOLTZMANN_KT [static] |
The kT value used to calculate the Boltzmann weight e^(-E/kT) of a state in the landscape with an energy of E. NOTE: Has to be set according to the used energy function !!!
Definition at line 54 of file LandscapeTopology.hh.
const double ell::LandscapeTopology::GAS_CONSTANT_R [static] |
Gas constant R = 8.314472 unit : Joule / (Kelvin * mol)
Definition at line 44 of file LandscapeTopology.hh.
const size_t ell::LandscapeTopology::INVALID_INDEX [static] |
Index value that is used to propagate the information about invalid indexing.
Definition at line 37 of file LandscapeTopology.hh.
double ell::LandscapeTopology::MISSING_MINIMUM_PENALTY [static] |
The penalty used to score a missing minimum when comparing two landscape topologies using the 'getDistance' method. NOTE: Has to be set according to the used energy function and the weighting of missing minima in the distance score. If missing minima are of no relevance set this value to 0.0!
Definition at line 61 of file LandscapeTopology.hh.
const std::string ell::LandscapeTopology::OUTPUT_KEY_BARRIER [static, protected] |
keyword used by the read and write method to identify information on a barrier
Definition at line 347 of file LandscapeTopology.hh.
const std::string ell::LandscapeTopology::OUTPUT_KEY_ELL_HEAD [static, protected] |
keyword used by the read and write method to identify information on the landscape topology type etc.
Definition at line 341 of file LandscapeTopology.hh.
const std::string ell::LandscapeTopology::OUTPUT_KEY_MINIMUM [static, protected] |
keyword used by the read and write method to identify information on a minimum
Definition at line 344 of file LandscapeTopology.hh.
const std::string ell::LandscapeTopology::OUTPUT_KEY_SADDLE [static, protected] |
keyword used by the read and write method to identify information on a saddle point
Definition at line 350 of file LandscapeTopology.hh.
The documentation for this class was generated from the following files:
- src/ell/LandscapeTopology.hh
- src/ell/LandscapeTopology.cc