Chemical Data Processing Library C++ API - Version 1.1.1
MMFF94AngleBendingParameterTable.hpp
Go to the documentation of this file.
1 /*
2  * MMFF94AngleBendingParameterTable.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_MMFF94ANGLEBENDINGPARAMETERTABLE_HPP
30 #define CDPL_FORCEFIELD_MMFF94ANGLEBENDINGPARAMETERTABLE_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::uint32_t, Entry> DataStorage;
58 
59  public:
60  typedef std::shared_ptr<MMFF94AngleBendingParameterTable> SharedPointer;
61 
63  {
64 
65  public:
66  Entry();
67 
68  Entry(unsigned int angle_type_idx, unsigned int term_atom1_type, unsigned int ctr_atom_type,
69  unsigned int term_atom2_type, double force_const, double ref_angle);
70 
71  unsigned int getAngleTypeIndex() const;
72 
73  unsigned int getTerminalAtom1Type() const;
74 
75  unsigned int getCenterAtomType() const;
76 
77  unsigned int getTerminalAtom2Type() const;
78 
79  double getForceConstant() const;
80 
81  double getReferenceAngle() const;
82 
83  operator bool() const;
84 
85  private:
86  unsigned int angleTypeIdx;
87  unsigned int termAtom1Type;
88  unsigned int ctrAtomType;
89  unsigned int termAtom2Type;
90  double forceConst;
91  double refAngle;
92  bool initialized;
93  };
94 
95  typedef boost::transform_iterator<std::function<const Entry&(const DataStorage::value_type&)>,
96  DataStorage::const_iterator>
98 
99  typedef boost::transform_iterator<std::function<Entry&(DataStorage::value_type&)>,
100  DataStorage::iterator>
102 
104 
105  void addEntry(unsigned int angle_type_idx, unsigned int term_atom1_type, unsigned int ctr_atom_type,
106  unsigned int term_atom2_type, double force_const, double ref_angle);
107 
108  const Entry& getEntry(unsigned int angle_type_idx, unsigned int term_atom1_type, unsigned int ctr_atom_type,
109  unsigned int term_atom2_type) const;
110 
111  std::size_t getNumEntries() const;
112 
113  void clear();
114 
115  bool removeEntry(unsigned int angle_type_idx, unsigned int term_atom1_type, unsigned int ctr_atom_type,
116  unsigned int term_atom2_type);
117 
119 
121 
123 
125 
127 
129 
131 
133 
135 
136  void load(std::istream& is);
137 
138  void loadDefaults();
139 
140  static void set(const SharedPointer& table);
141 
142  static const SharedPointer& get();
143 
144  private:
145  static SharedPointer defaultTable;
146  DataStorage entries;
147  };
148  } // namespace ForceField
149 } // namespace CDPL
150 
151 #endif // CDPL_FORCEFIELD_MMFF94ANGLEBENDINGPARAMETERTABLE_HPP
APIPrefix.hpp
Definition of the preprocessor macro CDPL_FORCEFIELD_API.
CDPL::ForceField::MMFF94AngleBendingParameterTable::removeEntry
EntryIterator removeEntry(const EntryIterator &it)
CDPL::ForceField::MMFF94AngleBendingParameterTable::Entry::Entry
Entry()
CDPL::ForceField::MMFF94AngleBendingParameterTable::Entry::getCenterAtomType
unsigned int getCenterAtomType() const
CDPL::ForceField::MMFF94AngleBendingParameterTable::Entry::getAngleTypeIndex
unsigned int getAngleTypeIndex() const
CDPL::ForceField::MMFF94AngleBendingParameterTable::getEntriesBegin
ConstEntryIterator getEntriesBegin() const
CDPL::ForceField::MMFF94AngleBendingParameterTable::MMFF94AngleBendingParameterTable
MMFF94AngleBendingParameterTable()
CDPL::ForceField::MMFF94AngleBendingParameterTable::Entry::Entry
Entry(unsigned int angle_type_idx, unsigned int term_atom1_type, unsigned int ctr_atom_type, unsigned int term_atom2_type, double force_const, double ref_angle)
CDPL::ForceField::MMFF94AngleBendingParameterTable::EntryIterator
boost::transform_iterator< std::function< Entry &(DataStorage::value_type &)>, DataStorage::iterator > EntryIterator
Definition: MMFF94AngleBendingParameterTable.hpp:101
CDPL::ForceField::MMFF94AngleBendingParameterTable
Definition: MMFF94AngleBendingParameterTable.hpp:51
CDPL::ForceField::MMFF94AngleBendingParameterTable::end
EntryIterator end()
CDPL::ForceField::MMFF94AngleBendingParameterTable::Entry::getReferenceAngle
double getReferenceAngle() const
CDPL::ForceField::MMFF94AngleBendingParameterTable::Entry::getTerminalAtom2Type
unsigned int getTerminalAtom2Type() const
CDPL::ForceField::MMFF94AngleBendingParameterTable::clear
void clear()
bool
CDPL::ForceField::MMFF94AngleBendingParameterTable::SharedPointer
std::shared_ptr< MMFF94AngleBendingParameterTable > SharedPointer
Definition: MMFF94AngleBendingParameterTable.hpp:60
CDPL::ForceField::MMFF94AngleBendingParameterTable::getNumEntries
std::size_t getNumEntries() const
CDPL::ForceField::MMFF94AngleBendingParameterTable::Entry::getForceConstant
double getForceConstant() const
CDPL::ForceField::MMFF94AngleBendingParameterTable::loadDefaults
void loadDefaults()
CDPL::ForceField::MMFF94AngleBendingParameterTable::getEntry
const Entry & getEntry(unsigned int angle_type_idx, unsigned int term_atom1_type, unsigned int ctr_atom_type, unsigned int term_atom2_type) const
CDPL::ForceField::MMFF94AngleBendingParameterTable::getEntriesEnd
EntryIterator getEntriesEnd()
CDPL::ForceField::MMFF94AngleBendingParameterTable::begin
EntryIterator begin()
CDPL::ForceField::MMFF94AngleBendingParameterTable::begin
ConstEntryIterator begin() const
CDPL::ForceField::MMFF94AngleBendingParameterTable::removeEntry
bool removeEntry(unsigned int angle_type_idx, unsigned int term_atom1_type, unsigned int ctr_atom_type, unsigned int term_atom2_type)
CDPL::ForceField::MMFF94AngleBendingParameterTable::Entry::getTerminalAtom1Type
unsigned int getTerminalAtom1Type() const
CDPL::ForceField::MMFF94AngleBendingParameterTable::getEntriesBegin
EntryIterator getEntriesBegin()
CDPL
The namespace of the Chemical Data Processing Library.
CDPL::ForceField::MMFF94AngleBendingParameterTable::end
ConstEntryIterator end() const
CDPL::ForceField::MMFF94AngleBendingParameterTable::set
static void set(const SharedPointer &table)
CDPL::ForceField::MMFF94AngleBendingParameterTable::getEntriesEnd
ConstEntryIterator getEntriesEnd() const
CDPL_FORCEFIELD_API
#define CDPL_FORCEFIELD_API
Tells the compiler/linker which classes, functions and variables are part of the library API.
CDPL::ForceField::MMFF94AngleBendingParameterTable::Entry
Definition: MMFF94AngleBendingParameterTable.hpp:63
CDPL::ForceField::MMFF94AngleBendingParameterTable::ConstEntryIterator
boost::transform_iterator< std::function< const Entry &(const DataStorage::value_type &)>, DataStorage::const_iterator > ConstEntryIterator
Definition: MMFF94AngleBendingParameterTable.hpp:97
CDPL::ForceField::MMFF94AngleBendingParameterTable::addEntry
void addEntry(unsigned int angle_type_idx, unsigned int term_atom1_type, unsigned int ctr_atom_type, unsigned int term_atom2_type, double force_const, double ref_angle)
CDPL::ForceField::MMFF94AngleBendingParameterTable::get
static const SharedPointer & get()
CDPL::ForceField::MMFF94AngleBendingParameterTable::load
void load(std::istream &is)