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;
67 typedef std::shared_ptr<MMFF94BondStretchingRuleParameterTable>
SharedPointer;
88 Entry(
unsigned int atomic_no1,
unsigned int atomic_no2,
double force_const,
double ref_length);
121 unsigned int atomicNo1;
122 unsigned int atomicNo2;
131 typedef boost::transform_iterator<std::function<
const Entry&(
const DataStorage::value_type&)>,
132 DataStorage::const_iterator>
138 typedef boost::transform_iterator<std::function<
Entry&(DataStorage::value_type&)>,
139 DataStorage::iterator>
154 void addEntry(
unsigned int atomic_no1,
unsigned int atomic_no2,
double force_const,
double ref_length);
162 const Entry&
getEntry(
unsigned int atomic_no1,
unsigned int atomic_no2)
const;
181 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.
Data structure for the storage of values associated with a single table entry.
Definition: MMFF94BondStretchingRuleParameterTable.hpp:73
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 instance storing the given query and parameter values.
unsigned int getAtomicNumber1() const
Returns the atomic number of the first bonded atom.
Entry()
Constructs an empty (uninitialized) Entry instance.
Data structure for the storage and lookup of MMFF94 bond-stretching interaction fallback parameters.
Definition: MMFF94BondStretchingRuleParameterTable.hpp:55
const Entry & getEntry(unsigned int atomic_no1, unsigned int atomic_no2) const
Returns a reference to the entry matching the specified query values.
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 a new (or overwrites an existing) entry for the given query and parameter values.
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 MMFF94 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:133
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 matching the specified query values.
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:67
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:140
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.