Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
DecomposeAndReweightEnergiesCalculator.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 Colin A. Smith
13 
14 
15 #ifndef INCLUDED_protocols_toolbox_pose_metric_calculators_DecomposeAndReweightEnergiesCalculator_hh
16 #define INCLUDED_protocols_toolbox_pose_metric_calculators_DecomposeAndReweightEnergiesCalculator_hh
17 
19 #include <core/pose/Pose.fwd.hh>
20 #include <core/types.hh>
23 #include <basic/MetricValue.fwd.hh>
24 // AUTO-REMOVED #include <core/id/AtomID_Map.hh>
26 
27 #include <utility/vector1.hh>
28 
29 
30 
31 
32 namespace protocols{
33 namespace toolbox {
34 namespace pose_metric_calculators {
35 
36 /*
37 class EnergiesEdge : public core::graph::Edge {
38 public:
39  core::scoring::EnergyMap energies;
40 
41  virtual EnergiesEdge () {};
42 
43  virtual void copy_from (Edge const *source) {
44  energies = static_cast< EnergiesEdge const * > ( source ).energies;
45  }
46 
47  virtual unsigned int count_static_memory () const { return sizeof(EnergiesEdge); }
48  virtual unsigned int count_dynamic_memory () const { return 0; }
49 }
50 
51 class EnergiesGraph : public core::graph::Graph {
52 
53 public:
54 
55  virtual ~Graph() {
56 
57  }
58 
59  virtual void delete_edge(Edge *edge) {
60 
61  }
62 
63  virtual unsigned int count_static_memory() const { return sizeof(EnergiesGraph); }
64  //virtual unsigned int count_dynamic_memory() const { return 0; }
65  //virtual Node * create_new_node(int node_index) {}
66 
67  virtual Edge * create_new_edge(int index1, int index2) {
68 
69  }
70 
71  virtual Edge * create_new_edge(Edge const *example_edge) {
72 
73  }
74 
75 private:
76 
77 
78 }
79 
80 class WeightsEdge : public core::graph::Edge {
81 
82 public:
83 
84  core::scoring::EnergyMap weights;
85  bool use_original_weights;
86  core::Real master_weight;
87 
88  virtual WeightsEdge () {};
89 
90  virtual void copy_from (Edge const *source) {
91  energies = static_cast< EnergyMapEdge const * > ( source ).energies;
92  use_original_weights = static_cast< EnergyMapEdge const * > ( source ).use_original_weights;
93  master_weight = static_cast< EnergyMapEdge const * > ( source ).master_weight;
94  }
95 
96  virtual unsigned int count_static_memory () const { return sizeof(WeightsEdge); }
97  virtual unsigned int count_dynamic_memory () const { return 0; }
98 }
99 */
100 
102 
103  public:
104 
106  use_original_weights_(true),
107  master_weight_(1.)
108  {}
109 
111  core::scoring::EnergyMap const & energy_map() const { return energy_map_; }
113 
115  core::scoring::EnergyMap const & weight_map() const { return weight_map_; }
117 
120 
123 
126  result *= weight_map_;
127  result *= master_weight_;
128  return result;
129  }
132 
133 private:
134 
139 };
140 
142 
143 public:
144 
145  // set to 1 because there will often only be two vertices
146  static int const NUM_EDGES_TO_RESERVE = 1;
147 };
148 
150 
151 public:
152 
158 
159  // preferred constructor - use an existing InterfaceNeighborDefinitionCalculator
161  std::string const & NameOfResidueDecompositionCalculator
162  );
163 
165  DecomposeAndReweightEnergiesCalculator const & calculator
166  );
167 
169  { return new DecomposeAndReweightEnergiesCalculator( *this ); }
170 
173  EnergiesData const & other_energies() const { return other_energies_; }
178 
179  core::Size
180  num_sets() const;
181 
182  void
183  num_sets(
185  );
186 
187  core::Size
188  num_components() const;
189 
190  EnergiesData const &
191  component(
192  core::Size index
193  ) const;
194 
196  master_weight_vector() const;
197 
198  void
201  );
202 
204  names_vector() const;
205 
208 
211 
213  weighted_total_vector() const;
214 
217 
218  void
219  show(
220  std::ostream & out
221  ) const;
222 
223 protected:
224 
225  virtual void lookup( std::string const & key, basic::MetricValueBase * valptr ) const;
226  virtual std::string print( std::string const & key ) const;
227  virtual void recompute( core::pose::Pose const & this_pose );
228 
229 private:
230 
231  EnergiesData &
232  component(
233  core::Size index
234  );
235 
236  void
237  clear_energies();
238 
239  void
241 
242  void
244 
246 
252 
254 };
255 
258 
259 
260 } // namespace pose_metric_calculators
261 } // namespace toolbox
262 } // namespace protocols
263 
264 #endif