29 #ifndef CDPL_FORCEFIELD_MMFF94BONDSTRETCHINGRULEPARAMETERTABLE_HPP
30 #define CDPL_FORCEFIELD_MMFF94BONDSTRETCHINGRULEPARAMETERTABLE_HPP
35 #include <unordered_map>
39 #include <boost/iterator/transform_iterator.hpp>
61 typedef std::unordered_map<std::uint32_t, Entry> DataStorage;
65 typedef std::shared_ptr<MMFF94BondStretchingRuleParameterTable>
SharedPointer;
86 Entry(
unsigned int atomic_no1,
unsigned int atomic_no2,
double force_const,
double ref_length);
119 unsigned int atomicNo1;
120 unsigned int atomicNo2;
127 typedef boost::transform_iterator<std::function<
const Entry&(
const DataStorage::value_type&)>,
128 DataStorage::const_iterator>
132 typedef boost::transform_iterator<std::function<
Entry&(DataStorage::value_type&)>,
133 DataStorage::iterator>
148 void addEntry(
unsigned int atomic_no1,
unsigned int atomic_no2,
double force_const,
double ref_length);
156 const Entry&
getEntry(
unsigned int atomic_no1,
unsigned int atomic_no2)
const;
175 bool removeEntry(
unsigned int atomic_no1,
unsigned int atomic_no2);
Definition of the preprocessor macro CDPL_FORCEFIELD_API.
#define CDPL_FORCEFIELD_API
Tells the compiler/linker which classes, functions and variables are part of the library API.
A single rule-based bond-stretching parameter record.
Definition: MMFF94BondStretchingRuleParameterTable.hpp:71
double getReferenceLength() const
Returns the reference bond length.
double getForceConstant() const
Returns the bond-stretching force constant.
unsigned int getAtomicNumber2() const
Returns the atomic number of the second bonded atom.
Entry(unsigned int atomic_no1, unsigned int atomic_no2, double force_const, double ref_length)
Constructs an Entry for the given (atomic number 1, atomic number 2) pair.
unsigned int getAtomicNumber1() const
Returns the atomic number of the first bonded atom.
Entry()
Constructs an empty (uninitialized) Entry instance.
Lookup table mapping (atomic-number 1, atomic-number 2) pairs to fallback MMFF94 bond-stretching para...
Definition: MMFF94BondStretchingRuleParameterTable.hpp:55
const Entry & getEntry(unsigned int atomic_no1, unsigned int atomic_no2) const
Returns the entry for the given (atomic number 1, atomic number 2) pair.
static void set(const SharedPointer &table)
Replaces the process-wide default table by table.
void addEntry(unsigned int atomic_no1, unsigned int atomic_no2, double force_const, double ref_length)
Adds (or overwrites) the entry for the given (atomic number 1, atomic number 2) pair.
EntryIterator getEntriesEnd()
Returns a mutable iterator pointing one past the last entry.
ConstEntryIterator end() const
Returns a constant iterator pointing one past the last entry (alias of getEntriesEnd()).
ConstEntryIterator getEntriesEnd() const
Returns a constant iterator pointing one past the last entry.
void load(std::istream &is)
Loads table entries from the input stream is.
void loadDefaults()
Loads the built-in default bond-stretching rule parameter entries.
EntryIterator getEntriesBegin()
Returns a mutable iterator pointing to the beginning of the entry list.
boost::transform_iterator< std::function< const Entry &(const DataStorage::value_type &)>, DataStorage::const_iterator > ConstEntryIterator
A constant iterator over the entries of the table.
Definition: MMFF94BondStretchingRuleParameterTable.hpp:129
std::size_t getNumEntries() const
Returns the number of entries in the table.
MMFF94BondStretchingRuleParameterTable()
Constructs an empty MMFF94BondStretchingRuleParameterTable instance.
static const SharedPointer & get()
Returns the process-wide default table (lazily initialized on first call).
bool removeEntry(unsigned int atomic_no1, unsigned int atomic_no2)
Removes the entry for the given (atomic number 1, atomic number 2) pair.
EntryIterator begin()
Returns a mutable iterator pointing to the beginning of the entry list (alias of getEntriesBegin()).
std::shared_ptr< MMFF94BondStretchingRuleParameterTable > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated MMFF94BondStretchingRuleParameter...
Definition: MMFF94BondStretchingRuleParameterTable.hpp:65
ConstEntryIterator getEntriesBegin() const
Returns a constant iterator pointing to the beginning of the entry list.
ConstEntryIterator begin() const
Returns a constant iterator pointing to the beginning of the entry list (alias of getEntriesBegin()).
boost::transform_iterator< std::function< Entry &(DataStorage::value_type &)>, DataStorage::iterator > EntryIterator
A mutable iterator over the entries of the table.
Definition: MMFF94BondStretchingRuleParameterTable.hpp:134
EntryIterator end()
Returns a mutable iterator pointing one past the last entry (alias of getEntriesEnd()).
EntryIterator removeEntry(const EntryIterator &it)
Removes the entry pointed to by the iterator it.
void clear()
Removes all entries from the table.
The namespace of the Chemical Data Processing Library.