Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
StepWiseProteinJumpSampleGenerator.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 StepWiseProteinJumpSampleGenerator
11 /// @brief Subclass of StepWisePoseSampleGenerator
12 /// @detailed
13 /// @author Rhiju Das
14 
15 
16 //////////////////////////////////
19 #include <core/types.hh>
20 #include <core/kinematics/Jump.hh>
21 #include <core/pose/Pose.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  StepWiseProteinJumpSampleGenerator::StepWiseProteinJumpSampleGenerator(
35  Size const which_jump,
37  {
38  initialize( which_jump, jumps );
39  reset();
40  }
41 
42  //////////////////////////////////////////////////////////////////////////
43  void
44  StepWiseProteinJumpSampleGenerator::initialize(
45  Size const which_jump,
47  which_jump_ = which_jump;
48  jumps_ = jumps;
49  num_samples_ = jumps_.size();
50  count_ = 0;
51  }
52 
53  //////////////////////////////////////////////////////////////////////////
54  void
55  StepWiseProteinJumpSampleGenerator::reset(){
56  count_ = 0;
57  }
58 
59  //////////////////////////////////////////////////////////////////////////
60  bool
61  StepWiseProteinJumpSampleGenerator::has_another_sample(){
62  return (count_ < num_samples_);
63  }
64 
65  //////////////////////////////////////////////////////////////////////////
66  void
67  StepWiseProteinJumpSampleGenerator::get_next_sample( core::pose::Pose & pose )
68  {
69 
70  count_++;
71 
72  if ( count_ > num_samples_ ) utility_exit_with_message( "Asked StepWiseProteinJumpSampleGenerator for another sample but it does not have one!" );
73 
74  if ( which_jump_ > 0 ) pose.set_jump( which_jump_, jumps_[ count_ ] );
75 
76  }
77 
78  ///////////////////////////////////////////////////////
79  Size
81  return num_samples_;
82  }
83 
84 
85 }
86 }
87 }