BALL  1.4.79
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Public Attributes | List of all members
BALL::FPTBondOrderStrategy::DPConfig_ Class Reference

#include <BALL/STRUCTURE/BONDORDERS/FPTBondOrderStrategy.h>

Public Member Functions

 DPConfig_ ()
 
 DPConfig_ (Size atoms, Size bonds)
 
 DPConfig_ (std::vector< Valence > const &v, std::vector< BondOrder > const &bo)
 
DPConfig_operator= (DPConfig_ const &copy)
 
template<typename ValenceIterator , typename BondIterator >
 DPConfig_ (ValenceIterator vit, ValenceIterator vend, BondIterator boit, BondIterator boend)
 
bool operator< (DPConfig_ const &conf) const
 
bool operator> (DPConfig_ const &conf) const
 
bool operator<= (DPConfig_ const &conf) const
 
bool operator>= (DPConfig_ const &conf) const
 
bool operator== (DPConfig_ const &conf) const
 
int compare (DPConfig_ const &other) const
 
Size numberOfAtoms () const
 
Size numberOfBonds () const
 

Public Attributes

std::vector< Valenceconsumed_valences
 
std::vector< BondOrderbond_assignments
 

Detailed Description

A DPConfig_ is an entry in a dynamic programming table. It holds the current bond-order assignments, and the valences, which were consumed after forgetting some bonds in forget-nodes. Each DPConfig belongs to just one node in the nice tree decomposition. So it contains just the valences and bondvalues of the atoms and bonds in the bag. DPConfigs are computed in Leaf-nodes or by one (or two) ancestor tables by forgetting, introducing or merging their entries. So even if a DPConfig is empty (as in the root table), you can get the assignment of all ancestors by backtracking the computing of this DPConfig.

Definition at line 220 of file FPTBondOrderStrategy.h.

Constructor & Destructor Documentation

BALL::FPTBondOrderStrategy::DPConfig_::DPConfig_ ( )

Default constructor

BALL::FPTBondOrderStrategy::DPConfig_::DPConfig_ ( Size  atoms,
Size  bonds 
)

Builds a new DPConfig with the given number of atoms and bonds. The valence and bond values are filled with 0.

BALL::FPTBondOrderStrategy::DPConfig_::DPConfig_ ( std::vector< Valence > const &  v,
std::vector< BondOrder > const &  bo 
)

Builds a new DPConfig with the given atom-valences and bond-values

template<typename ValenceIterator , typename BondIterator >
BALL::FPTBondOrderStrategy::DPConfig_::DPConfig_ ( ValenceIterator  vit,
ValenceIterator  vend,
BondIterator  boit,
BondIterator  boend 
)
inline

Builds a new DPConfig and initialize its valences and bond-values with the values which are iterated by the given iterators

Definition at line 248 of file FPTBondOrderStrategy.h.

Member Function Documentation

int BALL::FPTBondOrderStrategy::DPConfig_::compare ( DPConfig_ const &  other) const

Comparison is needed to insert a DPConfig into a tree-map. A DPConfig is equal to another DPConfig if it's valences and bond-values are equal. Other comparisons are done by comparing each valence and bond value seperately. You can compare only entries from the same table or from tables which belong to the same nice tree decomposition bag. The number of valences and bounds have to be equal.

Parameters
otheranother entry of the same table
Returns
1, if this is greather than other, 0, if both entries are equal, otherwise -1.
Exceptions
BALL::Exception::InvalidArgumentif two entries of different tables are compared
Size BALL::FPTBondOrderStrategy::DPConfig_::numberOfAtoms ( ) const

returns the number of atoms of the bag this entry belongs to.

Size BALL::FPTBondOrderStrategy::DPConfig_::numberOfBonds ( ) const

returns the number of bonds of the bag this entry belongs to.

bool BALL::FPTBondOrderStrategy::DPConfig_::operator< ( DPConfig_ const &  conf) const
See also
compare
bool BALL::FPTBondOrderStrategy::DPConfig_::operator<= ( DPConfig_ const &  conf) const
See also
compare
DPConfig_& BALL::FPTBondOrderStrategy::DPConfig_::operator= ( DPConfig_ const &  copy)

Assignment operator

bool BALL::FPTBondOrderStrategy::DPConfig_::operator== ( DPConfig_ const &  conf) const
See also
compare
bool BALL::FPTBondOrderStrategy::DPConfig_::operator> ( DPConfig_ const &  conf) const
See also
compare
bool BALL::FPTBondOrderStrategy::DPConfig_::operator>= ( DPConfig_ const &  conf) const
See also
compare

Member Data Documentation

std::vector<BondOrder> BALL::FPTBondOrderStrategy::DPConfig_::bond_assignments

Holds the current assigned bond values. Every time a new bond is visited in an introduce node, entries for each possible bond value of this bond are inserted into the table. Single bonds habe a bond value of 0, double bonds have the bond value 1 and tripple bonds have the bond value 2. So increasing the valences means adding the bond value + 1 (!) to the valence value.

Definition at line 314 of file FPTBondOrderStrategy.h.

std::vector<Valence> BALL::FPTBondOrderStrategy::DPConfig_::consumed_valences

Every time a bond is forgotten, the consumed valences of its incident vertices are increased by its bond value + 1. If a atom is forgotten, it's consumed valences holds the final valence assignment of this atom.

Definition at line 305 of file FPTBondOrderStrategy.h.