Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
LinearChainbreakEnergy.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/scoring/methods/EtableEnergy.hh
11 /// @brief Etable energy method class declaration
12 /// @author Phil Bradley
13 /// @author Andrew Leaver-Fay
14 /// @author Christopher Miles (cmiles@uw.edu)
15 
16 #ifndef INCLUDED_core_scoring_methods_LinearChainbreakEnergy_hh
17 #define INCLUDED_core_scoring_methods_LinearChainbreakEnergy_hh
18 
19 // Unit headers
21 
22 // Package headers
23 #include <core/types.hh>
26 #include <core/pose/Pose.fwd.hh>
30 
31 // Project headers
32 
33 // Third-party headers
34 #include <boost/scoped_ptr.hpp>
35 
36 // C++ headers
37 // AUTO-REMOVED #include <cstdlib>
38 
39 #include <utility/vector1.hh>
40 
41 
42 using boost::scoped_ptr;
43 using core::Size;
45 
46 namespace core {
47 namespace scoring {
48 namespace methods {
49 
50 /// @brief LinearChainbreakEnergy class iterates across all residues in finalize()
51 /// and determines the penalty between residues i and i+1 by how much their
52 /// psueduo atoms do not align.
54 public:
56 
57  // @brief Creates a new LinearChainbreakEnergy with the default allowable sequence
58  // separation (+inf)
60 
61  // @brief Create a new LinearChainbreakEnergy with the specified allowable sequence
62  // separation
63  explicit LinearChainbreakEnergy(Size allowable_sequence_sep);
64 
65  /// @brief The auto-generated copy constructor does not properly handle smart
66  /// pointer types, so we must explicitly define our own.
68 
69  /// @brief The auto-generated operator=() method does not properly handle pointer types.
71 
72  // @brief Releases resources associated with an instance.
74 
75  /// clone
76  virtual EnergyMethodOP clone() const {
77  return new LinearChainbreakEnergy(*this);
78  }
79 
80  /// called at the end of energy evaluation
81  virtual void finalize_total_energy(
82  pose::Pose & pose,
83  ScoreFunction const &,
84  EnergyMap & totals) const;
85 
86  /// called during gradient-based minimization inside dfunc
87  /**
88  F1 and F2 are not zeroed -- contributions from this atom are
89  just summed in
90  **/
91  virtual void eval_atom_derivative(id::AtomID const & id,
92  pose::Pose const & pose,
93  kinematics::DomainMap const & domain_map,
94  ScoreFunction const & sfxn,
95  EnergyMap const & weights,
96  Vector & F1,
97  Vector & F2) const;
98 
100 
101 private:
103  const core::conformation::Residue& upper_rsd,
104  const core::Size nbb) const;
105 
107  const core::conformation::Residue& upper_rsd,
108  const core::Size nbb,
109  const core::Size cutpoint,
110  const core::pose::Pose& pose) const;
111 
112  // Initialization routine common to both constructor
113  void initialize(Size allowable_sequence_sep);
114 
115  // Maximum allowable sequence separation permitted for scoring
117 
118  // Every call to finalize_total_energy() requires us to compute shortest
119  // paths between the residues defining a cutpoint. The
120  // ShortestPathInFoldTree object computes pair-wise shortest paths
121  // between all residues in its constructor. However, it is unaware of
122  // changes to the FoldTree used to initialize it. As a result, we can
123  // only reuse a ShortestPathInFoldTree object if we are certain that the
124  // FoldTree has not changed.
125  mutable scoped_ptr<ShortestPathInFoldTree> shortest_paths_;
126 
127  // FoldTree::hash_value() provides a time- and space-efficient mechanism
128  // to compare a pair of FoldTree's. Each time we are forced to recompute
129  // the ShortestPathInFoldTree (either because it has yet to be
130  // initialized or because the FoldTree has changed), we take note of the
131  // new FoldTree's hash value.
132  mutable size_t previous_hash_value_;
133 
134  virtual
135  core::Size version() const;
136 };
137 
138 } // methods
139 } // scoring
140 } // core
141 #endif