Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
HierarchicalLevel.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 #ifndef INCLUDED_protocols_canonical_sampling_mc_convergence_checks_HierarchicalLevel_hh
11 #define INCLUDED_protocols_canonical_sampling_mc_convergence_checks_HierarchicalLevel_hh
12 
13 #include <core/pose/Pose.hh>
16 #include <core/types.hh>
17 // AUTO-REMOVED #include <core/io/silent/SilentFileData.hh>
19 #include <ObjexxFCL/FArray2D.hh>
20 
21 #include <utility/vector1.hh>
22 #include <list>
23 
24 //Auto Headers
25 namespace protocols {
26 namespace canonical_sampling {
27 namespace mc_convergence_checks {
28 
29 typedef ObjexxFCL::FArray2D<double> FArray2D_double;
31 
32 struct PoolData {
33 public:
34  PoolData();
37 
38  void
39  setup( core::Size nlevels );
40 
44 
45 };
46 
47 
48 class HierarchicalLevel : public Pool_RMSD {
49 
50 public:
51 
53 
54  HierarchicalLevel( core::Size nlevels );
55 
57 
59  filename();
60 
61  // void
62  // union_of_addresses( Address& addr1, Address& addr2, Address& union_addr );
63 
64  void
65  fill_top_level( Pool_RMSD_OP & top_level_pool );
66 
67  void
69 
70  void
72 
73  void
75 
76  void
78 
80  next_level();
81 
83  size();
84 
86  level_size( core::Size level );
87 
89  pool_size( Address & address, core::Size level );
90 
93 
94  Address &
95  address( core::Size index ); //returns address of pool at index
96 
97  void
99 
100  core::Real
101  radius();
102 
103  core::Real
104  level_radius( core::Size level );
105 
106  core::Size
107  level();
108 
109  core::Size
110  nlevels();
111 
112  void
113  max_cache_size( core::Size max_size );
114 
115  core::Size
116  max_cache_size();
117 
118  bool
119  has_next_level();
120 
121  void
122  clear();
123 
124  void
125  add_new( core::pose::Pose const& pose,
126  std::string & tag,
127  Address & address,
128  bool write_to_file,
129  core::Size new_level );
130 
131  void
133  std::string & tag,
134  Address & address,
135  bool write_to_file,
136  core::Size new_level );
137 
138  bool
140  std::string & tag,
141  Address & address);
142 
143  bool
145  std::string & tag,
146  Address & address,
147  bool resolve_remaining_levels );
148 
149  void
151 
152 
153  bool
154  equal_addresses(Address & address1,
155  Address & address2);
156 
157  core::Size
158  evaluate( core::pose::Pose const& pose,
159  std::string & best_decoy,
160  utility::vector1< core::Real > & best_rmsd,
161  Address & address);
162 
163  core::Size
165  std::string & best_decoy,
166  utility::vector1< core::Real > & best_rmsd,
167  Address & address);
168 
169  core::Size
171  std::string & best_decoy,
172  utility::vector1< core::Real > & best_rmsd,
173  Address & address);
174 
175  core::Size
177  std::string & best_decoy,
178  utility::vector1< core::Real > & best_rmsd,
179  Address & address,
180  bool reset_all_levels,
181  bool load_if_missing );
182 
183 
184  /**
185  core::Size
186  evaluate( FArray2D_double&,
187  std::string & best_decoy,
188  core::Real & best_rmsd,
189  Address & best_indices,
190  utility::vector1< Address > & prev_address,
191  utility::vector1< core::Size > & prev_indices );
192  **/
193  /**
194  std::list<PoolData> &
195  get_cache(); //for debugging
196  **/
197  // void
198  // write_headers_to_all_files_in_hierarchy();
199 
201  lib_full_path(Address & address ); //made public for debugging
202 
203  bool
205 
206  bool
207  level_find( Address & address, core::Size const& level, std::list<PoolData>::iterator& );
208 
209  bool
210  pool_exists( Address & address ); //simply checks if appropriate filename exists
211 
212  void
213  round( core::Real& rmsd );
214 
215  void
216  test_round();
217 
218  // Undefined, commenting out to fix PyRosetta build
219  //core::Size
220  //next_free_address( Address& address, core::Size level );
221 
222  void
224 
225  void
227 
228 
229  core::Size
230  first_zero_pos( Address & address );
231 
232 
233 protected:
234 
235 private:
236 
237  void
238  sort_pool( Pool_RMSD_OP& pool_ptr );
239 
240  core::Size
241  find_address( Address& query, utility::vector1< Address >& addresses );
242 
243  void
245 
246  void
248 
249  void
251 
252  bool
253  less_than( Address& addr1, Address& addr2 );
254 
255  void
257 
258 
259  void
260  reset( Address & addr,
262 
263  void
264  print_address( Address & address );
265 
266 
267  core::Size
268  num_matching_levels( Address & address1,
269  Address & address2 );
270 
271  void
272  add_elem_to_cache( FArray2D_double & coords, std::string & tag, Address & input_addr );
273 
274  std::list<PoolData>::iterator
275  find(Address & address);
276 
277  PoolData
278  load_pool( Address & address );
279 
280 
281  /**
282  std::string
283  lib_full_path(std::string tag_origin );
284  **/
285 
286  std::list<PoolData> pool_cache_;
295 
297 };
298 
299 }
300 }
301 }
302 
303 #endif //INCLUDED_protocols_canonical_sampling_mc_convergence_check_HierarchicalLevel_HH