Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ContactCounts.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/frag_picker/ContactCounts.hh
11 /// @brief Contact counts.
12 /// @author David E. Kim (dekim@u.washington.edu)
13 
14 #ifndef INCLUDED_protocols_frag_picker_ContactCounts_hh
15 #define INCLUDED_protocols_frag_picker_ContactCounts_hh
16 
17 // unit headers
19 
21 
22 #include <utility/pointer/ReferenceCount.hh>
23 
24 #include <string>
25 #include <map>
26 
27 // C++ headers
28 
29 namespace protocols {
30 namespace frag_picker {
31 
33 public:
34 
36 
38 
39  void iterate_neighbor( std::pair<Size,Size> & query_pair, std::pair<Size,Size> & neighbor_pair ) {
40  neighbor_counts_[query_pair][neighbor_pair]++;
41  }
42 
43  void iterate( std::pair<Size,Size> & query_pair ) {
44  counts_[query_pair]++;
45  }
46 
47  std::map<std::pair<Size,Size>, Size> & counts() {
48  return counts_;
49  }
50 
51  bool neighbor_counts_exist( std::pair<Size,Size> & query_pair ) {
52  return (neighbor_counts_.find( query_pair ) != neighbor_counts_.end()) ? true : false;
53  }
54 
55  std::map<std::pair<Size,Size>, Size> & neighbor_counts( std::pair<Size,Size> & query_pair ) {
56  return neighbor_counts_[query_pair];
57  }
58 
59 private:
60  std::map<std::pair<Size,Size>, Size> counts_;
61  std::map<std::pair<Size,Size>, std::map<std::pair<Size,Size>, Size> > neighbor_counts_;
62 };
63 
64 
65 } // namespace frag_picker
66 } // namespace protocols
67 
68 #endif // INCLUDED_protocols_frag_picker_contact_counts_HH