1 #ifndef BALL_STRUCTURE_BONDORDERS_FPTBONDORDERSTRATEGY_H
2 #define BALL_STRUCTURE_BONDORDERS_FPTBONDORDERSTRATEGY_H
4 #ifndef BALL_COMMON_GLOBAL_H
8 #ifndef BALL_MATHS_COMMON_H
12 #ifndef BALL_KERNEL_ATOMCONTAINER_H
16 #ifndef BALL_KERNEL_BOND_H
20 #ifndef BALL_DATATYPE_HASHMAP_H
24 #ifndef BALL_DATATYPE_GRAPH_H
28 #ifndef BALL_DATATYPE_GRAPH_GRAPHALGORITHMS_H
32 #ifndef BALL_DATATYPE_GRAPH_TREEWIDTH_H
36 #ifndef BALL_STRUCTURE_BONDORDERS_BONDORDERASSIGNMENTSTRATEGY_H
40 #ifndef BALL_STRUCTURE_BONDORDERS_BONDORDERASSIGNMENT_H
52 #include <boost/shared_ptr.hpp>
53 #include <boost/ref.hpp>
191 virtual void clear();
200 virtual bool readOptions(
const Options& options);
201 virtual void setDefaultOptions();
208 virtual boost::shared_ptr<BondOrderAssignment> computeNextSolution();
237 DPConfig_(std::vector<Valence>
const& v, std::vector<BondOrder>
const& bo);
247 template<
typename ValenceIterator,
typename BondIterator>
248 DPConfig_(ValenceIterator vit, ValenceIterator vend, BondIterator boit, BondIterator boend)
249 : consumed_valences(vit, vend),
250 bond_assignments(boit, boend)
294 Size numberOfAtoms()
const;
299 Size numberOfBonds()
const;
341 typedef std::map<DPConfig_, Penalty>
DPMap_;
460 std::vector<MolecularGraphTraits::EdgeType>
bonds;
493 Penalty upper_bound = infinite_penalty);
523 boost::shared_ptr<TreeDecomposition>
ntd_;
563 std::vector<DPTable_*>::const_iterator begin, std::vector<DPTable_*>::const_iterator end);
641 std::vector<MolecularGraphTraits::EdgeType>& child_bonds,
Size forgotten_index);
676 boost::shared_ptr<TreeWidth<MolecularGraph> >
tw;
755 std::vector<BondOrder>
const& getBondOrders()
const;
844 bool operator() (
Edge const& e1,
Edge const& e2);
942 typedef std::pair<DPTable_::const_iterator, DPTable_::const_iterator>
DPPairIt_;
958 typedef std::multimap<DPConfig_ const*, Penalty, DPJoinMapComparator_>
DPJoinMap_;
997 std::vector<MolecularGraphTraits::EdgeType>
const&
bonds,
Penalty upperbound = infinite_penalty);
1033 bool hasMoreSolutions()
const;
1039 void nextSolution();
1045 Penalty penaltyOfNextSolution()
const;
1051 bags_->push_back(node);
1091 std::multiset<BackTrackingState_*, StateComparator_>
queue_;
1102 std::vector<MolecularGraphTraits::EdgeType>
const*
bonds_;
1107 boost::shared_ptr<std::vector<TreeDecompositionBag> >
bags_;
1197 bool isSolutionNeeded(
Penalty penalty);
1249 Size solution_number,
Penalty upper_bound = infinite_penalty);
1271 bool hasMoreSolutions()
const;
1277 void nextSolution();
1293 Penalty penaltyOfNextSolution()
const;
1312 std::priority_queue<Assignment_, std::vector<Assignment_>, std::greater<Assignment_> >
priority_queue_;
1344 std::pair<Size, Penalty> getNextMinimumBackTracker_()
const;
1351 void applyAssignment_(
Size backtracker_index,
Size solution_index);
1362 void combineEachSolution_(
Size mindex);
1367 std::vector<DPBackTracking_*> deepCopyOfBacktrackers_()
const;
1373 void initPenaltyData_();
1415 #endif // BALL_STRUCTURE_BONDORDERS_FPTBONDORDERSTRATEGY_H
boost::shared_ptr< DPBackTrackingCombiner_ > combiner_
void preorder(TreeDecompositionBag node, TreeDecomposition &)
vector< FPTBondOrderAssignment_ * > bond_assignments
vector< Bond const * > bonds
Assignment of bond orders from topology information.
std::vector< std::vector< Assignment_ > > component_solutions_
DPConfig_(ValenceIterator vit, ValenceIterator vend, BondIterator boit, BondIterator boend)
TreeWidth< MolecularGraph >::TreeDecomposition TreeDecomposition
FPTBondOrderStrategy * parent_
std::vector< MolecularGraphTraits::EdgeType > const * bonds_
std::vector< DPBackTracking_ * > backtrackers_
vector< AdditionalBagProperties_ > properties_
std::stack< std::pair< DPConfig_, Size > > join_branches
TreeWidth< MolecularGraph >::TreeDecompositionBag TreeDecompositionBag
BackTrackingState_ * current_state_
std::set< OriginalVertexType > TreeDecompositionContent
GRAPH::GraphTraits< MolecularGraph >::VertexType VertexType
DPMap_::const_iterator const_iterator
BondOrder max_bond_order_
TreeWidth< MolecularGraph >::TreeDecompositionBag TreeDecompositionBag
MolecularGraph * molecule_graph
TreeWidth< MolecularGraph >::TreeDecomposition TreeDecomposition
std::multiset< BackTrackingState_ *, StateComparator_ > queue_
BALL_EXPORT AtomList atoms(const AtomContainer &fragment, const String &expression=String())
std::priority_queue< Assignment_, std::vector< Assignment_ >, std::greater< Assignment_ > > priority_queue_
BALL_EXPORT bool operator>(const String &s1, const String &s2)
TreeWidth< MolecularGraph >::TreeDecompositionContent TreeDecompositionContent
boost::shared_ptr< ComputingData_ > computing_data_
boost::shared_ptr< std::vector< TreeDecompositionBag > > bags_
DPMap_::iterator iterator
Size num_computed_solutions_
void postorder(TreeDecompositionBag, TreeDecomposition &)
static const Valence max_valence
GRAPH::GraphTraits< MolecularGraph >::EdgeType Edge
static const Penalty infinite_penalty
GRAPH::GraphTraits< MolecularGraph >::EdgeType Edge
boost::graph_traits< Graph >::edge_descriptor EdgeType
std::pair< boost::reference_wrapper< DPConfig_ const >, Penalty > DPConstRow_
vector< TreeDecompositionBag > BagVector
std::vector< MolecularGraphTraits::EdgeType > bonds
boost::graph_as_tree< TreeDecompositionGraph, TreeDecompositionParentMap > TreeDecomposition
std::vector< BondOrder > bonds_
FPTBondOrderAssignment_ * bond_assignment_
std::multimap< DPConfig_ const *, Penalty, DPJoinMapComparator_ > DPJoinMap_
std::vector< BondOrder > bond_assignments
std::vector< MolecularGraphTraits::EdgeType > sorted_edges
std::pair< boost::reference_wrapper< DPConfig_ >, Penalty > DPRow_
boost::graph_traits< Graph >::vertex_descriptor VertexType
BALL_EXPORT bool operator>=(const String &s1, const String &s2)
BALL_EXPORT bool operator==(const String &s1, const String &s2)
EdgeComparator_(MolecularGraph *graph)
BALL_EXPORT bool operator<=(const String &s1, const String &s2)
std::map< DPConfig_, Penalty > DPMap_
boost::shared_ptr< TreeWidth< MolecularGraph > > tw
std::vector< int > const * block_to_start_valence_
boost::graph_traits< TreeDecompositionGraph >::vertex_descriptor TreeDecompositionBag
std::pair< DPConfig_ *, Penalty > DPPointerRow_
std::vector< Valence > consumed_valences
BALL_EXPORT BondList bonds(const AtomContainer &fragment, bool selected_only=false)
std::vector< int > const * penalties_
std::vector< Size > const * block_to_length_
boost::shared_ptr< TreeDecomposition > ntd_
void inorder(TreeDecompositionBag, TreeDecomposition &)
static Penalty UPPER_PENALTY_BOUND
std::pair< DPTable_::const_iterator, DPTable_::const_iterator > DPPairIt_
static String UPPER_PENALTY_BOUND
Base class for bond order assignment algorithms.
std::vector< std::vector< int > > const * atom_to_block_
MolecularGraph * molecule_
Index compare(const T1 &a, const T2 &b)
std::vector< Position > const * block_to_start_idx_
BALL_EXPORT bool operator<(const String &s1, const String &s2)