29 #ifndef CDPL_FORCEFIELD_MMFF94BONDSTRETCHINGPARAMETERTABLE_HPP
30 #define CDPL_FORCEFIELD_MMFF94BONDSTRETCHINGPARAMETERTABLE_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<MMFF94BondStretchingParameterTable>
SharedPointer;
89 Entry(
unsigned int bond_type_idx,
unsigned int atom1_type,
unsigned int atom2_type,
90 double force_const,
double ref_length);
129 unsigned int bondTypeIdx;
130 unsigned int atom1Type;
131 unsigned int atom2Type;
140 typedef boost::transform_iterator<std::function<
const Entry&(
const DataStorage::value_type&)>,
141 DataStorage::const_iterator>
147 typedef boost::transform_iterator<std::function<
Entry&(DataStorage::value_type&)>,
148 DataStorage::iterator>
164 void addEntry(
unsigned int bond_type_idx,
unsigned int atom1_type,
unsigned int atom2_type,
165 double force_const,
double ref_length);
174 const Entry&
getEntry(
unsigned int bond_type_idx,
unsigned int atom1_type,
unsigned int atom2_type)
const;
194 bool removeEntry(
unsigned int bond_type_idx,
unsigned int atom1_type,
unsigned int atom2_type);
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: MMFF94BondStretchingParameterTable.hpp:73
Entry()
Constructs an empty (uninitialized) Entry instance.
unsigned int getBondTypeIndex() const
Returns the MMFF94 bond type index.
double getReferenceLength() const
Returns the reference bond length.
double getForceConstant() const
Returns the bond-stretching force constant.
unsigned int getAtom2Type() const
Returns the numeric MMFF94 atom type of the second bonded atom.
unsigned int getAtom1Type() const
Returns the numeric MMFF94 atom type of the first bonded atom.
Entry(unsigned int bond_type_idx, unsigned int atom1_type, unsigned int atom2_type, double force_const, double ref_length)
Constructs an Entry instance storing the given query and parameter values.
Data structure for the storage and lookup of MMFF94 bond-stretching interaction parameters.
Definition: MMFF94BondStretchingParameterTable.hpp:55
ConstEntryIterator getEntriesEnd() const
Returns a constant iterator pointing one past the last entry.
static const SharedPointer & get()
Returns the process-wide default table (lazily initialized on first call).
MMFF94BondStretchingParameterTable()
Constructs an empty MMFF94BondStretchingParameterTable instance.
boost::transform_iterator< std::function< Entry &(DataStorage::value_type &)>, DataStorage::iterator > EntryIterator
A mutable iterator over the entries of the table.
Definition: MMFF94BondStretchingParameterTable.hpp:149
EntryIterator begin()
Returns a mutable iterator pointing to the beginning of the entry list (alias of getEntriesBegin()).
bool removeEntry(unsigned int bond_type_idx, unsigned int atom1_type, unsigned int atom2_type)
Removes the entry matching the specified query values.
void load(std::istream &is)
Loads table entries from the input stream is.
ConstEntryIterator getEntriesBegin() const
Returns a constant iterator pointing to the beginning of the entry list.
void loadDefaults()
Loads the built-in default MMFF94 bond-stretching parameter entries.
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()).
EntryIterator getEntriesBegin()
Returns a mutable iterator pointing to the beginning of the entry list.
static void set(const SharedPointer &table)
Replaces the process-wide default table by table.
void clear()
Removes all entries from the table.
std::size_t getNumEntries() const
Returns the number of entries in the table.
EntryIterator end()
Returns a mutable iterator pointing one past the last entry (alias of getEntriesEnd()).
ConstEntryIterator begin() const
Returns a constant iterator pointing to the beginning of the entry list (alias of getEntriesBegin()).
const Entry & getEntry(unsigned int bond_type_idx, unsigned int atom1_type, unsigned int atom2_type) const
Returns a reference to the entry matching the specified query values.
void addEntry(unsigned int bond_type_idx, unsigned int atom1_type, unsigned int atom2_type, double force_const, double ref_length)
Adds a new (or overwrites an existing) entry for the given query and parameter values.
std::shared_ptr< MMFF94BondStretchingParameterTable > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated MMFF94BondStretchingParameterTabl...
Definition: MMFF94BondStretchingParameterTable.hpp:67
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: MMFF94BondStretchingParameterTable.hpp:142
EntryIterator removeEntry(const EntryIterator &it)
Removes the entry pointed to by the iterator it.
The namespace of the Chemical Data Processing Library.