Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PcsTensor.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  //////////////////////////////////////////////
11  /// @begin
12  ///
13  /// @file protocols/scoring/methods/pcs2/PcsTensor.cc
14  ///
15  /// @brief Hold chi-tensor information of PCS
16  ///
17  /// @detailed
18  ///
19  /// @param
20  ///
21  /// @return
22  ///
23  /// @remarks
24  ///
25  /// @references JBNMR 2008 41:179-189 schmitz et all will explains the tensor convention used
26  ///
27  /// @authorsv Christophe Schmitz
28  ///
29  /// @last_modified February 2010
30  ////////////////////////////////////////////////
31 
32 
33 // Unit headers
35 
36 // Package headers
37 
38 // Project headers
39 
40 // Utility headers
41 #include <utility/exit.hh>
42 
43 // Numeric headers
44 
45 // Objexx headers
46 
47 // C++ headers
48 #include <iostream>
49 
50 namespace protocols{
51 namespace scoring{
52 namespace methods{
53 namespace pcs2{
54 
56  utility_exit_with_message( "You shouldn't call the empty constructor for PcsTensor" );
57 }
58 
60 }
61 
63  a_ = other.a_;
64  b_ = other.b_;
65  g_ = other.g_;
66  ax_ = other.ax_;
67  rh_ = other.rh_;
68  chi_xx_ = other.chi_xx_;
69  chi_yy_ = other.chi_yy_;
70  chi_xy_ = other.chi_xy_;
71  chi_xz_ = other.chi_xz_;
72  chi_yz_ = other.chi_yz_;
73  label_ = other.label_;
74 }
75 
76 PcsTensor &
78 
79  if ( this != &other ) {
80  a_ = other.a_;
81  b_ = other.b_;
82  g_ = other.g_;
83  ax_ = other.ax_;
84  rh_ = other.rh_;
85  chi_xx_ = other.chi_xx_;
86  chi_yy_ = other.chi_yy_;
87  chi_xy_ = other.chi_xy_;
88  chi_xz_ = other.chi_xz_;
89  chi_yz_ = other.chi_yz_;
90  label_ = other.label_;
91  }
92  return *this;
93 }
94 
95 ///////////////////////////////////////////////
96 /// @brief The constructeur use the chi matrix parameters (not the alpha beta gamma Ax and Rh component...)
97 ///////////////////////////////////////////////
99  core::Real const chi_xy,
100  core::Real const chi_xz,
101  core::Real const chi_yy,
102  core::Real const chi_yz,
103  std::string const label)
104 {
105  chi_xx_ = chi_xx;
106  chi_yy_ = chi_yy;
107  chi_xy_ = chi_xy;
108  chi_xz_ = chi_xz;
109  chi_yz_ = chi_yz;
110  label_ = label;
111 
112  set_abgar();
113 }
114 
115 void
117  core::Real const chi_xy,
118  core::Real const chi_xz,
119  core::Real const chi_yy,
120  core::Real const chi_yz){
121  chi_xx_ = chi_xx;
122  chi_yy_ = chi_yy;
123  chi_xy_ = chi_xy;
124  chi_xz_ = chi_xz;
125  chi_yz_ = chi_yz;
126 
127  set_abgar();
128 }
129 
130 std::ostream &
131 operator<<(std::ostream& out, const PcsTensor &me ){
132 
133  out << "The tensor parameters of " << "'" <<me.label_ << "' are:" << std::endl;
134  out << "Delta Chi xx: " << me.chi_xx_ << std::endl;
135  out << "Delta Chi yy: " << me.chi_yy_ << std::endl;
136  out << " => Delta Chi zz: " << me.get_chi_zz() << std::endl;
137  out << "Delta Chi xy: " << me.chi_xy_ << std::endl;
138  out << "Delta Chi xz: " << me.chi_xz_ << std::endl;
139  out << "Delta Chi yz: " << me.chi_yz_ << std::endl;
140  /*
141  out << "In the UTR representation: " << std::endl;
142  out << "Alpha: " << me.a_ << std::endl;
143  out << "Beta: " << me.b_ << std::endl;
144  out << "Gamma: " << me.g_ << std::endl;
145  out << "Axial: " << me.ax_ << std::endl;
146  out << "Rhombic: " << me.rh_ << std::endl;
147  out << " => Xxx: " << me.get_delta_X_xx() << std::endl;
148  out << " => Xyy: " << me.get_delta_X_yy() << std::endl;
149  out << " => Xzz: " << me.get_delta_X_zz() << std::endl;
150  */
151 
152  return out;
153 }
154 
155 void
157  a_ = other.a_;
158  b_ = other.b_;
159  g_ = other.g_;
160  ax_ = other.ax_;
161  rh_ = other.rh_;
162 
163  chi_xx_ = other.chi_xx_;
164  chi_yy_ = other.chi_yy_;
165  chi_xy_ = other.chi_xy_;
166  chi_xz_ = other.chi_xz_;
167  chi_yz_ = other.chi_yz_;
168 
169  label_ = other.label_;
170 }
171 
172 void
174  //This has to be updated once I get the translation right
175  //from the chi parameters, i should get the a b g ax rh (abgar) parameters
176  //TODO
177  a_ = 0;
178  b_ = 0;
179  g_ = 0;
180  ax_ = 0;
181  rh_ = 0;
182 }
183 
184 std::string const &
186  return label_;
187 }
188 
191  return(rh_ / 2.0 - ax_ / 3.0);
192 }
193 
196  return(-rh_ / 2.0 - ax_ / 2.0);
197 }
198 
201  return(2.0/3.0 * ax_);
202 }
203 
206  return(-chi_xx_ -chi_yy_);
207 }
208 
209 
212  return(chi_xx_);
213 }
214 
217  return(chi_yy_);
218 }
219 
222  return(chi_xy_);
223 }
224 
227  return(chi_xz_);
228 }
229 
232  return(chi_yz_);
233 }
234 
235 }//namespace pcs2
236 }//namespace methods
237 }//namespace scoring
238 }//namespace protocols