Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
MinimizerMap.hh
Go to the documentation of this file.
1 // -*- mode:c++;tab-width:2;indent-tabs-mode:t;show-trailing-whitespace:t;rm-trailing-spaces:t -*-
2 // vi: set ts=2 noet:
3 //
4 // (c) Copyright Rosetta Commons Member Institutions.
5 // (c) This file is part of the Rosetta software suite and is made available under license.
6 // (c) The Rosetta software is developed by the contributing members of the Rosetta Commons.
7 // (c) For more information, see http://www.rosettacommons.org. Questions about this can be
8 // (c) addressed to University of Washington UW TechTransfer, email: license@u.washington.edu.
9 
10 /// @file core/optimization/MinimizerMap.hh
11 /// @brief Class for connecting DOFs in the atom tree to DOFs optimized by the AtomTreeMinimizer
12 /// @author Phil Bradley
13 
14 
15 #ifndef INCLUDED_core_optimization_MinimizerMap_hh
16 #define INCLUDED_core_optimization_MinimizerMap_hh
17 
18 // Unit headers
20 
21 // Package headers
23 //#include <core/optimization/AtomNode.hh>
25 
26 
27 // Project headers
29 #include <core/pose/Pose.fwd.hh>
31 #include <core/id/AtomID_Map.hh>
32 #include <core/id/DOF_ID_Map.hh>
34 // AUTO-REMOVED #include <core/kinematics/DomainMap.hh>
35 
36 // Rosetta headers
37 // #include <util_basic.hh>
38 // #include <jump_classes.hh>
39 // #include <core/kinematics/Stub.hh>
40 // #include <id.hh>
41 
42 // // Numeric headers
43 // #include <numeric/all.fwd.hh>
44 // #include <numeric/conversions.hh>
45 // #include <numeric/xyzMatrix.hh>
46 // #include <numeric/xyzVector.hh>
47 
48 // // ObjexxFCL headers
49 // #include <ObjexxFCL/FArray1D.hh>
50 
51 // // Utility headers
52 // #include <utility/io/all.fwd.hh>
53 
54 // // C++ headers
55 // #include <algorithm>
56 // #include <cmath>
57 // #include <cstdlib>
58 // #include <iostream>
59 // //#include <iosfwd>
60 // #include <cassert>
61 // #include <vector>
62 // #include <string>
63 // #include <map>
64 #include <list>
65 
66 #include <utility/vector1.hh>
67 #include <ObjexxFCL/FArray1D.hh>
68 
69 
70 
71 namespace core {
72 namespace optimization {
73 
74 
76 {
77 public:
78  typedef std::list< DOF_NodeOP > DOF_Nodes;
79  typedef DOF_Nodes::iterator iterator;
80  typedef DOF_Nodes::const_iterator const_iterator;
81 
82  typedef id::AtomID AtomID;
83  typedef id::DOF_ID DOF_ID;
86 
88 
89 public:
90 
91  ///
93  parent(),
95  {}
96 
97  ///
98  ~MinimizerMap();
99 
100  ///
101  void
102  setup(
103  pose::Pose & pose,
104  kinematics::MoveMap const & move_map
105  );
106 
107  ///
108  virtual
109  void
110  add_torsion(
111  DOF_ID const & new_torsion,
112  DOF_ID const & parent
113  );
114 
115  ///
116  virtual
117  void
118  add_atom(
119  AtomID const & atom_id,
120  DOF_ID const & dof_id
121  );
122 
123 
124  ///
126  begin() const
127  {
128  return dof_nodes_.begin();
129  }
130 
131  ///
133  end() const
134  {
135  return dof_nodes_.end();
136  }
137 
138  ///
139  iterator
141  {
142  return dof_nodes_.begin();
143  }
144 
145  ///
146  iterator
147  end()
148  {
149  return dof_nodes_.end();
150  }
151 
152  ///
153  DOF_Nodes const &
154  dof_nodes() const
155  {
156  return dof_nodes_;
157  }
158 
159  ///
160  DOF_Nodes &
162  {
163  return dof_nodes_;
164  }
165 
166  /// this will only work if DOF_nodes are sorted!
167  void
169 
170  ///
171  void
173 
174  /// clears old data+dimensions dof_node_pointer using size data from the pose
175  void
176  reset( pose::Pose const & pose );
177 
178  ///
179  void
181  pose::Pose const & pose,
182  Multivec & dofs
183  ) const;
184 
185  ///
186  void
188  pose::Pose & pose,
189  Multivec const & dofs
190  ) const;
191 
192  ///
193  inline
194  int
195  nangles() const
196  {
197  return dof_nodes_.size();
198  }
199 
200  ///
201  void
203  pose::Pose & pose,
204  Multivec & dofs
205  ) const;
206 
207  // this is used in pack/unpack_phipsi and deriv calculation
208  Real
210  DOF_Node const & tor
211  ) const;
212 
213  ///
214  virtual
215  kinematics::DomainMap const &
216  domain_map() const
217  {
218  return domain_map_;
219  }
220 
221  /// get a dof_node by its dof_id
222  DOF_NodeOP
224  {
225  DOF_NodeOP node = 0;
226  if ( id.valid() ) {
227  node = dof_node_pointer_[ id ];
228  if ( node == 0 ) {
229  std::cerr << "DOF_ID does not exist in map! torsion= " << id << std::endl;
230  utility_exit();
231  }
232  }
233  return node;
234  }
235 
238  return atom_derivatives_[ resid ];
239  }
240 
241 private:
242 
243  /// deletes and clears dof_nodes_
244  void
245  clear_dof_nodes();
246 
247  void
248  assign_rosetta_torsions( pose::Pose const & pose ); // part of setup
249 
250 private:
251 
252  /// list of all the moving degrees of freedom
254 
255  /// pointer from DOF_ID to the corresponding DOF_NodeOP
257 
258  ///
260 
262 
263 }; // MinimizerMap
264 
265 
266 } // namespace kinematics
267 } // namespace core
268 
269 
270 #endif