Generated on Tue Dec 16 13:34:50 2008 for ell-3.0.0 by doxygen 1.5.1

ell::LT_SaddleNet_AM Class Reference

#include <LT_SaddleNet.hh>

Inheritance diagram for ell::LT_SaddleNet_AM:

Inheritance graph
[legend]

Detailed Description

An LT_SaddleNet_AM is a LT_SaddleNet instantiation representing the minima of the landscape and the lowest connecting direct saddle points between pairs of minima. A saddle is part of the contact plane between of the basins of the two minima.

Thus a saddle net is an undirected graph where the nodes are representing minima and edges are representing a direct saddle between the connected minima (nodes).

An LT_SaddleNet_AM uses a full square adjacency matrix to store the saddle net adjacency information. Thus it has an O(n^2) space complexity for n minima but an O(1) time complexity when accessing a concrete saddle point. It is therefore usefull for highly connected landscapes but not very memory efficient if the resulting matrix stays sparsely filled with a few connections per minimum only.

Author:
Hannes Kochniss, Martin Mann

Definition at line 124 of file LT_SaddleNet.hh.

Public Types

typedef std::map< int, size_t > Int2SizeT_MAP

Public Member Functions

virtual const size_t addMin (const State *const m)
virtual bool addSaddle (const State *const m_i, const State *const m_j, const State *const s)
virtual bool addSaddle (const size_t i, const size_t j, const State *const s)
virtual void clear ()
virtual double getAvgSaddleEnergy (void) const
virtual double getDistance (const LandscapeTopology *const lt) const
virtual const State *const getMFEState () const
virtual const State *const getMin (size_t i) const
virtual const size_t getMinCount () const
virtual const size_t getMinIndex (const State *const m) const
virtual const StategetSaddle (const size_t m1, const size_t m2) const
virtual size_t getSaddleNumber (void) const
virtual bool isSaddle (const size_t m1, const size_t m2) const
virtual bool isSorted () const
 LT_SaddleNet_AM (const LT_SaddleNet_AM &toCopy)
 LT_SaddleNet_AM (const size_t matrixDimension=0)
virtual LT_SaddleNet_AMoperator= (const LT_SaddleNet_AM &toCopy)
virtual std::pair< int, std::string > read (std::istream &in, const State *const templateState)
virtual void sort ()
virtual void write (std::ostream &out, const bool writeGraph=false) const
virtual ~LT_SaddleNet_AM ()

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 &LT_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 &LT_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 const std::string LT_ID
static size_t MatrixResizeAdd
static double MISSING_MINIMUM_PENALTY
static double MISSING_SADDLE_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)

Protected Attributes

biu::Matrix< const State * > adjacent
const StatemfeState
std::vector< size_t > minAccess
size_t numOfMin
double saddleESum
size_t saddleNum
bool sorted
size_t sortedEnd

Static Protected Attributes

static const State *const NULLpointer
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 [inherited]

Definition at line 30 of file LandscapeTopology.hh.


Constructor & Destructor Documentation

ell::LT_SaddleNet_AM::~LT_SaddleNet_AM (  )  [virtual]

Definition at line 174 of file LT_SaddleNet.cc.

ell::LT_SaddleNet_AM::LT_SaddleNet_AM ( const size_t  matrixDimension = 0  ) 

Creates an empty saddle net, while the adjacency matrix will be created with the given dimension.

Parameters:
matrixDimension the number of rows and columsn the adjacency matrix should be initially created with.

Definition at line 183 of file LT_SaddleNet.cc.

ell::LT_SaddleNet_AM::LT_SaddleNet_AM ( const LT_SaddleNet_AM toCopy  ) 

copy construction

Parameters:
toCopy the saddle net to copy

Definition at line 200 of file LT_SaddleNet.cc.


Member Function Documentation

