Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
MinimizerMapBase.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/kinematics/MinimizerMapBase.hh
11 /// @brief Deriviative classes from this base class will implement three virtual functions
12 /// allowing the AtomTree to communicate with an outside Minimizer about how the
13 /// degrees of freedom in the AtomTree should be minimized.
14 /// @author Phil Bradley
15 /// @author Andrew Leaver-Fay -- refactoring phil's code a little.
16 
17 #ifndef INCLUDED_core_kinematics_MinimizerMapBase_hh
18 #define INCLUDED_core_kinematics_MinimizerMapBase_hh
19 
20 // Unit headers
22 
23 // Package headers
24 //#include <core/optimization/DOF_Node.hh>
25 //#include <core/optimization/AtomNode.hh>
26 //#include <core/optimization/types.hh>
27 
28 
29 // Project headers
30 //#include <core/pose/Pose.fwd.hh>
31 // AUTO-REMOVED #include <core/id/AtomID.hh>
32 // AUTO-REMOVED #include <core/id/DOF_ID.hh>
33 // AUTO-REMOVED #include <core/kinematics/MoveMap.fwd.hh>
34 //#include <core/id/AtomID_Map.hh>
35 //#include <core/id/DOF_ID_Map.hh>
36 
37 // Utility headers
38 #include <utility/pointer/ReferenceCount.hh>
39 
40 #include <core/id/AtomID.fwd.hh>
41 #include <core/id/DOF_ID.fwd.hh>
42 #include <core/id/types.hh>
44 
45 
46 
47 
48 namespace core {
49 namespace kinematics {
50 
51 
53 {
54 public:
55 
56  typedef id::AtomID AtomID;
57  typedef id::DOF_ID DOF_ID;
59 
60 public:
61 
62  /// @brief default ctor; noop
64 
65  /// @brief dstor
66  virtual ~MinimizerMapBase();
67 
68 
69  /// @brief Allow the AtomTree to communicate to this class that a particular torsion
70  /// (or angle or distance -- a particular DOF) belongs in the minimization task
71  /// to inform this class the parent DOF for that torsion.
72  virtual
73  void
75  DOF_ID const & new_torsion,
76  DOF_ID const & parent
77  ) = 0;
78 
79  /// @brief Allow the AtomTree to inform this class that a particular atom belongs
80  /// in the derivative calculation for a certain DOF. That certain DOF must have already
81  /// been included in the minimization process through a prior invocation of the
82  /// add_torsion method.
83  virtual
84  void
85  add_atom(
86  AtomID const & atom_id,
87  DOF_ID const & dof_id
88  ) = 0;
89 
90 
91  /*
92  const_iterator
93  begin() const
94  {
95  return dof_nodes_.begin();
96  }
97 
98  ///
99  const_iterator
100  end() const
101  {
102  return dof_nodes_.end();
103  }
104 
105  ///
106  iterator
107  begin()
108  {
109  return dof_nodes_.begin();
110  }
111 
112  ///
113  iterator
114  end()
115  {
116  return dof_nodes_.end();
117  }
118 
119  ///
120  DOF_Nodes const &
121  dof_nodes() const
122  {
123  return dof_nodes_;
124  }
125 
126  ///
127  DOF_Nodes &
128  dof_nodes()
129  {
130  return dof_nodes_;
131  }
132 
133  /// this will only work if DOF_nodes are sorted!
134  void
135  link_torsion_vectors();
136 
137  ///
138  void
139  zero_torsion_vectors();
140 
141  /// clears old data+dimensions dof_node_pointer using size data from the pose
142  void
143  reset( pose::Pose const & pose );
144 
145  ///
146  void
147  copy_dofs_from_pose(
148  pose::Pose const & pose,
149  Multivec & dofs
150  ) const;
151 
152  ///
153  void
154  copy_dofs_to_pose(
155  pose::Pose & pose,
156  Multivec const & dofs
157  ) const;
158 
159  ///
160  inline
161  int
162  nangles() const
163  {
164  return dof_nodes_.size();
165  }
166 
167  ///
168  void
169  reset_jump_rb_deltas(
170  pose::Pose & pose,
171  Multivec & dofs
172  ) const;
173 
174  // this is used in pack/unpack_phipsi and deriv calculation
175  Real
176  torsion_scale_factor(
177  DOF_Node const & tor
178  ) const; */
179 
180  ///
181  virtual
182  kinematics::DomainMap const &
183  domain_map() const = 0;
184 
185  /*
186  /// get a dof_node by its dof_id
187  DOF_Node*
188  dof_node_from_id( DOF_ID const &id )
189  {
190  DOF_Node* node = 0;
191  if ( id.valid() ) {
192  node = dof_node_pointer_[ id ];
193  if ( node == 0 ) {
194  std::cerr << "DOF_ID does not exist in map! torsion= " << id << std::endl;
195  utility_exit();
196  }
197  }
198  return node;
199  }
200 
201 private:
202 
203  /// deletes and clears dof_nodes_
204  void
205  clear_dof_nodes();
206 
207  /// list of all the moving degrees of freedom
208  DOF_Nodes dof_nodes_;
209 
210  /// pointer from DOF_ID to the corresponding DOF_Node*
211  id::DOF_ID_Map< DOF_Node* > dof_node_pointer_;
212 
213  ///
214  kinematics::DomainMap domain_map_;
215 
216  void
217  assign_rosetta_torsions( pose::Pose const & pose ); // part of setup
218 
219 */
220 }; // MinimizerMapBase
221 
222 
223 } // namespace kinematics
224 } // namespace core
225 
226 
227 #endif