Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
BranchParam1.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 protocols/branch_angle/BranchParam1.hh
11 /// @brief definition/implementation of BranchParam1 class and methods
12 /// @author Colin A. Smith (colin.smith@ucsf.edu)
13 
14 
15 #ifndef INCLUDED_protocols_branch_angle_BranchParam1_hh
16 #define INCLUDED_protocols_branch_angle_BranchParam1_hh
17 
19 
20 // Core Headers
21 #include <core/types.hh>
22 
23 namespace protocols {
24 namespace branch_angle {
25 
26 /// @brief
27 /// a class to store bond angle energy parameters around a single atom atom with three bonded neighbors
28 class BranchParam1 {
29 
30 public:
31 
39  core::Real tolerance = 0
40  ):
41  m1_m2_Ktheta_(m1_m2_Ktheta),
42  m1_m2_theta0_(m1_m2_theta0),
43  m1_b1_Ktheta_(m1_b1_Ktheta),
44  m1_b1_theta0_(m1_b1_theta0),
45  m2_b1_Ktheta_(m2_b1_Ktheta),
46  m2_b1_theta0_(m2_b1_theta0),
47  tolerance_(tolerance)
48  {}
49 
50  /// @brief get Ktheta for mainchain atom 1 - mainchain atom 1 angle
52  m1_m2_Ktheta() const
53  {
54  return m1_m2_Ktheta_;
55  }
56 
57  /// @brief get theta0 for mainchain atom 1 - mainchain atom 1 angle
59  m1_m2_theta0() const
60  {
61  return m1_m2_theta0_;
62  }
63 
64  /// @brief get Ktheta for mainchain atom 1 - branching atom 1 angle
66  m1_b1_Ktheta() const
67  {
68  return m1_b1_Ktheta_;
69  }
70 
71  /// @brief get theta0 for mainchain atom 1 - branching atom 1 angle
73  m1_b1_theta0() const
74  {
75  return m1_b1_theta0_;
76  }
77 
78  /// @brief get Ktheta for mainchain atom 2 - branching atom 1 angle
80  m2_b1_Ktheta() const
81  {
82  return m2_b1_Ktheta_;
83  }
84 
85  /// @brief get theta0 for mainchain atom 2 - branching atom 1 angle
87  m2_b1_theta0() const
88  {
89  return m2_b1_theta0_;
90  }
91 
92  /// @brief a is LOWER than b by a given tolerance
93  friend
94  inline
95  bool
97  BranchParam1 const & a,
98  BranchParam1 const & b
99  )
100  {
101  core::Real const tolerance(a.tolerance_ < b.tolerance_ ? a.tolerance_ : b.tolerance_);
102 
103  core::Real const m1_m2_Ktheta_diff(a.m1_m2_Ktheta_ - b.m1_m2_Ktheta_);
104  if (m1_m2_Ktheta_diff < -tolerance) return true;
105  if (m1_m2_Ktheta_diff > tolerance) return false;
106  // within tolerance: proceed to checking the next number
107 
108  core::Real const m1_m2_theta0_diff(a.m1_m2_theta0_ - b.m1_m2_theta0_);
109  if (m1_m2_theta0_diff < -tolerance) return true;
110  if (m1_m2_theta0_diff > tolerance) return false;
111  // within tolerance: proceed to checking the next number
112 
113  core::Real const m1_b1_Ktheta_diff(a.m1_b1_Ktheta_ - b.m1_b1_Ktheta_);
114  if (m1_b1_Ktheta_diff < -tolerance) return true;
115  if (m1_b1_Ktheta_diff > tolerance) return false;
116  // within tolerance: proceed to checking the next number
117 
118  core::Real const m1_b1_theta0_diff(a.m1_b1_theta0_ - b.m1_b1_theta0_);
119  if (m1_b1_theta0_diff < -tolerance) return true;
120  if (m1_b1_theta0_diff > tolerance) return false;
121  // within tolerance: proceed to checking the next number
122 
123  core::Real const m2_b1_Ktheta_diff(a.m2_b1_Ktheta_ - b.m2_b1_Ktheta_);
124  if (m2_b1_Ktheta_diff < -tolerance) return true;
125  if (m2_b1_Ktheta_diff > tolerance) return false;
126  // within tolerance: proceed to checking the next number
127 
128  core::Real const m2_b1_theta0_diff(a.m2_b1_theta0_ - b.m2_b1_theta0_);
129  if (m2_b1_theta0_diff < -tolerance) return true;
130  // either greater than or within tolarance
131  return false;
132  }
133 
134 protected:
135 
142 
144 };
145 
146 } // branch_angle
147 } // protocols
148 
149 #endif