const size_t ell::LT_SaddleNet_AM::addMin ( const State *const  m  )  [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 first minimum to add
Returns:
the index of the minimum in the landscape

Implements ell::LandscapeTopology.

Definition at line 312 of file LT_SaddleNet.cc.

bool ell::LT_SaddleNet_AM::addSaddle ( const State *const  m_i,
const State *const  m_j,
const State *const  s 
) [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

Implements ell::LandscapeTopology.

Definition at line 392 of file LT_SaddleNet.cc.

bool ell::LT_SaddleNet_AM::addSaddle ( const size_t  i,
const size_t  j,
const State *const  s 
) [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

Implements ell::LandscapeTopology.

Definition at line 350 of file LT_SaddleNet.cc.

void ell::LT_SaddleNet_AM::clear (  )  [virtual]

Clears the data structure and removes all stored information to be filled again afterwards.

Implements ell::LandscapeTopology.

Definition at line 283 of file LT_SaddleNet.cc.

double ell::LT_SaddleNet_AM::getAvgSaddleEnergy ( void   )  const [virtual]

Access to the average energy of all saddles represented by the saddle net. Access by this implementation in O(1).

Returns:
the average energy of all saddles

Implements ell::LT_SaddleNet.

Definition at line 772 of file LT_SaddleNet.cc.

double ell::LT_SaddleNet::getDistance ( const LandscapeTopology *const  lt  )  const [virtual, inherited]

Calculates the relative 'distance' between two saddle networks. It is done on the minima and saddles. 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. For all O(n^2) saddles in the nets the RMSD is calculated and summed to the minima penalty. For each saddle s present in one of the saddle nets only, MISSING_SADDLE_PENALTY*(e^(-energy(s)/BOLTZMANN_KT)) is added to the square deviation sum instead.

Parameters:
lt the saddle net to calculate the distance to
Returns:
the distance

Reimplemented from ell::LandscapeTopology.

Definition at line 44 of file LT_SaddleNet.cc.

const State *const ell::LT_SaddleNet_AM::getMFEState (  )  const [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)

Implements ell::LandscapeTopology.

Definition at line 449 of file LT_SaddleNet.cc.

const State *const ell::LT_SaddleNet_AM::getMin ( size_t  i  )  const [virtual]

Access to a minimum.

Parameters:
i index of the minimum to access
Returns:
the State with the specified minimum index

Implements ell::LandscapeTopology.

Definition at line 413 of file LT_SaddleNet.cc.

const size_t ell::LT_SaddleNet_AM::getMinCount (  )  const [virtual]

Access to the number of stored minima.

Returns:
the number of minima

Implements ell::LandscapeTopology.

Definition at line 440 of file LT_SaddleNet.cc.

const size_t ell::LT_SaddleNet_AM::getMinIndex ( const State *const  m  )  const [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

Implements ell::LandscapeTopology.

Definition at line 425 of file LT_SaddleNet.cc.

const State * ell::LT_SaddleNet_AM::getSaddle ( const size_t  m1,
const size_t  m2 
) const [virtual]

Access to the direct saddle connecting two minima if existing.

Parameters:
m1 the index of the first minimum
m2 the index of the second minimum
Returns:
the saddle State or NULL if no direct saddle exists

Implements ell::LT_SaddleNet.

Definition at line 760 of file LT_SaddleNet.cc.

size_t ell::LT_SaddleNet_AM::getSaddleNumber ( void   )  const [virtual]

Access to the number of all saddles represented by the saddle net. Access in O(1).

Returns:
the number of all saddles

Implements ell::LT_SaddleNet.

Definition at line 784 of file LT_SaddleNet.cc.

double ell::LandscapeTopology::getSortedMinimaDistance ( const std::vector< const State * > &  m1,
const std::vector< const State * > &  m2 
) [static, protected, inherited]

Definition at line 121 of file LandscapeTopology.cc.

bool ell::LT_SaddleNet_AM::isSaddle ( const size_t  m1,
const size_t  m2 
) const [virtual]

Checks if two minima are connected via a direct saddle.

Parameters:
m1 the index of the first minimum
m2 the index of the second minimum
Returns:
true if there is a direct saddle stored in the topology

Implements ell::LT_SaddleNet.

Definition at line 739 of file LT_SaddleNet.cc.

bool ell::LT_SaddleNet_AM::isSorted (  )  const [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.

Implements ell::LandscapeTopology.

Definition at line 497 of file LT_SaddleNet.cc.

LT_SaddleNet_AM & ell::LT_SaddleNet_AM::operator= ( const LT_SaddleNet_AM toCopy  )  [virtual]

Assignment operator.

Parameters:
toCopy the saddle net this object should be a copy of
Returns:
access to the changed this object

Definition at line 232 of file LT_SaddleNet.cc.

std::pair< int, std::string > ell::LandscapeTopology::parseBarrier ( LandscapeTopology toFill,
const std::string &  line,
const State *const  templateState,
const Int2SizeT_MAP idx2min 
) [static, inherited]

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, inherited]

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
Returns:
a the parsed connection State and an error string if an error occured and the State is NULL

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, inherited]

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, inherited]

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, inherited]

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.

std::pair< int, std::string > ell::LT_SaddleNet_AM::read ( std::istream &  in,
const State *const  templateState 
) [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

second step: get all the minima and barriers

if graphViz data starts.. end the reading

Implements ell::LandscapeTopology.

Definition at line 507 of file LT_SaddleNet.cc.

void ell::LT_SaddleNet_AM::sort (  )  [virtual]

Sorts the minima ascending by their energy (mfe minimum gets index 0). If energy is equal they are sorted by their string representation.

Implements ell::LandscapeTopology.

Definition at line 461 of file LT_SaddleNet.cc.

void ell::LT_SaddleNet_AM::write ( std::ostream &  out,
const bool  writeGraph = false 
) const [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

step 1: save the datastructure for later reconstruction as comments in graphviz file

step 2: write the graph in DOT language

Implements ell::LandscapeTopology.

Definition at line 660 of file LT_SaddleNet.cc.

void ell::LandscapeTopology::writeBarrier ( std::ostream &  out,
const State *const  barrier,
const size_t  index,
const std::vector< size_t > &  minConnected 
) [static, inherited]

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, inherited]

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, inherited]

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, inherited]

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, inherited]

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, inherited]

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

