BALL  1.4.79
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
partialBondOrderAssignment.h
Go to the documentation of this file.
1 #ifndef BALL_STRUCTURE_BONDORDERS_PARTIALBONDORDERASSIGNMENT_H
2 #define BALL_STRUCTURE_BONDORDERS_PARTIALBONDORDERASSIGNMENT_H
3 
4 #ifndef BALL_COMMON_GLOBAL_H
5 # include <BALL/COMMON/global.h>
6 #endif
7 
8 #ifndef BALL_KERNEL_ATOM_H
9 # include <BALL/KERNEL/atom.h>
10 #endif
11 
12 #ifndef BALL_KERNEL_BOND_H
13 # include <BALL/KERNEL/bond.h>
14 #endif
15 
16 #include <boost/shared_ptr.hpp>
17 #include <vector>
18 
19 namespace BALL
20 {
21  class AssignBondOrderProcessor;
22  class BondOrderAssignment;
23 
34  {
35  public:
36  // this enum allows faster access to the type of the chosen heuristic than a string compare
38  {
41  TIGHT
42  };
43 
44  // Constructor
46 
47  // Destructor
49 
50  boost::shared_ptr<BondOrderAssignment> convertToFullAssignment();
51 
52  //
53  void clear();
54 
55  // the less operator.
56  // NOTE: we want a reverse sort, hence we actually return a "greater"
57  bool operator < (const PartialBondOrderAssignment& b) const;
58 
59  // the penalty
60  float coarsePenalty(float atom_type_penalty, float bond_length_penalty) const;
61 
62  // the combined penalty of structure and type penalty
63  float coarsePenalty() const;
64 
65  // the bond length penalty
66  float finePenalty() const {return estimated_bond_length_penalty;}
67 
69  float getAtomTypePenalty(bool include_heuristic_term = true, HEURISTIC_INDEX heuristic_index = SIMPLE);
70 
78  bool estimatePenalty_(bool include_heuristic_term = true, HEURISTIC_INDEX heuristic_index = SIMPLE);
79 
81  float estimateAtomTypePenalty_(Atom* atom,
82  Index atom_index, // the atom index
83  int fixed_valence, // its so far fixed valence (incl. virtual H's)
84  int fixed_virtual_order, // its so far fixed virtual H's
85  int num_free_bonds, // its number of unfixed original bonds
86  HEURISTIC_INDEX heuristic_index);
87 
89  // NOTE: virtual bonds are excluded!
90  float estimateBondLengthPenalty_(Index atom_index, // the atom index
91  const vector<Bond*>& free_bonds,
92  int fixed_virtual_order,
93  int fixed_valence,
94  int num_free_bonds);
95 
96 
97  // the estimated atom type penalty
99  // the estimated bond length penalty
101 
102  // the bond orders
103  // the i-th entry denotes the bondorder of the i-th bond
104  // unset bonds get the order 0
105  vector<short> bond_orders;
106 
107  // the index of the bond last considered
109 
111  };
112 }
113 
114 #endif // BALL_STRUCTURE_BONDORDERS_PARTIALBONDORDERASSIGNMENT_H
Assignment of bond orders from topology information.
#define BALL_EXPORT
Definition: COMMON/global.h:50
A full or partial solution to the AStar-based bond order assignment problem.
BALL_EXPORT bool operator<(const String &s1, const String &s2)