Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
AtomTreeSCMinMinimizerMap.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/AtomTreeSCMinMinimizerMap.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_AtomTreeSCMinMinimizerMap_hh
16 #define INCLUDED_core_pack_scmin_AtomTreeSCMinMinimizerMap_hh
17 
18 // Unit headers
22 
23 // Package Headers
25 
26 // Project Headers
27 #include <core/types.hh>
29 #include <core/id/AtomID_Map.hh>
30 #include <core/id/DOF_ID.hh>
31 // AUTO-REMOVED #include <core/id/DOF_ID_Mask.hh>
32 // AUTO-REMOVED #include <core/id/TorsionID.hh>
34 // AUTO-REMOVED #include <core/kinematics/AtomTree.fwd.hh>
36 // 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:
65 
66 public:
69 
70  /// @brief the AtomTreeSCMinMinimizerMap has to know how many residues are in the pose; this allows
71  /// it to do O(1) updates to its DomainMap -- this function costs O(N).
72  virtual
73  void set_total_residue( Size total_residue );
74 
75  /// @brief Disable the minimization for all residues. Ammortized O(1).
76  virtual
77  void clear_active_dofs();
78 
79  /// @brief Activate all the dofs for a particular residue. Ammortized O(1).
80  virtual
81  void activate_residue_dofs( Size resindex );
82 
83  /// @brief Invoked during the depth-first traversal through the AtomTree. The AtomTree
84  /// is indicating that a particular torsion is dependent on another torsion. Record
85  /// that fact.
86  virtual
87  void
89  DOF_ID const & new_torsion,
90  DOF_ID const & parent
91  );
92 
93  /// @brief Invoked during the depth-first traversal through the AtomTree; the atom
94  /// tree is indicating that a given atom is controlled by a particular DOF. Record
95  /// that fact.
96  virtual
97  void
98  add_atom(
99  AtomID const & atom_id,
100  DOF_ID const & dof_id
101  );
102 
103  /// @brief Traverse the atom trees in preparation for minimization to tie together all the
104  /// DOFs and the atoms they control.
105  void
106  setup( AtomTreeCollectionOP trees );
107 
108 public:
109 
110  /// Accessors
112  Size active_residue( Size index ) const { assert( index <= nactive_residues_ ); return active_residues_[ index ]; }
113 
114  /// @brief MinimizerMapBase class virtual accessor
115  virtual kinematics::DomainMap const & domain_map() const { return domain_map_; }
116 
117  /// @brief Inline accessor
118  inline kinematics::DomainMap const & dm() const { return domain_map_; }
119 
121 
122  /// @brief Initialize a multivec with the dofs reflected in the current residue(s)
123  void starting_dofs( optimization::Multivec & dofs ) const;
124 
125  /// @brief Assign the chi values to the residue(s)
127 
129  dof_node( Size index ) {
130  assert( index > 0 && index <= n_active_dof_nodes_ );
131  return *dof_nodes_[ index ];
132  }
133 
134  virtual
135  conformation::Residue const &
136  residue( Size seqpos ) const;
137 
138  optimization::DOF_Node const &
139  dof_node_for_chi( Size resid, Size chiid ) const;
140 
142  tor_for_dof( id::DOF_ID const & dofid ) const;
143 
144  kinematics::tree::Atom const &
145  atom( AtomID const & atid ) const;
146 
148 
149  /// @brief propagate f1/f2's up from children to parents
150  void link_torsion_vectors();
151 
152  void set_natoms_for_residue( Size resid, Size natoms );
153 
156  pose::Pose & p,
158  scoring::ScoreFunction const & sfxn,
159  scoring::MinimizationGraph & mingraph)
160  {
161  optimization::MultifuncOP retval( new SCMinMultifunc(p,bg_residues,sfxn,mingraph,*this) );
162  return retval;
163  }
164 
165 protected:
166  void reset_dof_nodes();
167 
168 private:
170 
171  id::DOF_ID_Mask dof_mask_; // used in recursive descent through an atom tree
174 
179 
180  utility::vector1< Size > chi_start_for_active_residue_; // what's the index of the first chi for a particular active residue?
181  //fpd not sure if nonideal analogues are needed for this ...
183 
184  /// For parent_dof lookup: track which dofs a particular atom are responsible for.
187 };
188 
189 
190 
191 } // namespace scmin
192 } // namespace pack
193 } // namespace core
194 
195 #endif