Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SidechainStateAssignment.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 //
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 core/pack/scmin/SidechainStateAssignment.hh
11 /// @brief
12 /// @author Andrew Leaver-Fay (aleaverfay@gmail.com)
13 
14 // Unit Headers
16 
17 // Package Headers
19 
20 // AUTO-REMOVED #include <core/conformation/Residue.hh> // REQUIRED FOR WINDOWS
21 
23 #include <utility/vector1.hh>
24 
25 
26 namespace core {
27 namespace pack {
28 namespace scmin {
29 
31  nmoltenres_( nmoltenres ),
32  state_assignments_( nmoltenres ),
33  original_rotamer_id_( nmoltenres, 0 ),
34  energy_( 0.0 ),
35  n_unassigned_( nmoltenres )
36 {}
37 
39  nmoltenres_( src.nmoltenres_ ),
40  state_assignments_( src.state_assignments_ ),
41  original_rotamer_id_( src.original_rotamer_id_ ),
42  energy_( src.energy_ ),
43  n_unassigned_( src.n_unassigned_ )
44 {}
45 
48 {
49  if ( this != &rhs ) {
53  energy_ = rhs.energy_;
55  }
56  return *this;
57 }
58 
61 {
62  return state_assignments_[ moltenresid ];
63 }
64 
65 void
67  Size moltenresid,
68  Size orig_rotid
69 )
70 {
71  assert( orig_rotid != 0 );
72  if ( original_rotamer_id_[ moltenresid ] == 0 ) {
73  assert( n_unassigned_ > 0 );
74  --n_unassigned_;
75  }
76  original_rotamer_id_[ moltenresid ] = orig_rotid;
77 }
78 
80 
83 {
84  return state_assignments_[ moltenresid ];
85 }
86 
87 
88 Size
90 {
91  return original_rotamer_id_[ moltenres ];
92 }
93 
94 bool
96 {
97  return n_unassigned_ != 0;
98 }
99 
100 } // namespace scmin
101 } // namespace pack
102 } // namespace core
103