Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
TorsionID_Range.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 // (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/id/TorsionID_Range.hh
11 /// @author Colin A. Smith
12 
13 
14 #ifndef INCLUDED_core_id_TorsionID_Range_hh
15 #define INCLUDED_core_id_TorsionID_Range_hh
16 
17 
18 // Unit headers
20 
21 // Package headers
22 #include <core/id/types.hh>
23 #include <core/id/TorsionID.hh>
24 
25 // Numeric headers
26 //#include <numeric/constants.hh>
27 //#include <numeric/numeric.functions.hh>
28 
29 // Utility headers
30 //#include <utility/exit.hh>
31 
32 // C++ header
33 // AUTO-REMOVED #include <cassert>
34 #include <iostream>
35 
36 
37 namespace core {
38 namespace id {
39 
40 
41 /// @brief Kinematics DOF identifier (with range) class
43 {
44 
45 public: // Creation
46 
48 
50  TorsionID const & torsion_id,
51  Real const & min,
52  Real const & max
53  ):
54  torsion_id_( torsion_id ),
55  min_( min ),
56  max_( max )
57  {};
58 
59 public: // Properties
60 
61  inline
62  TorsionID const &
63  torsion_id() const { return torsion_id_; }
64 
65  inline
66  Real
67  min() const { return min_; }
68 
69  inline
70  Real
71  max() const { return max_; }
72 
73 public: // Friends
74 
75  friend
76  std::ostream &
78  std::ostream & os,
79  TorsionID_Range const & a
80  );
81 
82  friend
83  inline
84  bool
86  TorsionID_Range const & a,
87  TorsionID_Range const & b
88  ) { return a.torsion_id_ == b.torsion_id_ && a.min_ == b.min_ && a.max_ == b.max_; }
89 
90  friend
91  inline
92  bool
94  TorsionID_Range const & a,
95  TorsionID_Range const & b
96  ) { return a.torsion_id_ != b.torsion_id_ || a.min_ != b.min_ || a.max_ != b.max_; }
97 
98  friend
99  inline
100  bool
102  TorsionID_Range const & a,
103  TorsionID_Range const & b
104  )
105  {
106  return ( a.torsion_id_ < b.torsion_id_ ||
107  ( ( a.torsion_id_ == b.torsion_id_ && a.min_ < b.min_ ) ||
108  ( a.min_ == b.min_ && a.max_ < b.max_ ) ) );
109  }
110 
111 private: // Fields
112 
113  /// @brief DOF identifier
115 
116  /// @brief minimum value
118 
119  /// @brief maximum value
121 
122 }; // TorsionID_Range
123 
124 
125 } // namespace id
126 } // namespace core
127 
128 
129 #endif // INCLUDED_core_id_TorsionID_Range_HH