Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
BranchParam2.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/BranchParam2.hh
11 /// @brief definition/implementation of BranchParam2 class and methods
12 /// @author Colin A. Smith (colin.smith@ucsf.edu)
13 
14 
15 #ifndef INCLUDED_protocols_branch_angle_BranchParam2_hh
16 #define INCLUDED_protocols_branch_angle_BranchParam2_hh
17 
19 
20 // Protocols Headers
22 
23 // Core Headers
24 #include <core/types.hh>
25 
26 namespace protocols {
27 namespace branch_angle {
28 
29 /// @brief
30 /// a class to store bond angle energy parameters around a single atom atom with four bonded neighbors
31 class BranchParam2 : public BranchParam1 {
32 
33 public:
34 
48  core::Real tolerance = 0
49  ):
51  m1_m2_Ktheta,
52  m1_m2_theta0,
53  m1_b1_Ktheta,
54  m1_b1_theta0,
55  m2_b1_Ktheta,
56  m2_b1_theta0,
57  tolerance
58  ),
59  m1_b2_Ktheta_(m1_b2_Ktheta),
60  m1_b2_theta0_(m1_b2_theta0),
61  m2_b2_Ktheta_(m2_b2_Ktheta),
62  m2_b2_theta0_(m2_b2_theta0),
63  b1_b2_Ktheta_(b1_b2_Ktheta),
64  b1_b2_theta0_(b1_b2_theta0)
65  {}
66 
67  /// @brief get Ktheta for mainchain atom 1 - branching atom 2 angle
69  m1_b2_Ktheta() const
70  {
71  return m1_b2_Ktheta_;
72  }
73 
74  /// @brief get theta0 for mainchain atom 1 - branching atom 2 angle
76  m1_b2_theta0() const
77  {
78  return m1_b2_theta0_;
79  }
80 
81  /// @brief get Ktheta for mainchain atom 2 - branching atom 2 angle
83  m2_b2_Ktheta() const
84  {
85  return m2_b2_Ktheta_;
86  }
87 
88  /// @brief get theta0 for mainchain atom 2 - branching atom 2 angle
90  m2_b2_theta0() const
91  {
92  return m2_b2_theta0_;
93  }
94 
95  /// @brief get Ktheta for branching atom 1 - branching atom 2 angle
97  b1_b2_Ktheta() const
98  {
99  return b1_b2_Ktheta_;
100  }
101 
102  /// @brief get theta0 for branching atom 1 - branching atom 2 angle
103  core::Real
104  b1_b2_theta0() const
105  {
106  return b1_b2_theta0_;
107  }
108 
109  /// @brief a is LOWER than b by a given tolerance
110  friend
111  inline
112  bool
114  BranchParam2 const & a,
115  BranchParam2 const & b
116  )
117  {
118  core::Real const tolerance(a.tolerance_ < b.tolerance_ ? a.tolerance_ : b.tolerance_);
119 
120  core::Real const m1_m2_Ktheta_diff(a.m1_m2_Ktheta_ - b.m1_m2_Ktheta_);
121  if (m1_m2_Ktheta_diff < -tolerance) return true;
122  if (m1_m2_Ktheta_diff > tolerance) return false;
123  // within tolerance: proceed to checking the next number
124 
125  core::Real const m1_m2_theta0_diff(a.m1_m2_theta0_ - b.m1_m2_theta0_);
126  if (m1_m2_theta0_diff < -tolerance) return true;
127  if (m1_m2_theta0_diff > tolerance) return false;
128  // within tolerance: proceed to checking the next number
129 
130  core::Real const m1_b1_Ktheta_diff(a.m1_b1_Ktheta_ - b.m1_b1_Ktheta_);
131  if (m1_b1_Ktheta_diff < -tolerance) return true;
132  if (m1_b1_Ktheta_diff > tolerance) return false;
133  // within tolerance: proceed to checking the next number
134 
135  core::Real const m1_b1_theta0_diff(a.m1_b1_theta0_ - b.m1_b1_theta0_);
136  if (m1_b1_theta0_diff < -tolerance) return true;
137  if (m1_b1_theta0_diff > tolerance) return false;
138  // within tolerance: proceed to checking the next number
139 
140  core::Real const m2_b1_Ktheta_diff(a.m2_b1_Ktheta_ - b.m2_b1_Ktheta_);
141  if (m2_b1_Ktheta_diff < -tolerance) return true;
142  if (m2_b1_Ktheta_diff > tolerance) return false;
143  // within tolerance: proceed to checking the next number
144 
145  core::Real const m2_b1_theta0_diff(a.m2_b1_theta0_ - b.m2_b1_theta0_);
146  if (m2_b1_theta0_diff < -tolerance) return true;
147  if (m2_b1_theta0_diff > tolerance) return false;
148  // either greater than or withing tolarance
149 
150 
151  core::Real const m1_b2_Ktheta_diff(a.m1_b2_Ktheta_ - b.m1_b2_Ktheta_);
152  if (m1_b2_Ktheta_diff < -tolerance) return true;
153  if (m1_b2_Ktheta_diff > tolerance) return false;
154  // within tolerance: proceed to checking the next number
155 
156  core::Real const m1_b2_theta0_diff(a.m1_b2_theta0_ - b.m1_b2_theta0_);
157  if (m1_b2_theta0_diff < -tolerance) return true;
158  if (m1_b2_theta0_diff > tolerance) return false;
159  // within tolerance: proceed to checking the next number
160 
161  core::Real const m2_b2_Ktheta_diff(a.m2_b2_Ktheta_ - b.m2_b2_Ktheta_);
162  if (m2_b2_Ktheta_diff < -tolerance) return true;
163  if (m2_b2_Ktheta_diff > tolerance) return false;
164  // within tolerance: proceed to checking the next number
165 
166  core::Real const m2_b2_theta0_diff(a.m2_b2_theta0_ - b.m2_b2_theta0_);
167  if (m2_b2_theta0_diff < -tolerance) return true;
168  if (m2_b2_theta0_diff > tolerance) return false;
169  // within tolerance: proceed to checking the next number
170 
171  core::Real const b1_b2_Ktheta_diff(a.b1_b2_Ktheta_ - b.b1_b2_Ktheta_);
172  if (b1_b2_Ktheta_diff < -tolerance) return true;
173  if (b1_b2_Ktheta_diff > tolerance) return false;
174  // within tolerance: proceed to checking the next number
175 
176  core::Real const b1_b2_theta0_diff(a.b1_b2_theta0_ - b.b1_b2_theta0_);
177  if (b1_b2_theta0_diff < -tolerance) return true;
178  // either greater than or within tolarance
179  return false;
180  }
181 
182 protected:
183 
190 };
191 
192 } // branch_angle
193 } // protocols
194 
195 #endif