Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SymMinimizerMap.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 // This file is part of the Rosetta software suite and is made available under license.
5 // The Rosetta software is developed by the contributing members of the Rosetta Commons consortium.
6 // (C) 199x-2009 Rosetta Commons participating institutions and developers.
7 // For more information, see http://www.rosettacommons.org/.
8 
9 /// @file core/optimization/SymMinimizerMap.hh
10 /// @brief MinimizerMap for symmetric minimization.
11 /// @author Andrew Leaver-Fay (aleaverfay@gmail.com)
12 
13 #ifndef INCLUDED_core_optimization_symmetry_SymMinimizerMap_hh
14 #define INCLUDED_core_optimization_symmetry_SymMinimizerMap_hh
15 
16 // Unit headers
18 
19 // Package headers
22 
23 // Project headers
24 #include <core/id/AtomID_Map.hh>
25 #include <core/id/DOF_ID_Map.hh>
27 #include <core/pose/Pose.fwd.hh>
29 // AUTO-REMOVED #include <core/scoring/ScoreFunction.fwd.hh>
31 
33 
34 // Utility headers
35 #include <utility/vector1.hh>
36 
37 // C++ headers
38 #include <list>
39 
41 #include <ObjexxFCL/FArray1D.hh>
42 
43 #ifdef WIN32
45 #endif
46 
47 namespace core {
48 namespace optimization {
49 namespace symmetry {
50 
51 /// @brief Atom tree multifunction class
53 public:
55  typedef std::list< DOF_NodeOP > DOF_Nodes;
56  typedef DOF_Nodes::const_iterator const_iterator;
57  //typedef DOF_Nodes::iterator iterator;
58 
59 public: // Creation
60 
61  // c-tor
63  pose::Pose const & pose, // must have been scored before this setup; energy map must be up-to-date
64  kinematics::MoveMap const & mm, // does not have to be "symmetric" -- it will be symmetrized
65  SymmetryInfoCOP symm_info
66  );
67 
68  /// @brief Destructor
69  virtual
71 
72  /// @brief The atom tree will report that a new torsion has been identified as free in the traversal of the atom tree.
73  /// If this is an independent torsion, then the SymMinimizerMap will add a new DOF_Node, but otherwise, will
74  /// ignore the DOF. The atom tree will traverse through dependent torsions in addition to independent torsions, and
75  /// it's the job of the SymMinimizerMap to weed out the dependent torsions.
76  virtual
77  void
79  DOF_ID const & new_torsion,
80  DOF_ID const & parent
81  );
82 
83  /// @brief Add an atom to the list of atoms controlled by a given DOF. The SymMinimzierMap
84  /// will figure out, first, if the dof_id is a dependent or independent dof. If it's a dependent
85  /// DOF, then it will figure out if the given atom has any interactions with an independent residue.
86  /// If not, then the atom is ignored. If it does, then the SymMinimizerMap will figure out
87  /// what independent DOF the given dependent DOF is a a clone of, and add this atom as being controlled
88  /// by that dependent DOF.
89  virtual
90  void
91  add_atom(
92  AtomID const & atom_id,
93  DOF_ID const & dof_id
94  );
95 
96  virtual
97  kinematics::DomainMap const &
98  domain_map() const;
99 
100  void
102  pose::Pose const & pose,
103  Multivec & dofs
104  ) const;
105 
106  void
108  pose::Pose & pose,
109  Multivec const & dofs
110  ) const;
111 
112  DOF_NodeOP
113  dof_node_from_id( DOF_ID const &id ) const;
114 
116 
117  void zero_torsion_vectors();
118 
119  void link_torsion_vectors();
120 
121  Real
123  DOF_Node const & dof_node
124  ) const;
125 
126  void
128  pose::Pose & pose,
129  Multivec & dofs
130  ) const;
131 
132 public:
133  /// Allow read/write access to the DOF_Nodes themselves, but do not allow anyone to change the
134  /// DOF_Nodes list. Elements cannot be dropped from the list, nor should the list be clearable.
135  /// Of course: if you have a const iterator to a list element containing a pointer, then it is
136  /// entirely possible to perform non-const operations on the thing being pointed at.
137  /// HOWEVER, neither the pointer nor the list element can be changed.
138 
139  /// @brief begin iterator for the independent dofs
141  begin() const
142  {
143  return dof_nodes_.begin();
144 
145  }
146  /// @brief End iterator for the independent dofs
148  end() const
149  {
150  return dof_nodes_.end();
151  }
152 
155  {
156  return dependent_dof_nodes_.begin();
157  }
158 
159  ///
162  {
163  return dependent_dof_nodes_.end();
164  }
165 
166 
167 
168  ///
169  DOF_Nodes const &
170  dof_nodes() const
171  {
172  return dof_nodes_;
173  }
174 
175  /// @brief Retrieve the per-atom derivatives that are accumulated in to
178  return atom_derivatives_[ resid ];
179  }
180 
181 private:
182 
183  /// @brief Non-virtual method -- not invoked directly by the atom tree.
184  void
186  DOF_ID const & new_torsion,
187  DOF_ID const & parent,
188  bool dependent
189  );
190 
191  /// @brief Convert a cloned dof into its equivalent in the asymmetric unit
192  id::DOF_ID asymmetric_dof( DOF_ID const & cloned_dof ) const;
193 
194  void assign_rosetta_torsions( pose::Pose const & pose );
195 
196 
197 private:
198  pose::Pose const & pose_; // needed in the add_torsion, and add_atom callback functions
201 
206 
207  /// pointer from DOF_ID to the corresponding DOF_NodeOP
209 
211 
213 
214 };
215 
216 } // symmetry
217 } // namespace optimization
218 } // namespace core
219 
220 #endif