29 #ifndef CDPL_FORCEFIELD_MMFF94TORSIONPARAMETERTABLE_HPP
30 #define CDPL_FORCEFIELD_MMFF94TORSIONPARAMETERTABLE_HPP
35 #include <unordered_map>
39 #include <boost/iterator/transform_iterator.hpp>
61 typedef std::unordered_map<std::uint64_t, Entry> DataStorage;
92 Entry(
unsigned int tor_type_idx,
unsigned int term_atom1_type,
unsigned int ctr_atom1_type,
unsigned int ctr_atom2_type,
93 unsigned int term_atom2_type,
double tor_param1,
double tor_param2,
double tor_param3);
150 unsigned int torTypeIdx;
151 unsigned int termAtom1Type;
152 unsigned int ctrAtom1Type;
153 unsigned int ctrAtom2Type;
154 unsigned int termAtom2Type;
164 typedef boost::transform_iterator<std::function<
const Entry&(
const DataStorage::value_type&)>,
165 DataStorage::const_iterator>
171 typedef boost::transform_iterator<std::function<
Entry&(DataStorage::value_type&)>,
172 DataStorage::iterator>
191 void addEntry(
unsigned int tor_type_idx,
unsigned int term_atom1_type,
unsigned int ctr_atom1_type,
unsigned int ctr_atom2_type,
192 unsigned int term_atom2_type,
double tor_param1,
double tor_param2,
double tor_param3);
203 const Entry&
getEntry(
unsigned int tor_type_idx,
unsigned int term_atom1_type,
unsigned int ctr_atom1_type,
unsigned int ctr_atom2_type,
204 unsigned int term_atom2_type)
const;
226 bool removeEntry(
unsigned int tor_type_idx,
unsigned int term_atom1_type,
unsigned int ctr_atom1_type,
unsigned int ctr_atom2_type,
227 unsigned int term_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: MMFF94TorsionParameterTable.hpp:73
double getTorsionParameter3() const
Returns the torsion-energy parameter V3.
double getTorsionParameter1() const
Returns the torsion-energy parameter V1.
Entry(unsigned int tor_type_idx, unsigned int term_atom1_type, unsigned int ctr_atom1_type, unsigned int ctr_atom2_type, unsigned int term_atom2_type, double tor_param1, double tor_param2, double tor_param3)
Constructs an Entry instance storing the given query and parameter values.
unsigned int getCenterAtom1Type() const
Returns the numeric MMFF94 atom type of the first center atom.
unsigned int getTerminalAtom2Type() const
Returns the numeric MMFF94 atom type of the second terminal atom.
double getTorsionParameter2() const
Returns the torsion-energy parameter V2.
Entry()
Constructs an empty (uninitialized) Entry instance.
unsigned int getTerminalAtom1Type() const
Returns the numeric MMFF94 atom type of the first terminal atom.
unsigned int getTorsionTypeIndex() const
Returns the MMFF94 torsion type index.
unsigned int getCenterAtom2Type() const
Returns the numeric MMFF94 atom type of the second center atom.
Data structure for the storage and lookup of MMFF94 torsion interaction parameters.
Definition: MMFF94TorsionParameterTable.hpp:55
bool removeEntry(unsigned int tor_type_idx, unsigned int term_atom1_type, unsigned int ctr_atom1_type, unsigned int ctr_atom2_type, unsigned int term_atom2_type)
Removes the entry matching the specified query values.
void clear()
Removes all entries from the table.
std::shared_ptr< MMFF94TorsionParameterTable > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated MMFF94TorsionParameterTable insta...
Definition: MMFF94TorsionParameterTable.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: MMFF94TorsionParameterTable.hpp:166
void load(std::istream &is)
Loads table entries from the input stream is.
EntryIterator getEntriesEnd()
Returns a mutable iterator pointing one past the last entry.
ConstEntryIterator begin() const
Returns a constant iterator pointing to the beginning of the entry list (alias of getEntriesBegin()).
EntryIterator end()
Returns a mutable iterator pointing one past the last entry (alias of getEntriesEnd()).
ConstEntryIterator end() const
Returns a constant iterator pointing one past the last entry (alias of getEntriesEnd()).
const Entry & getEntry(unsigned int tor_type_idx, unsigned int term_atom1_type, unsigned int ctr_atom1_type, unsigned int ctr_atom2_type, unsigned int term_atom2_type) const
Returns a reference to the entry matching the specified query values.
EntryIterator begin()
Returns a mutable 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: MMFF94TorsionParameterTable.hpp:173
static void set(const SharedPointer &table, unsigned int param_set)
Replaces the process-wide default table for param_set by table.
void loadDefaults(unsigned int param_set)
Loads the built-in default torsion parameter entries for the specified MMFF94 parameter set.
EntryIterator removeEntry(const EntryIterator &it)
Removes the entry pointed to by the iterator it.
MMFF94TorsionParameterTable()
Constructs an empty MMFF94TorsionParameterTable instance.
ConstEntryIterator getEntriesBegin() const
Returns a constant iterator pointing to the beginning of the entry list.
EntryIterator getEntriesBegin()
Returns a mutable iterator pointing to the beginning of the entry list.
static const SharedPointer & get(unsigned int param_set)
Returns the process-wide default table for param_set (lazily initialized on first call).
void addEntry(unsigned int tor_type_idx, unsigned int term_atom1_type, unsigned int ctr_atom1_type, unsigned int ctr_atom2_type, unsigned int term_atom2_type, double tor_param1, double tor_param2, double tor_param3)
Adds a new (or overwrites an existing) entry for the given query and parameter values.
std::size_t getNumEntries() const
Returns the number of entries in the table.
ConstEntryIterator getEntriesEnd() const
Returns a constant iterator pointing one past the last entry.
The namespace of the Chemical Data Processing Library.