Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
TwoBodyEnergy.cc
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/scoring/methods/TwoBodyEnergy.cc
11 /// @brief Two Body Energy Method base class implementation
12 /// @author Andrew Leaver-Fay
13 
14 // Unit Headers
16 
17 // Package Headers
21 
22 // Project Headers
25 
26 // ObjexxFCL Headers
27 #include <ObjexxFCL/FArray2D.hh>
28 
29 #include <utility/vector1.hh>
30 
31 
32 namespace core {
33 namespace scoring {
34 namespace methods {
35 
37 
39 
40 bool
42  conformation::Residue const &,
43  conformation::Residue const &,
44  bool
45 ) const
46 {
47  return true;
48 }
49 
50 bool
52 {
53  return false;
54 }
55 
56 void
58  conformation::Residue const &,
59  conformation::Residue const &,
61  pose::Pose const &,
62  ScoreFunction const &,
63  EnergyMap &
64 ) const
65 {
66  // APL Noop for now; replace with utility_exit_with_message( "unimplemented extended residue-pair-energy interface method" )
67 }
68 
69 void
71  conformation::Residue const &,
72  conformation::Residue const &,
73  pose::Pose const &,
74  ScoreFunction const &,
79 ) const
80 {
81  // Noop
82 }
83 
84 /// @details Default return-false implementation.
85 bool
87 {
88  return false;
89 }
90 
91 void
93  conformation::Residue const & ,
94  pose::Pose const & ,
95  ScoreFunction const &,
97 ) const
98 {
99  // NOOP stub.
100  // This should generate an error
101 }
102 
103 
104 bool
106 {
107  return false;
108 }
109 
110 void
112  conformation::Residue const & ,
113  pose::Pose const & ,
114  ScoreFunction const &,
116 ) const
117 {
118  // NOOP.
119 }
120 
121 /// @details Default return-false implementation.
122 bool
124 {
125  return false;
126 }
127 
128 void
130  conformation::Residue const & ,
131  conformation::Residue const & ,
132  ResSingleMinimizationData const & ,
133  ResSingleMinimizationData const & ,
134  pose::Pose const & ,
135  ScoreFunction const &,
137 ) const
138 {
139  // NOOP stub.
140  // This should generate an error
141 }
142 
143 
144 bool
146 {
147  return false;
148 }
149 
150 void
152  conformation::Residue const & ,
153  conformation::Residue const & ,
154  ResSingleMinimizationData const & ,
155  ResSingleMinimizationData const & ,
156  pose::Pose const & ,
157  ScoreFunction const &,
159 ) const
160 {
161  // NOOP stub.
162 }
163 
164 void
166  conformation::Residue const & ,
167  conformation::Residue const & ,
168  pose::Pose const & ,
169  ScoreFunction const & ,
170  EnergyMap &
171 ) const
172 {}
173 
174 void
176  conformation::Residue const &,
177  conformation::Residue const &,
180  ResPairMinimizationData const &,
181  pose::Pose const &,
182  EnergyMap const &,
185 ) const
186 {}
187 
188 
189 void
191  conformation::Residue const & ,
192  conformation::Residue const & ,
193  pose::Pose const & ,
194  ScoreFunction const & ,
195  EnergyMap &
196 ) const
197 {}
198 
199 
200 void
202  conformation::Residue const & rsd1,
203  conformation::Residue const & rsd2,
204  pose::Pose const & pose,
205  ScoreFunction const & sfxn,
206  EnergyMap & emap
207 ) const
208 {
209  residue_pair_energy( rsd1, rsd2, pose, sfxn, emap );
210 }
211 
212 bool
214  conformation::Residue const &
215 ) const
216 {
217  return true;
218 }
219 
220 bool
222 {
223  return false;
224 }
225 
226 void
228  conformation::Residue const &,
230  pose::Pose const &,
231  ScoreFunction const &,
232  EnergyMap &
233 ) const
234 {
235  /// APL default noop implementation for this extended interface;
236  /// to be replaced with a utility_exit_with_message soon.
237 }
238 
239 void
241  conformation::Residue const &,
242  pose::Pose const &,
243  ScoreFunction const &,
246 ) const
247 {}
248 
249 // @brief Low fidelity evaluation of sc/bb + sc/sc energy.
250 // Do not define in derived class if that class should not be
251 // used in the packer's bump check phase.
252 void
254  conformation::Residue const &,
255  conformation::Residue const &,
256  pose::Pose const &,
257  ScoreFunction const &,
258  EnergyMap &
259 ) const
260 {}
261 
262 void
264  conformation::Residue const &,
266  pose::Pose const &,
267  EnergyMap const &,
269 ) const
270 {
271  /// Default noop
272 }
273 
274 bool
276 {
277  return false;
278 }
279 
280 Real
282  conformation::Residue const & ,
284  id::DOF_ID const &,
285  id::TorsionID const &,
286  pose::Pose const &,
287  ScoreFunction const &,
288  EnergyMap const &
289 ) const
290 {
291  return 0.0;
292 }
293 
294 // @brief Low fidelity evaluation of sc/bb energy.
295 // Do not define in derived class if that class should not be
296 // used in the packer's bump check phase.
297 void
299  conformation::Residue const &,
300  conformation::Residue const &,
301  pose::Pose const &,
302  ScoreFunction const &,
303  EnergyMap &
304 ) const
305 {}
306 
307 void
309  conformation::RotamerSetBase const & set1,
310  conformation::RotamerSetBase const & set2,
311  pose::Pose const & pose,
312  ScoreFunction const & sfxn,
313  EnergyMap const & weights,
314  ObjexxFCL::FArray2D< core::PackerEnergy > & energy_table
315 ) const
316 {
317  using namespace conformation;
318  using namespace numeric;
319 
320  EnergyMap emap;
321  for ( Size ii = 1, ii_end = set1.num_rotamers(); ii <= ii_end; ++ii ) {
322  for ( Size jj = 1, jj_end = set2.num_rotamers(); jj <= jj_end; ++jj ) {
323  emap.zero();
324  residue_pair_energy( *set1.rotamer( ii ), *set2.rotamer( jj ), pose, sfxn, emap );
325  energy_table( jj, ii ) += static_cast< core::PackerEnergy > (weights.dot( emap ));
326  }
327  }
328 }
329 
330 void
332  conformation::RotamerSetBase const & set,
333  pose::Pose const & pose,
334  ScoreFunction const & sfxn,
336 ) const
337 {
338  using namespace conformation;
339  using namespace numeric;
340 
341  EnergyMap emap;
342  for ( Size ii = 1, ii_end = set.num_rotamers(); ii <= ii_end; ++ii ) {
343  emap.zero();
344  eval_intrares_energy( *set.rotamer( ii ), pose, sfxn, emap );
345  energies[ ii ] += static_cast< core::PackerEnergy > ( sfxn.weights().dot( emap ) );
346  }
347 }
348 
349 void
351  conformation::RotamerSetBase const & set,
352  pose::Pose const & pose,
353  ScoreFunction const & sfxn,
355 ) const
356 {
357  using namespace conformation;
358  using namespace numeric;
359 
360  EnergyMap emap;
361  for ( Size ii = 1, ii_end = set.num_rotamers(); ii <= ii_end; ++ii ) {
362  emap.zero();
363  eval_intrares_energy( *set.rotamer( ii ), pose, sfxn, emap );
364  emaps[ ii ] += emap;
365  }
366 }
367 
368 void
370  conformation::RotamerSetBase const & set,
371  conformation::Residue const & residue,
372  pose::Pose const & pose,
373  ScoreFunction const & sfxn,
374  EnergyMap const & weights,
376 ) const
377 {
378  EnergyMap emap;
379  for ( Size ii = 1, ii_end = set.num_rotamers(); ii <= ii_end; ++ii ) {
380  emap.zero();
381  residue_pair_energy( *set.rotamer( ii ), residue, pose, sfxn, emap );
382  energy_vector[ ii ] += static_cast< core::PackerEnergy > (weights.dot( emap ));
383  }
384 }
385 
386 void
388  conformation::RotamerSetBase const & set,
389  conformation::Residue const & residue,
390  pose::Pose const & pose,
391  ScoreFunction const & sfxn,
392  EnergyMap const & , // weights
394 ) const
395 {
396  EnergyMap emap;
397  for ( Size ii = 1, ii_end = set.num_rotamers(); ii <= ii_end; ++ii ) {
398  emap.zero();
399  residue_pair_energy( *set.rotamer( ii ), residue, pose, sfxn, emap );
400  emaps[ ii ] += emap;
401  }
402 }
403 
404 
405 }
406 }
407 }