Chemical Data Processing Library C++ API - Version 1.1.1
MMFF94TorsionParameterTable.hpp
Go to the documentation of this file.
1 /*
2  * MMFF94TorsionParameterTable.hpp
3  *
4  * This file is part of the Chemical Data Processing Toolkit
5  *
6  * Copyright (C) 2003 Thomas Seidel <thomas.seidel@univie.ac.at>
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public License
19  * along with this library; see the file COPYING. If not, write to
20  * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21  * Boston, MA 02111-1307, USA.
22  */
23 
29 #ifndef CDPL_FORCEFIELD_MMFF94TORSIONPARAMETERTABLE_HPP
30 #define CDPL_FORCEFIELD_MMFF94TORSIONPARAMETERTABLE_HPP
31 
32 #include <cstddef>
33 #include <cstdint>
34 #include <iosfwd>
35 #include <unordered_map>
36 #include <memory>
37 #include <functional>
38 
39 #include <boost/iterator/transform_iterator.hpp>
40 
42 
43 
44 namespace CDPL
45 {
46 
47  namespace ForceField
48  {
49 
51  {
52 
53  public:
54  class Entry;
55 
56  private:
57  typedef std::unordered_map<std::uint64_t, Entry> DataStorage;
58 
59  public:
60  typedef std::shared_ptr<MMFF94TorsionParameterTable> SharedPointer;
61 
63  {
64 
65  public:
66  Entry();
67 
68  Entry(unsigned int tor_type_idx, unsigned int term_atom1_type, unsigned int ctr_atom1_type, unsigned int ctr_atom2_type,
69  unsigned int term_atom2_type, double tor_param1, double tor_param2, double tor_param3);
70 
71  unsigned int getTorsionTypeIndex() const;
72 
73  unsigned int getTerminalAtom1Type() const;
74 
75  unsigned int getCenterAtom1Type() const;
76 
77  unsigned int getCenterAtom2Type() const;
78 
79  unsigned int getTerminalAtom2Type() const;
80 
81  double getTorsionParameter1() const;
82 
83  double getTorsionParameter2() const;
84 
85  double getTorsionParameter3() const;
86 
87  operator bool() const;
88 
89  private:
90  unsigned int torTypeIdx;
91  unsigned int termAtom1Type;
92  unsigned int ctrAtom1Type;
93  unsigned int ctrAtom2Type;
94  unsigned int termAtom2Type;
95  double torParam1;
96  double torParam2;
97  double torParam3;
98  bool initialized;
99  };
100 
101  typedef boost::transform_iterator<std::function<const Entry&(const DataStorage::value_type&)>,
102  DataStorage::const_iterator>
104 
105  typedef boost::transform_iterator<std::function<Entry&(DataStorage::value_type&)>,
106  DataStorage::iterator>
108 
110 
111  void addEntry(unsigned int tor_type_idx, unsigned int term_atom1_type, unsigned int ctr_atom1_type, unsigned int ctr_atom2_type,
112  unsigned int term_atom2_type, double tor_param1, double tor_param2, double tor_param3);
113 
114  const Entry& getEntry(unsigned int tor_type_idx, unsigned int term_atom1_type, unsigned int ctr_atom1_type, unsigned int ctr_atom2_type,
115  unsigned int term_atom2_type) const;
116 
117  std::size_t getNumEntries() const;
118 
119  void clear();
120 
121  bool removeEntry(unsigned int tor_type_idx, unsigned int term_atom1_type, unsigned int ctr_atom1_type, unsigned int ctr_atom2_type,
122  unsigned int term_atom2_type);
123 
125 
127 
129 
131 
133 
135 
137 
139 
141 
142  void load(std::istream& is);
143 
144  void loadDefaults(unsigned int param_set);
145 
146  static void set(const SharedPointer& table, unsigned int param_set);
147 
148  static const SharedPointer& get(unsigned int param_set);
149 
150  private:
151  static SharedPointer defaultDynTable;
152  static SharedPointer defaultStatTable;
153  static SharedPointer defaultStatRefTable;
154  DataStorage entries;
155  };
156  } // namespace ForceField
157 } // namespace CDPL
158 
159 #endif // CDPL_FORCEFIELD_MMFF94TORSIONPARAMETERTABLE_HPP
CDPL::ForceField::MMFF94TorsionParameterTable::getNumEntries
std::size_t getNumEntries() const
APIPrefix.hpp
Definition of the preprocessor macro CDPL_FORCEFIELD_API.
CDPL::ForceField::MMFF94TorsionParameterTable::Entry::getTorsionTypeIndex
unsigned int getTorsionTypeIndex() const
CDPL::ForceField::MMFF94TorsionParameterTable::begin
EntryIterator begin()
CDPL::ForceField::MMFF94TorsionParameterTable::get
static const SharedPointer & get(unsigned int param_set)
CDPL::ForceField::MMFF94TorsionParameterTable::Entry::getTerminalAtom1Type
unsigned int getTerminalAtom1Type() const
CDPL::ForceField::MMFF94TorsionParameterTable::getEntriesEnd
ConstEntryIterator getEntriesEnd() const
CDPL::ForceField::MMFF94TorsionParameterTable::addEntry
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)
CDPL::ForceField::MMFF94TorsionParameterTable::Entry::getTerminalAtom2Type
unsigned int getTerminalAtom2Type() const
CDPL::ForceField::MMFF94TorsionParameterTable
Definition: MMFF94TorsionParameterTable.hpp:51
CDPL::ForceField::MMFF94TorsionParameterTable::getEntriesBegin
ConstEntryIterator getEntriesBegin() const
CDPL::ForceField::MMFF94TorsionParameterTable::end
ConstEntryIterator end() const
CDPL::ForceField::MMFF94TorsionParameterTable::Entry::Entry
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)
CDPL::ForceField::MMFF94TorsionParameterTable::MMFF94TorsionParameterTable
MMFF94TorsionParameterTable()
CDPL::ForceField::MMFF94TorsionParameterTable::removeEntry
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)
CDPL::ForceField::MMFF94TorsionParameterTable::begin
ConstEntryIterator begin() const
CDPL::ForceField::MMFF94TorsionParameterTable::Entry::getCenterAtom1Type
unsigned int getCenterAtom1Type() const
bool
CDPL::ForceField::MMFF94TorsionParameterTable::Entry::getCenterAtom2Type
unsigned int getCenterAtom2Type() const
CDPL::ForceField::MMFF94TorsionParameterTable::Entry
Definition: MMFF94TorsionParameterTable.hpp:63
CDPL::ForceField::MMFF94TorsionParameterTable::getEntry
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
CDPL::ForceField::MMFF94TorsionParameterTable::Entry::Entry
Entry()
CDPL::ForceField::MMFF94TorsionParameterTable::clear
void clear()
CDPL::ForceField::MMFF94TorsionParameterTable::loadDefaults
void loadDefaults(unsigned int param_set)
CDPL::ForceField::MMFF94TorsionParameterTable::set
static void set(const SharedPointer &table, unsigned int param_set)
CDPL
The namespace of the Chemical Data Processing Library.
CDPL::ForceField::MMFF94TorsionParameterTable::Entry::getTorsionParameter2
double getTorsionParameter2() const
CDPL::ForceField::MMFF94TorsionParameterTable::getEntriesBegin
EntryIterator getEntriesBegin()
CDPL_FORCEFIELD_API
#define CDPL_FORCEFIELD_API
Tells the compiler/linker which classes, functions and variables are part of the library API.
CDPL::ForceField::MMFF94TorsionParameterTable::getEntriesEnd
EntryIterator getEntriesEnd()
CDPL::ForceField::MMFF94TorsionParameterTable::end
EntryIterator end()
CDPL::ForceField::MMFF94TorsionParameterTable::load
void load(std::istream &is)
CDPL::ForceField::MMFF94TorsionParameterTable::SharedPointer
std::shared_ptr< MMFF94TorsionParameterTable > SharedPointer
Definition: MMFF94TorsionParameterTable.hpp:60
CDPL::ForceField::MMFF94TorsionParameterTable::Entry::getTorsionParameter1
double getTorsionParameter1() const
CDPL::ForceField::MMFF94TorsionParameterTable::ConstEntryIterator
boost::transform_iterator< std::function< const Entry &(const DataStorage::value_type &)>, DataStorage::const_iterator > ConstEntryIterator
Definition: MMFF94TorsionParameterTable.hpp:103
CDPL::ForceField::MMFF94TorsionParameterTable::removeEntry
EntryIterator removeEntry(const EntryIterator &it)
CDPL::ForceField::MMFF94TorsionParameterTable::EntryIterator
boost::transform_iterator< std::function< Entry &(DataStorage::value_type &)>, DataStorage::iterator > EntryIterator
Definition: MMFF94TorsionParameterTable.hpp:107
CDPL::ForceField::MMFF94TorsionParameterTable::Entry::getTorsionParameter3
double getTorsionParameter3() const