Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
OneBodyEnergy.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
11 /// @brief
12 /// @author
13 
14 
15 #ifndef INCLUDED_core_scoring_methods_OneBodyEnergy_hh
16 #define INCLUDED_core_scoring_methods_OneBodyEnergy_hh
17 
18 // Unit headers
20 
21 // Package headers
26 
27 // Project headers
29 #include <core/pose/Pose.fwd.hh>
30 #include <core/id/TorsionID.fwd.hh>
31 #include <core/id/DOF_ID.fwd.hh>
33 
34 // Utility headers
35 #include <utility/vector1.fwd.hh>
36 
38 #include <utility/vector1.hh>
39 
40 
41 #ifdef PYROSETTA
43 #endif
44 
45 
46 namespace core {
47 namespace scoring {
48 namespace methods {
49 
50 class OneBodyEnergy : public EnergyMethod {
51 public:
53 
54 public:
55  /// @brief Constructor with an EnergyMethodCreator to inform the EnergyMethod
56  /// parent which ScoreTypes this EnergyMethod is responsible for computing.
58 
59  // @brief dstor;
60  virtual ~OneBodyEnergy();
61 
62  /// @brief Evaluate the one-body energies for a particular residue, in the context of a
63  /// given Pose, and increment those energies in the input Emap (do not overwrite them).
64  virtual
65  void
67  conformation::Residue const & rsd,
68  pose::Pose const & pose,
69  EnergyMap & emap
70  ) const = 0;
71 
72  /// @brief During minimization, energy methods are allowed to decide that they say nothing
73  /// about a particular residue (e.g. no non-zero energy) and as a result they will not be queried for
74  /// a derivative or an energy. The default behavior is to return "true" for all residues.
75  virtual
76  bool
78  conformation::Residue const &
79  ) const;
80 
81  /// @brief Rely on the extended version of the residue_energy function during score-function
82  /// evaluation in minimization? The extended version (below) takes a ResSingleMinimizationData.
83  /// Return 'true' for the extended version. The default method implemented in this class returns 'false'
84  virtual
85  bool
87 
88  /// @brief Evaluate the one-body energies for a particular residue, in the context of a
89  /// given Pose, and with the help of a piece of cached data for minimization, increment those
90  /// one body energies into the input EnergyMap. The calling function must guarantee that this
91  /// EnergyMethod has had the opportunity to update the input ResSingleMinimizationData object
92  /// for the given residue in a call to setup_for_minimizing_for_residue before this function is
93  /// invoked. This function should not be called unless the use_extended_residue_energy_interface()
94  /// method returns "true". Default implementation provided by this base class calls
95  /// utility::exit(). The Pose merely serves as context, and the input residue is not required
96  /// to be a member of the Pose.
97  virtual
98  void
100  conformation::Residue const & rsd,
101  ResSingleMinimizationData const & min_data,
102  pose::Pose const & pose,
103  EnergyMap & emap
104  ) const;
105 
106  /// @brief Called at the beginning of minimization, allowing this energy method to cache data
107  /// pertinent for a single residue in the the ResSingleMinimizationData that is used for a
108  /// particular residue in the context of a particular Pose. This base class provides a noop
109  /// implementation for this function if there is nothing that the derived class needs to perform
110  /// in this setup phase. The Pose merely serves as context, and the input residue is not
111  /// required to be a member of the Pose.
112  virtual
113  void
115  conformation::Residue const & rsd,
116  pose::Pose const & ,
117  ScoreFunction const & ,
120  ) const;
121 
122  /// @brief Does this EnergyMethod require the opportunity to examine the residue before scoring begins? Not
123  /// all energy methods would. The ScoreFunction will not ask energy methods to examine residues that are uninterested
124  /// in doing so.
125  virtual
126  bool
128 
129  /// @brief Do any setup work should the coordinates of this residue, who is still guaranteed to be
130  /// of the same residue type as when setup_for_minimizing_for_residue was called, have changed so dramatically
131  /// as to possibly require some amount of setup work before scoring should proceed
132  virtual
133  void
135  conformation::Residue const & rsd,
136  pose::Pose const & pose,
137  ScoreFunction const & sfxn,
138  ResSingleMinimizationData & min_data
139  ) const;
140 
141 
142  /// @brief Does this EnergyMethod require the opportunity to examine the residue before derivative evaluation begins? Not
143  /// all energy methods would. The ScoreFunction will not ask energy methods to examine residues that are uninterested
144  /// in doing so.
145  virtual
146  bool
148 
149  /// @brief Do any setup work necessary before evaluating the derivatives for this residue
150  virtual
151  void
153  conformation::Residue const & rsd,
154  pose::Pose const & pose,
155  ScoreFunction const & sfxn,
156  ResSingleMinimizationData & min_data
157  ) const;
158 
159  /// @brief Evaluate the derivative for an atom in a residue in the context of a particular pose,
160  /// and increment the F1 and F2 vectors. This base class provides a default noop implementation
161  /// of this function. The calling function must guarantee that this EnergyMethod has had the
162  /// opportunity to update the input ResSingleMinimizationData object for the given residue
163  /// in a call to prepare_for_minimization before this function is invoked. The Pose merely
164  /// serves as context, and the input residue is not required to be a member of the Pose.
165  /// DEPRECATED -- too slow.
166  /*virtual
167  void
168  eval_atom_derivative_for_residue(
169  Size const atom_index,
170  conformation::Residue const & rsd,
171  ResSingleMinimizationData const & min_data,
172  pose::Pose const & pose, // provides context
173  kinematics::DomainMap const & domain_map,
174  ScoreFunction const & sfxn,
175  EnergyMap const & weights,
176  Vector & F1,
177  Vector & F2
178  ) const;*/
179 
180  /// @brief Evaluate the derivatives for all atoms on this residue and increment them
181  /// into the input atom_derivs vector1. The calling function must guarantee that
182  /// setup for derivatives is called before this function is, and that the atom_derivs
183  /// vector contains at least as many entries as there are atoms in the input Residue.
184  /// This base class provides a default noop implementation of this function.
185  virtual
186  void
188  conformation::Residue const & rsd,
189  ResSingleMinimizationData const & min_data,
190  pose::Pose const & pose,
191  EnergyMap const & weights,
193  ) const;
194 
195  /// @brief Use the dof_derivative interface for this energy method when
196  /// calculating derivatives? It is possible to define both dof_derivatives and
197  /// atom-derivatives; they are not mutually exclusive.
198  virtual
199  bool
200  defines_dof_derivatives( pose::Pose const & p ) const;
201 
202  /// @brief Evaluate the DOF derivative for a particular residue. The Pose merely serves as context,
203  /// and the input residue is not required to be a member of the Pose.
204  virtual
205  Real
207  conformation::Residue const & rsd,
208  ResSingleMinimizationData const & min_data,
209  id::DOF_ID const & dof_id,
210  id::TorsionID const & torsion_id,
211  pose::Pose const & pose,
212  ScoreFunction const & sfxn,
213  EnergyMap const & weights
214  ) const;
215 
216 
217 
218 };
219 
220 } // methods
221 } // scoring
222 } // core
223 
224 
225 #endif // INCLUDED_core_scoring_EtableEnergy_HH