Loading...
Searching...
No Matches
partialBondOrderAssignment.h
Go to the documentation of this file.
#ifndef BALL_STRUCTURE_BONDORDERS_PARTIALBONDORDERASSIGNMENT_H
#define BALL_STRUCTURE_BONDORDERS_PARTIALBONDORDERASSIGNMENT_H
#ifndef BALL_COMMON_GLOBAL_H
# include <BALL/COMMON/global.h>
#endif
#ifndef BALL_KERNEL_ATOM_H
# include <BALL/KERNEL/atom.h>
#endif
#ifndef BALL_KERNEL_BOND_H
# include <BALL/KERNEL/bond.h>
#endif
#include <boost/shared_ptr.hpp>
#include <vector>
namespace BALL
{
class AssignBondOrderProcessor;
class BondOrderAssignment;
class BALL_EXPORT PartialBondOrderAssignment
{
public:
// this enum allows faster access to the type of the chosen heuristic than a string compare
enum HEURISTIC_INDEX
{
SIMPLE,
MEDIUM,
TIGHT
};
// Constructor
PartialBondOrderAssignment(AssignBondOrderProcessor* parent);
// Destructor
~PartialBondOrderAssignment();
boost::shared_ptr<BondOrderAssignment> convertToFullAssignment();
//
void clear();
// the less operator.
// NOTE: we want a reverse sort, hence we actually return a "greater"
bool operator < (const PartialBondOrderAssignment& b) const;
// the penalty
float coarsePenalty(float atom_type_penalty, float bond_length_penalty) const;
// the combined penalty of structure and type penalty
float coarsePenalty() const;
// the bond length penalty
float finePenalty() const {return estimated_bond_length_penalty;}
float getAtomTypePenalty(bool include_heuristic_term = true, HEURISTIC_INDEX heuristic_index = SIMPLE);
bool estimatePenalty_(bool include_heuristic_term = true, HEURISTIC_INDEX heuristic_index = SIMPLE);
float estimateAtomTypePenalty_(Atom* atom,
Index atom_index, // the atom index
int fixed_valence, // its so far fixed valence (incl. virtual H's)
int fixed_virtual_order, // its so far fixed virtual H's
int num_free_bonds, // its number of unfixed original bonds
HEURISTIC_INDEX heuristic_index);
// NOTE: virtual bonds are excluded!
float estimateBondLengthPenalty_(Index atom_index, // the atom index
const vector<Bond*>& free_bonds,
int fixed_virtual_order,
int fixed_valence,
int num_free_bonds);
// the estimated atom type penalty
float estimated_atom_type_penalty;
// the estimated bond length penalty
float estimated_bond_length_penalty;
// the bond orders
// the i-th entry denotes the bondorder of the i-th bond
// unset bonds get the order 0
vector<short> bond_orders;
// the index of the bond last considered
Position last_bond;
AssignBondOrderProcessor* abop;
};
}
#endif // BALL_STRUCTURE_BONDORDERS_PARTIALBONDORDERASSIGNMENT_H
global.h
BALL_EXPORT
#define BALL_EXPORT
Definition COMMON/global.h:50
atom.h
bond.h
BALL::AssignBondOrderProcessor
Assignment of bond orders from topology information.
Definition assignBondOrderProcessor.h:90
BALL::Atom
Definition atom.h:90
BALL::BondOrderAssignment
A solution to the bond order assignment problem.
Definition bondOrderAssignment.h:32
BALL::PartialBondOrderAssignment::bond_orders
vector< short > bond_orders
Definition partialBondOrderAssignment.h:105
BALL::PartialBondOrderAssignment::estimated_atom_type_penalty
float estimated_atom_type_penalty
Definition partialBondOrderAssignment.h:98
BALL::PartialBondOrderAssignment::HEURISTIC_INDEX
HEURISTIC_INDEX
Definition partialBondOrderAssignment.h:38
BALL::PartialBondOrderAssignment::TIGHT
@ TIGHT
Definition partialBondOrderAssignment.h:41
BALL::PartialBondOrderAssignment::MEDIUM
@ MEDIUM
Definition partialBondOrderAssignment.h:40
BALL::PartialBondOrderAssignment::SIMPLE
@ SIMPLE
Definition partialBondOrderAssignment.h:39
BALL::PartialBondOrderAssignment::finePenalty
float finePenalty() const
Definition partialBondOrderAssignment.h:66
BALL::PartialBondOrderAssignment::abop
AssignBondOrderProcessor * abop
Definition partialBondOrderAssignment.h:110
BALL::PartialBondOrderAssignment::estimatePenalty_
bool estimatePenalty_(bool include_heuristic_term=true, HEURISTIC_INDEX heuristic_index=SIMPLE)
BALL::PartialBondOrderAssignment::coarsePenalty
float coarsePenalty(float atom_type_penalty, float bond_length_penalty) const
BALL::PartialBondOrderAssignment::PartialBondOrderAssignment
PartialBondOrderAssignment(AssignBondOrderProcessor *parent)
BALL::PartialBondOrderAssignment::getAtomTypePenalty
float getAtomTypePenalty(bool include_heuristic_term=true, HEURISTIC_INDEX heuristic_index=SIMPLE)
Convenience function to obtain total atom type penalty value.
BALL::PartialBondOrderAssignment::~PartialBondOrderAssignment
~PartialBondOrderAssignment()
BALL::PartialBondOrderAssignment::estimateAtomTypePenalty_
float estimateAtomTypePenalty_(Atom *atom, Index atom_index, int fixed_valence, int fixed_virtual_order, int num_free_bonds, HEURISTIC_INDEX heuristic_index)
Estimates the atom type penalty for a given unclosed atom.
BALL::PartialBondOrderAssignment::clear
void clear()
BALL::PartialBondOrderAssignment::estimateBondLengthPenalty_
float estimateBondLengthPenalty_(Index atom_index, const vector< Bond * > &free_bonds, int fixed_virtual_order, int fixed_valence, int num_free_bonds)
Estimates the bond length penalty for a given unclosed atom.
BALL::PartialBondOrderAssignment::estimated_bond_length_penalty
float estimated_bond_length_penalty
Definition partialBondOrderAssignment.h:100
BALL::PartialBondOrderAssignment::convertToFullAssignment
boost::shared_ptr< BondOrderAssignment > convertToFullAssignment()
BALL::PartialBondOrderAssignment::coarsePenalty
float coarsePenalty() const
BALL::PartialBondOrderAssignment::last_bond
Position last_bond
Definition partialBondOrderAssignment.h:108
BALL
Definition constants.h:13
BALL::Position
BALL_SIZE_TYPE Position
Definition COMMON/global.h:140
BALL::Index
BALL_INDEX_TYPE Index
Definition COMMON/global.h:105