Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SCMinMinimizerMap.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/pack/scmin/SCMinMinimizerMap.hh
11 /// @brief Class for identifying the sidechain DOFs in the AtomTree which are free during
12 /// any particular call to the minimizer.
13 /// @author Andrew Leaver-Fay (aleaverfay@gmail.com)
14 
15 #ifndef INCLUDED_core_pack_scmin_SCMinMinimizerMap_hh
16 #define INCLUDED_core_pack_scmin_SCMinMinimizerMap_hh
17 
18 // Unit headers
20 
21 // Package Headers
23 
24 // Project Headers
25 #include <core/types.hh>
27 #include <core/id/AtomID_Map.hh>
28 #include <core/id/DOF_ID.hh>
29 // AUTO-REMOVED #include <core/id/DOF_ID_Mask.hh>
30 // AUTO-REMOVED #include <core/id/TorsionID.hh>
32 // AUTO-REMOVED #include <core/kinematics/AtomTree.fwd.hh>
34 // AUTO-REMOVED #include <core/kinematics/DomainMap.hh>
41 
42 //#include <core/pose/Pose.fwd.hh>
43 //#include <core/scoring/ScoreFunction.fwd.hh>
44 
45 // Utility headers
46 #include <utility/vector1.hh>
47 #include <utility/pointer/ReferenceCount.hh>
48 
49 #include <core/id/DOF_ID_Map.hh>
51 #include <core/id/TorsionID.fwd.hh>
52 #include <ObjexxFCL/FArray1D.hh>
53 
54 
55 namespace core {
56 namespace pack {
57 namespace scmin {
58 
59 /// @brief
61 {
62 public:
64  focused_residue_( 0 ),
65  nactive_residues_( 0 ),
66  nonideal_(false)
67  {}
68 
69  virtual
71 
72 
73  /// @brief the SCMinMinimizerMap has to know how many residues are in the pose; this allows
74  /// it to do O(1) updates to its DomainMap -- this function costs O(N).
75  virtual
76  void set_total_residue( Size total_residue ) = 0;
77 
78  /// @brief Disable the minimization for all residues. Ammortized O(1).
79  virtual
80  void clear_active_dofs() = 0;
81 
82  /// @brief Activate all the dofs for a particular residue. Ammortized O(1).
83  virtual
84  void activate_residue_dofs( Size resindex ) = 0;
85 
86  /// @brief Invoked during the depth-first traversal through the AtomTree. The AtomTree
87  /// is indicating that a particular torsion is dependent on another torsion. Record
88  /// that fact.
89  //fpd seperate implementations in cart and atomtree
90  virtual
91  void
93  DOF_ID const & new_torsion,
94  DOF_ID const & parent
95  ) = 0;
96 
97  /// @brief Invoked during the depth-first traversal through the AtomTree; the atom
98  /// tree is indicating that a given atom is controlled by a particular DOF. Record
99  /// that fact.
100  //fpd seperate implementations in cart and atomtree
101  virtual
102  void
103  add_atom(
104  AtomID const & atom_id,
105  DOF_ID const & dof_id
106  ) = 0;
107 
108  /// @brief Traverse the atom trees in preparation for minimization to tie together all the
109  /// DOFs and the atoms they control.
110  //fpd seperate implementations in cart and atomtree
111  virtual
112  void
113  setup( AtomTreeCollectionOP trees ) = 0;
114 
115 public:
116 
117  /// Accessors
119  Size active_residue( Size index ) const { assert( index <= nactive_residues_ ); return active_residues_[ index ]; }
120 
121  /// @brief MinimizerMapBase class virtual accessor
122  virtual kinematics::DomainMap const & domain_map() const { return domain_map_; }
123 
124  /// @brief Inline accessor
125  inline kinematics::DomainMap const & dm() const { return domain_map_; }
126 
127  /// @brief Convenience lookup -- turns over the request to the AtomTreeCollection
128  virtual
129  conformation::Residue const &
130  residue( Size seqpos ) const = 0;
131 
132  virtual
133  Size n_dof_nodes() const = 0;
134 
135  /// @brief Initialize a multivec with the dofs reflected in the current residue(s)
136  virtual
137  void starting_dofs( optimization::Multivec & dofs ) const = 0;
138 
139  /// @brief Assign the chi values to the residue(s)
140  virtual
142 
143  // fpd get dof_node by index
144  virtual
146  dof_node( Size index ) = 0;
147 
148  virtual
149  optimization::DOF_Node const &
150  dof_node_for_chi( Size resid, Size chiid ) const = 0;
151 
152  virtual
154  tor_for_dof( id::DOF_ID const & dofid ) const = 0;
155 
156  virtual
157  kinematics::tree::Atom const &
158  atom( AtomID const & atid ) const = 0;
159 
160  virtual
161  void zero_atom_derivative_vectors() = 0;
162 
163  /// @brief propagate f1/f2's up from children to parents
164  virtual
165  void link_torsion_vectors() = 0;
166 
167  virtual
168  void set_natoms_for_residue( Size resid, Size natoms ) = 0;
169 
172  return atom_derivatives_[ resid ];
173  }
174 
175  void
176  set_nonideal( bool val_in ) {
177  nonideal_ = val_in;
178  }
179 
180  virtual
183  pose::Pose & p,
185  scoring::ScoreFunction const & sfxn,
186  scoring::MinimizationGraph & mingraph) = 0;
187 
188 protected:
189  virtual
190  void reset_dof_nodes() = 0;
191 
192 protected:
193  /// each atom tree in the AtomTreeCollection will tell us that it represents residue 1.
194  /// this variable tells us which residue is actually being represented.
196 
198 
200 
204 
205  // fpd for cartesian control bb movement instead
206  bool nonideal_;
207 };
208 
209 
210 
211 } // namespace scmin
212 } // namespace pack
213 } // namespace core
214 
215 #endif