Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
DGBindOptEData.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 protocols/optimize_weights/DGBindOptEData.hh
11 ///
12 /// @brief
13 /// @author Ian W. Davis
14 
15 
16 #ifndef INCLUDED_protocols_optimize_weights_DGBindOptEData_hh
17 #define INCLUDED_protocols_optimize_weights_DGBindOptEData_hh
18 
21 
22 #include <iostream>
23 // AUTO-REMOVED #include <fstream>
24 
25 #include <utility/vector1.hh>
26 
27 
28 namespace protocols {
29 namespace optimize_weights {
30 
31 
32 ///@brief Score a "bound" and an "unbound" structure, and minimize the squared error
33 /// between the difference in their scores and the experimental delta_G of binding.
35 {
36 public:
37 
39  virtual ~DGBindOptEData();
40 
41  // setters
42  void deltaG_bind(Real x) { deltaG_bind_ = x; }
45 
46  // my invention to avoid code duplication
47  virtual
48  Real
49  do_score(
50  std::ostream & ostr,
51  Multivec const & component_weights,
52  Multivec const & vars,
53  Multivec & dE_dvars,
54  /// Basically, turn over all the private data from OptEMultiFunc
55  Size const num_energy_dofs,
56  int const num_ref_dofs,
57  int const num_total_dofs,
58  EnergyMap const & fixed_terms,
59  ScoreTypes const & score_list,
60  ScoreTypes const & fixed_score_list,
61  bool const print
62  ) const;
63 
64  // inherited from OptEPositionData
65  virtual
66  Real
68  Multivec const & component_weights,
69  Multivec const & vars,
70  Multivec & dE_dvars,
71  /// Basically, turn over all the private data from OptEMultiFunc
72  Size const num_energy_dofs,
73  int const num_ref_dofs,
74  int const num_total_dofs,
75  EnergyMap const & fixed_terms,
76  ScoreTypes const & score_list,
77  ScoreTypes const & fixed_score_list
78  ) const
79  { return do_score(std::cout, component_weights, vars, dE_dvars, num_energy_dofs, num_ref_dofs, num_total_dofs, fixed_terms, score_list, fixed_score_list, false /* don't print */); }
80 
81  virtual
82  void
84  std::ostream & ostr,
85  Multivec const & component_weights,
86  Multivec const & vars,
87  Multivec & dE_dvars,
88  /// Basically, turn over all the private data from OptEMultiFunc
89  Size const num_energy_dofs,
90  int const num_ref_dofs,
91  int const num_total_dofs,
92  EnergyMap const & fixed_terms,
93  ScoreTypes const & score_list,
94  ScoreTypes const & fixed_score_list
95  ) const
96  { do_score(ostr, component_weights, vars, dE_dvars, num_energy_dofs, num_ref_dofs, num_total_dofs, fixed_terms, score_list, fixed_score_list, true /* do print */); }
97 
98  virtual
99  void
100  range(
101  ScoreTypes const & free_score_list,
102  ScoreTypes const & fixed_score_list,
103  EnergyMap & lower_bound,
104  EnergyMap & upper_bound
105  ) const;
106 
107  virtual
108  Size
109  size() const
110  { return 2; }
111 
112  virtual
114  type() const
115  { return dG_binding_correlation; }
116 
117  virtual
118  void
119  write_to_file( std::ofstream & /*outfile*/ ) const
120  {}
121 
122  virtual
123  void
124  read_from_file( std::ifstream & /*infile*/ )
125  {}
126 
127  virtual
128  void
129  write_to_binary_file( std::ofstream & /*outfile*/ ) const
130  {}
131 
132  virtual
133  void
134  read_from_binary_file( std::ifstream & /*infile*/ )
135  {}
136 
137  virtual
138  Size
139  memory_use() const;
140 
141 #ifdef USEMPI
142  virtual
143  void
144  send_to_node( int const destination_node, int const tag ) const;
145 
146  virtual
147  void
148  receive_from_node( int const source_node, int const tag );
149 #endif
150 
151 private:
155 
156 }; // DGBindOptEData
157 
158 
159 } // namespace optimize_weights
160 } // namespace protocols
161 
162 #endif // INCLUDED_protocols_optimize_weights_DGBindOptEData_HH