29 #ifndef CDPL_FORCEFIELD_MMFF94TORSIONPARAMETERTABLE_HPP
30 #define CDPL_FORCEFIELD_MMFF94TORSIONPARAMETERTABLE_HPP
35 #include <unordered_map>
39 #include <boost/iterator/transform_iterator.hpp>
63 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;
162 typedef boost::transform_iterator<std::function<
const Entry&(
const DataStorage::value_type&)>,
163 DataStorage::const_iterator>
167 typedef boost::transform_iterator<std::function<
Entry&(DataStorage::value_type&)>,
168 DataStorage::iterator>
187 void addEntry(
unsigned int tor_type_idx,
unsigned int term_atom1_type,
unsigned int ctr_atom1_type,
unsigned int ctr_atom2_type,
188 unsigned int term_atom2_type,
double tor_param1,
double tor_param2,
double tor_param3);
199 const Entry&
getEntry(
unsigned int tor_type_idx,
unsigned int term_atom1_type,
unsigned int ctr_atom1_type,
unsigned int ctr_atom2_type,
200 unsigned int term_atom2_type)
const;
222 bool removeEntry(
unsigned int tor_type_idx,
unsigned int term_atom1_type,
unsigned int ctr_atom1_type,
unsigned int ctr_atom2_type,
223 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.
A single torsion parameter record.
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 for the given (torsion type, terminal-atom 1, center-atom 1, center-atom 2,...
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.
Lookup table mapping (torsion type, terminal-atom-1 type, center-atom-1 type, center-atom-2 type,...
Definition: MMFF94TorsionParameterTable.hpp:57
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 for the given (torsion type, terminal-atom 1, center-atom 1, center-atom 2,...
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:164
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 the entry for the given (torsion type, terminal-atom 1, center-atom 1, center-atom 2,...
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:169
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 (or overwrites) the entry for the given (torsion type, terminal-atom 1, center-atom 1,...
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.