biu::Matrix< const State* > ell::LT_SaddleNet_AM::adjacent [protected]

The adjacency matrix storing the minima on the diagonal and the saddle States at the corresponding position. If a resize is neccessary (when a new minimum is added) it is increased with MatrixResizeAdd columns and rows to minimize the expensive resize and content copy operations.

Definition at line 145 of file LT_SaddleNet.hh.

const double ell::LandscapeTopology::AVOGADRO_CONSTANT_NA [static, inherited]

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, inherited]

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, inherited]

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, inherited]

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, inherited]

Index value that is used to propagate the information about invalid indexing.

Definition at line 37 of file LandscapeTopology.hh.

const std::string ell::LT_SaddleNet::LT_ID [static, inherited]

string identification of this landscape topology type for IO

Definition at line 26 of file LT_SaddleNet.hh.

The number of columns and rows added if the adjacency matrix has to be resized to minimize the expensive resize and content copy operations.

Definition at line 132 of file LT_SaddleNet.hh.

The mfe State in the landscape topology.

Definition at line 155 of file LT_SaddleNet.hh.

std::vector<size_t> ell::LT_SaddleNet_AM::minAccess [protected]

Vector of matrix indices to allow for a sorted access to the minima of the topology without restructuring the adjacency matrix.

Definition at line 152 of file LT_SaddleNet.hh.

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.

double ell::LT_SaddleNet::MISSING_SADDLE_PENALTY [static, inherited]

The penalty used to score a missing direct saddle when comparing two saddle net topologies using the 'getDistance' method. NOTE: Has to be set according to the used energy function and the weighting of missing saddles in the distance score. If missing direct saddles are of no relevance set this value to 0.0!

Definition at line 34 of file LT_SaddleNet.hh.

const State *const ell::LT_SaddleNet_AM::NULLpointer [static, protected]

Pointer to NULL for the initialization of the adjacency matrix.

Definition at line 138 of file LT_SaddleNet.hh.

size_t ell::LT_SaddleNet_AM::numOfMin [protected]

The current number of minima represented by the topology.

Definition at line 148 of file LT_SaddleNet.hh.

const std::string ell::LandscapeTopology::OUTPUT_KEY_BARRIER [static, protected, inherited]

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, inherited]

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, inherited]

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, inherited]

keyword used by the read and write method to identify information on a saddle point

Definition at line 350 of file LandscapeTopology.hh.

sum of all saddle energies represented by the saddle net

Definition at line 165 of file LT_SaddleNet.hh.

size_t ell::LT_SaddleNet_AM::saddleNum [protected]

number of all saddles represented by the saddle net

Definition at line 168 of file LT_SaddleNet.hh.

bool ell::LT_SaddleNet_AM::sorted [protected]

whether or not minAccess is sorted

Definition at line 158 of file LT_SaddleNet.hh.

size_t ell::LT_SaddleNet_AM::sortedEnd [protected]

holds the last position of minAccess up to that the range is sorted

Definition at line 162 of file LT_SaddleNet.hh.


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