Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SymDof.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 // This file is made available under the Rosetta Commons license.
5 // See http://www.rosettacommons.org/license
6 // (C) 199x-2007 University of Washington
7 // (C) 199x-2007 University of California Santa Cruz
8 // (C) 199x-2007 University of California San Francisco
9 // (C) 199x-2007 Johns Hopkins University
10 // (C) 199x-2007 University of North Carolina, Chapel Hill
11 // (C) 199x-2007 Vanderbilt University
12 
13 /// @brief SymDof data container
14 /// @file core/conformation/symmetry/SymDof.hh
15 /// @author Ingemar Andre
16 
17 
18 #ifndef INCLUDED_core_conformation_symmetry_SymDof_hh
19 #define INCLUDED_core_conformation_symmetry_SymDof_hh
20 
21 // Utility headers
23 // AUTO-REMOVED #include <utility/vector1.hh>
24 #include <core/types.hh>
25 
26 // C++ headers
27 // AUTO-REMOVED #include <string>
28 
29 #include <utility/vector1_bool.hh>
30 
31 
32 namespace core {
33 namespace conformation {
34 namespace symmetry {
35 
36 // Available dofs
37 enum dof_type {
38  X_DOF = 1,
44 };
45 
46 class SymDof {
47 
48  public:
49 
50  /// @brief constructor
51  SymDof();
52 
53  /// @brief copy constructor
54  SymDof( SymDof const & src );
55 
56  SymDof &
57  operator=( SymDof const & src );
58 
59  ~SymDof();
60 
61  void
63 
64  // io
65  void read( std::string dof_line);
66  friend std::ostream & operator<< ( std::ostream & s, const SymDof & dof );
67 
68  // @details is df allowed to move?
69  bool
70  allow_dof( int df ) const;
71 
72  bool has_dof();
73 
74  // @details the lower boundary of range1
76  range1_lower( int df ) const;
77 
78  // @details the upper boundary of range1
80  range1_upper( int df ) const;
81 
82  // @details the lower boundary of range2
84  range2_lower( int df ) const;
85 
86  // @details the upper boundary of range1
88  range2_upper( int df ) const;
89 
90  // details Have a range1 been specified?
91  bool
92  has_range1( int df ) const;
93 
94  // details Have a range2 been specified?
95  bool
96  has_range2( int df ) const;
97 
98  // @details has a lower boundary of range1 been specified?
99  bool
100  has_range1_lower( int df ) const;
101 
102  // @details has a upper boundary of range1 been specified?
103  bool
104  has_range1_upper( int df ) const;
105 
106  // @details has a lower boundary of range2 been specified?
107  bool
108  has_range2_lower( int df ) const;
109 
110  // @details has a upper boundary of range2 been specified?
111  bool
112  has_range2_upper( int df ) const;
113 
114  // @detail return the direction( upstream or downstream )
115  // of the jump for a dof
116  int
117  jump_direction( int df ) const;
118 
119  friend
120  bool
121  operator==(SymDof const & a, SymDof const & b);
122 
123  friend
124  bool
125  operator!=(SymDof const & a, SymDof const & b);
126 
127  private:
128 
129 #ifdef USEBOOSTSERIALIZE
130  friend class boost::serialization::access;
131 
132  template<class Archive>
133  void serialize(Archive & ar, const unsigned int version){
134  ar & allowed_dof_jumps_;
139  ar & has_range1_lower_;
140  ar & has_range1_upper_;
141  ar & has_range2_lower_;
142  ar & has_range2_upper_;
143  ar & jump_dir_;
144  }
145 #endif
146 
147  utility::vector1< bool > allowed_dof_jumps_; // is a particular dof allowed to move?
148  utility::vector1< Real > lower_range_dof_jumps1_; // store the lower boundary of range1
149  utility::vector1< Real > upper_range_dof_jumps1_; // store the upper boundary of range1
150  utility::vector1< Real > lower_range_dof_jumps2_; // store the lower boundary of range2
151  utility::vector1< Real > upper_range_dof_jumps2_; // store the upper boundary of range2
152  utility::vector1< bool > has_range1_lower_; // Is there a lower bound on range1?
153  utility::vector1< bool > has_range1_upper_; // Is there a upper bound on range1?
154  utility::vector1< bool > has_range2_lower_; // Is there a lower bound on range2?
155  utility::vector1< bool > has_range2_upper_; // Is there a upper bound on range2?
156  utility::vector1< int > jump_dir_; // store jump dir for each dof
157 
158 };
159 
160 } // symmetry
161 } // conformation
162 } // core
163 #endif