Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
util.tmpl.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/pose/util.hh
11 /// @brief Pose utilities
12 /// @author Phil Bradley
13 /// @author Modified by Sergey Lyskov
14 
15 #ifndef INCLUDED_core_pose_util_TMPL_HH
16 #define INCLUDED_core_pose_util_TMPL_HH
17 
18 // Unit headers
19 #include <core/pose/util.hh>
20 
21 // C/C++ headers
22 #include <map>
23 #include <set>
24 
25 // Utility headers
26 // AUTO-REMOVED #include <basic/datacache/BasicDataCache.hh>
27 #include <numeric/xyzVector.hh>
28 #include <utility/vector1.fwd.hh>
29 
30 // Project headers
31 #include <core/types.hh>
36 #include <core/id/AtomID.fwd.hh>
37 #include <core/id/AtomID_Map.hh>
38 // AUTO-REMOVED #include <core/id/DOF_ID_Map.hh>
42 #include <core/id/TorsionID.fwd.hh>
49 
50 // Package headers
51 #include <core/pose/Pose.hh>
53 
54 #include <utility/vector1.hh>
55 
56 //Auto Headers
57 #include <platform/types.hh>
58 #include <core/chemical/AA.hh>
60 #include <core/chemical/Adduct.hh>
95 #include <core/id/AtomID.hh>
98 #include <core/id/DOF_ID.fwd.hh>
99 #include <core/id/DOF_ID.hh>
100 #include <core/id/DOF_ID_Map.fwd.hh>
102 #include <core/id/types.hh>
109 #include <core/kinematics/Edge.hh>
111 #include <core/kinematics/Jump.hh>
113 #include <core/kinematics/RT.hh>
116 #include <core/kinematics/Stub.hh>
118 #include <core/pose/PDBInfo.fwd.hh>
119 #include <core/pose/Pose.fwd.hh>
130 #include <utility/down_cast.hh>
131 #include <utility/exit.hh>
132 #include <utility/vector0_bool.hh>
133 #include <utility/vector1_bool.hh>
134 #include <utility/vectorL.fwd.hh>
135 #include <utility/vectorL.hh>
136 #include <utility/vectorL_Selector.hh>
137 #include <utility/vectorL_bool.hh>
138 #include <utility/keys/Key2Tuple.fwd.hh>
139 #include <utility/keys/Key2Tuple.hh>
140 #include <utility/keys/Key3Tuple.fwd.hh>
141 #include <utility/keys/Key3Tuple.hh>
142 #include <utility/keys/Key4Tuple.fwd.hh>
143 #include <utility/keys/Key4Tuple.hh>
144 #include <utility/pointer/ReferenceCount.fwd.hh>
145 #include <utility/pointer/ReferenceCount.hh>
146 #include <utility/pointer/access_ptr.fwd.hh>
147 #include <utility/pointer/access_ptr.hh>
148 #include <utility/pointer/owning_ptr.functions.hh>
149 #include <utility/pointer/owning_ptr.fwd.hh>
150 #include <utility/pointer/owning_ptr.hh>
151 #include <utility/signals/BufferedSignalHub.fwd.hh>
152 #include <utility/signals/BufferedSignalHub.hh>
153 #include <utility/signals/Link.fwd.hh>
154 #include <utility/signals/Link.hh>
155 #include <utility/signals/LinkUnit.fwd.hh>
156 #include <utility/signals/LinkUnit.hh>
157 #include <utility/signals/PausableSignalHub.fwd.hh>
158 #include <utility/signals/PausableSignalHub.hh>
159 #include <utility/signals/SignalHub.fwd.hh>
160 #include <utility/signals/SignalHub.hh>
161 #include <numeric/numeric.functions.hh>
162 #include <numeric/sphericalVector.fwd.hh>
163 #include <numeric/trig.functions.hh>
164 #include <numeric/xyz.functions.fwd.hh>
165 #include <numeric/xyzMatrix.fwd.hh>
166 #include <numeric/xyzMatrix.hh>
167 #include <numeric/xyzVector.fwd.hh>
168 #include <numeric/internal/ColPointers.hh>
169 #include <numeric/internal/ColVectors.hh>
170 #include <numeric/internal/ColsPointer.hh>
171 #include <numeric/internal/RowPointers.hh>
172 #include <numeric/internal/RowVectors.hh>
173 #include <numeric/internal/RowsPointer.hh>
174 #include <ObjexxFCL/Dimension.fwd.hh>
175 #include <ObjexxFCL/Dimension.hh>
176 #include <ObjexxFCL/DimensionExpression.hh>
177 #include <ObjexxFCL/DynamicIndexRange.fwd.hh>
178 #include <ObjexxFCL/DynamicIndexRange.hh>
179 #include <ObjexxFCL/FArray.fwd.hh>
180 #include <ObjexxFCL/FArray.hh>
181 #include <ObjexxFCL/FArray1.fwd.hh>
182 #include <ObjexxFCL/FArray1.hh>
183 #include <ObjexxFCL/FArray1D.fwd.hh>
184 #include <ObjexxFCL/FArray1D.hh>
185 #include <ObjexxFCL/FArray2.fwd.hh>
186 #include <ObjexxFCL/FArray2.hh>
187 #include <ObjexxFCL/FArray2D.fwd.hh>
188 #include <ObjexxFCL/FArray2D.hh>
189 #include <ObjexxFCL/FArrayInitializer.fwd.hh>
190 #include <ObjexxFCL/FArrayInitializer.hh>
191 #include <ObjexxFCL/FArraySection.fwd.hh>
192 #include <ObjexxFCL/FArraySection.hh>
193 #include <ObjexxFCL/FArrayTraits.fwd.hh>
194 #include <ObjexxFCL/FArrayTraits.hh>
195 #include <ObjexxFCL/IndexRange.fwd.hh>
196 #include <ObjexxFCL/IndexRange.hh>
197 #include <ObjexxFCL/InitializerSentinel.hh>
198 #include <ObjexxFCL/Observer.fwd.hh>
199 #include <ObjexxFCL/Observer.hh>
200 #include <ObjexxFCL/ObserverMulti.hh>
201 #include <ObjexxFCL/ObserverSingle.hh>
202 #include <ObjexxFCL/ProxySentinel.hh>
203 #include <ObjexxFCL/SetWrapper.fwd.hh>
204 #include <ObjexxFCL/Star.fwd.hh>
205 #include <ObjexxFCL/Star.hh>
206 #include <ObjexxFCL/proxy_const_assert.hh>
207 #include <algorithm>
208 #include <cassert>
209 #include <cmath>
210 #include <cstddef>
211 #include <cstdio>
212 #include <cstdlib>
213 #include <iomanip>
214 #include <iosfwd>
215 #include <iostream>
216 #include <limits>
217 #include <ostream>
218 #include <string>
219 #include <vector>
220 #include <basic/MetricValue.fwd.hh>
221 #include <basic/datacache/BasicDataCache.fwd.hh>
222 #include <boost/bind.hpp>
223 #include <boost/function.hpp>
224 #include <boost/functional/hash.hpp>
225 
226 
227 
228 namespace core {
229 namespace pose {
230 
231 
232 /// @brief Initialize a DOF_ID_Map for a given Pose using the DOF_ID_Map's current default fill values
233 template< typename T >
234 void
236 {
237  Size const n_res( pose.n_residue() );
238  dof_map.clear();
239  dof_map.resize( n_res );
240  for ( Size i = 1; i <= n_res; ++i ) {
241  dof_map.resize( i, pose.residue(i).natoms() );
242  }
243 }
244 
245 
246 /// @brief Initialize a DOF_ID_Map for a given Pose using a specified fill value
247 template< typename T >
248 void
249 initialize_dof_id_map( id::DOF_ID_Map< T > & dof_map, Pose const & pose, T const & value )
250 {
251  Size const n_res( pose.n_residue() );
252  dof_map.clear();
253  dof_map.resize( n_res );
254  for ( Size i = 1; i <= n_res; ++i ) {
255  dof_map.resize( i, pose.residue(i).natoms(), value );
256  }
257 }
258 
259 ///@brief returns a Distance
261 pose_max_nbr_radius( pose::Pose const & pose );
262 
263 /// @brief Initialize an AtomID_Map for a given Pose using the AtomID_Map's current default fill values
264 template< typename T >
265 void
267 {
268  Size const n_res( pose.n_residue() );
269  atom_map.clear();
270  atom_map.resize( n_res );
271  for ( Size i = 1; i <= n_res; ++i ) {
272  atom_map.resize( i, pose.residue_type(i).natoms() );
273  }
274 }
275 
276 
277 /// @brief Initialize an AtomID_Map for a given Pose using a specified fill value
278 template< typename T >
279 void
280 initialize_atomid_map( id::AtomID_Map< T > & atom_map, pose::Pose const & pose, T const & value )
281 {
282  Size const n_res( pose.n_residue() );
283  atom_map.clear();
284  atom_map.resize( n_res );
285  for ( Size i = 1; i <= n_res; ++i ) {
286  atom_map.resize( i, pose.residue_type(i).natoms(), value );
287  }
288 }
289 
290 
291 /// @brief Initialize an AtomID_Map for a given Conformation using the AtomID_Map's current default fill values
292 template< typename T >
293 void
295 {
296  Size const n_res( conformation.size() );
297  atom_map.clear();
298  atom_map.resize( n_res );
299  for ( Size i = 1; i <= n_res; ++i ) {
300  atom_map.resize( i, conformation.residue_type(i).natoms() );
301  }
302 }
303 
304 
305 /// @brief Initialize an AtomID_Map for a given Conformation using a specified fill value
306 template< typename T >
307 void
308 initialize_atomid_map( id::AtomID_Map< T > & atom_map, conformation::Conformation const & conformation, T const & value )
309 {
310  Size const n_res( conformation.size() );
311  atom_map.clear();
312  atom_map.resize( n_res );
313  for ( Size i = 1; i <= n_res; ++i ) {
314  atom_map.resize( i, conformation.residue_type(i).natoms(), value );
315  }
316 }
317 
318 /// @brief Initialize an AtomID_Map for a given Pose using the AtomID_Map's current default fill values
319 template< typename T >
320 void
322 {
323  Size const n_res( pose.n_residue() );
324  atom_map.clear();
325  atom_map.resize( n_res );
326  for ( Size i = 1; i <= n_res; ++i ) {
327  atom_map.resize( i, pose.residue_type(i).nheavyatoms() );
328  }
329 }
330 
331 
332 /// @brief Initialize an AtomID_Map for a given Pose using a specified fill value
333 template< typename T >
334 void
335 initialize_atomid_map_heavy_only( id::AtomID_Map< T > & atom_map, pose::Pose const & pose, T const & value )
336 {
337  Size const n_res( pose.n_residue() );
338  atom_map.clear();
339  atom_map.resize( n_res );
340  for ( Size i = 1; i <= n_res; ++i ) {
341  atom_map.resize( i, pose.residue_type(i).nheavyatoms(), value );
342  }
343 }
344 
345 
346 /// @brief Initialize an AtomID_Map for a given Conformation using the AtomID_Map's current default fill values
347 template< typename T >
348 void
350 {
351  Size const n_res( conformation.size() );
352  atom_map.clear();
353  atom_map.resize( n_res );
354  for ( Size i = 1; i <= n_res; ++i ) {
355  atom_map.resize( i, conformation.residue_type(i).nheavyatoms() );
356  }
357 }
358 
359 
360 /// @brief Initialize an AtomID_Map for a given Conformation using a specified fill value
361 template< typename T >
362 void
363 initialize_atomid_map_heavy_only( id::AtomID_Map< T > & atom_map, conformation::Conformation const & conformation, T const & value )
364 {
365  Size const n_res( conformation.size() );
366  atom_map.clear();
367  atom_map.resize( n_res );
368  for ( Size i = 1; i <= n_res; ++i ) {
369  atom_map.resize( i, conformation.residue_type(i).nheavyatoms(), value );
370  }
371 }
372 } // pose
373 } // core
374 
375 #endif // INCLUDED_core_pose_util_HH