Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SameRotamerComboGrouper.cc
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 // :noTabs=false:tabSize=4:indentSize=4:
4 //
5 // (c) Copyright Rosetta Commons Member Institutions.
6 // (c) This file is part of the Rosetta software suite and is made available under license.
7 // (c) The Rosetta software is developed by the contributing members of the Rosetta Commons.
8 // (c) For more information, see http://www.rosettacommons.org. Questions about this can be
9 // (c) addressed to University of Washington UW TechTransfer, email: license@u.washington.edu.
10 
11 /// @file protocols/match/output/SameRotamerComboGrouper.cc
12 /// @brief
13 /// @author Alex Zanghellini (zanghell@u.washington.edu)
14 /// @author Andrew Leaver-Fay (aleaverfay@gmail.com), porting to mini
15 
16 // Unit headers
18 
19 // Package headers
21 #include <protocols/match/Hit.hh>
22 
23 // Utility headers
24 #include <utility/exit.hh>
25 
26 #include <utility/OrderedTuple.hh>
27 
28 
29 namespace protocols {
30 namespace match {
31 namespace output {
32 
33 SameRotamerComboGrouper::SameRotamerComboGrouper() : n_geometric_constraints_( 0 ) {}
34 SameRotamerComboGrouper::SameRotamerComboGrouper( Size ncst ) : n_geometric_constraints_( ncst ) {}
35 
37 
40  match const & m
41 )
42 {
43  return assign_group_for_match( match_dspos1( m, 1 ) );
44 }
45 
48  match_dspos1 const & m
49 )
50 {
51  runtime_assert( m.upstream_hits.size() == n_geometric_constraints_ );
52 
54  for ( Size ii = 1; ii <= n_geometric_constraints_; ++ii ) {
55  rot_vector[ ii ] = m.upstream_hits[ ii ].scaffold_build_id();
56  rot_vector[ n_geometric_constraints_ + ii ] = m.upstream_hits[ ii ].upstream_conf_id();
57  }
58 
59  RotamerComboCountMap::const_iterator iter = rotamer_combo_indexer_.find( rot_vector );
60  if ( iter == rotamer_combo_indexer_.end() ) {
61  Size next_index = rotamer_combo_indexer_.size() + 1;
62  rotamer_combo_indexer_[ rot_vector ] = next_index;
63  return next_index;
64  } else {
65  return iter->second;
66  }
67 }
68 
69 void
71 {
72  rotamer_combo_indexer_.clear();
73 }
74 
75 void
77 {
78  n_geometric_constraints_ = n_csts;
79 }
80 
81 
82 }
83 }
84 }