Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
StepWiseProteinMainChainSampleGenerator.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 StepWiseProteinMainChainSampleGenerator
11 /// @brief Subclass of StepWisePoseSampleGenerator
12 /// @detailed
13 /// @author Rhiju Das
14 
15 
16 //////////////////////////////////
18 #include <core/id/TorsionID.hh>
19 #include <core/types.hh>
20 #include <core/pose/Pose.hh>
21 #include <utility/exit.hh>
22 
23 //Auto Headers
24 #include <utility/vector1.hh>
25 
26 using namespace core;
27 
28 namespace protocols {
29 namespace swa {
30 namespace protein {
31 
32  //////////////////////////////////////////////////////////////////////////
33  //constructor!
34  StepWiseProteinMainChainSampleGenerator::StepWiseProteinMainChainSampleGenerator(
35  utility::vector1< core::id::TorsionID > const & which_torsions,
36  utility::vector1< utility::vector1< core::Real > > const & main_chain_torsion_set_lists ):
37  which_torsions_( which_torsions ),
38  main_chain_torsion_set_lists_( main_chain_torsion_set_lists ),
39  count_( 0 ),
40  num_samples_( main_chain_torsion_set_lists_.size() )
41  {
42  }
43 
44  //////////////////////////////////////////////////////////////////////////
45  void
47  count_ = 0;
48  }
49 
50  //////////////////////////////////////////////////////////////////////////
51  bool
53  return (count_ < num_samples_);
54  }
55 
56  //////////////////////////////////////////////////////////////////////////
57  void
59  {
60 
61  count_++;
62 
63  if ( count_ > num_samples_ ) utility_exit_with_message( "Asked StepWiseProteinMainChainSampleGenerator for another sample but it does not have one!" );
64 
65  utility::vector1< Real > const & main_chain_torsion_set_list( main_chain_torsion_set_lists_[ count_ ] );
66 
67  for ( Size i = 1; i <= which_torsions_.size(); i++ ) {
68  //std::cout << "SETTING TORSION " << which_torsions_[ i ] << " to " << main_chain_torsion_set_list[ i ] << std::endl;
69  pose.set_torsion( which_torsions_[ i ], main_chain_torsion_set_list[ i ] );
70  }
71 
72  }
73 
74  ///////////////////////////////////////////////////////
75  Size
77  return num_samples_;
78  }
79 
80 
81 }
82 }
83 }