Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Constraints.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
11 /// @brief
12 
13 
14 #ifndef INCLUDED_core_scoring_constraints_Constraints_hh
15 #define INCLUDED_core_scoring_constraints_Constraints_hh
16 
17 // Unit headers
19 
20 // Package headers
22 #ifdef WIN32
23 #include <core/scoring/constraints/Constraint.hh> // WIN32 INCLUDE
24 #endif
26 
27 /// Project headers
28 #include <core/types.hh>
33 #include <core/pose/Pose.fwd.hh>
34 #include <core/id/AtomID.fwd.hh>
35 
36 // Utility Headers
37 // AUTO-REMOVED #include <numeric/xyzVector.hh>
38 #include <utility/pointer/ReferenceCount.hh>
39 
40 #include <utility/vector1.hh>
41 
42 
43 // C++ Headers
44 
45 namespace core {
46 namespace scoring {
47 namespace constraints {
48 
50 public:
51  ///@brief Automatically generated virtual destructor for class deriving directly from ReferenceCount
52  virtual ~Constraints();
53  typedef id::AtomID AtomID;
56  typedef ConstraintCOPs::const_iterator const_iterator;
57 
58 public:
59 
60  Constraints();
61  Constraints( Constraints const & );
62  ConstraintsOP clone() const;
63  Constraints const & operator = ( Constraints const & );
64 
65  // call the setup_for_derivatives for each constraint
66  void
67  setup_for_scoring( XYZ_Func const & xyz_func, ScoreFunction const &scfxn ) const;
68 
69  // call the setup_for_derivatives for each constraint
70  void
71  setup_for_derivatives( XYZ_Func const & xyz_func, ScoreFunction const &scfxn ) const;
72 
73  /// will fail if Residues dont contain all the necessary atoms
74  void
76  Residue const & rsd1,
77  Residue const & rsd2,
78  EnergyMap const & weights,
79  EnergyMap & emap
80  ) const;
81 
82  /// will fail if Residue doesnt contain all the necessary atoms
83  void
85  Residue const & rsd,
86  EnergyMap const & weights,
87  EnergyMap & emap
88  ) const;
89 
90  void
92  Conformation const & conformation,
93  EnergyMap const & weights,
94  EnergyMap & emap
95  ) const;
96 
97  /// @brief Evaluate derivatives giving the Constraint objects held within this object
98  /// a single residue. Warning: if this Constraints object contains Constraint objects
99  /// that operate on other residues besides the one being given them, then this function
100  /// will cause the program to exit.
101  void
103  id::AtomID const & atom_id,
104  conformation::Residue const & residue,
105  EnergyMap const & weights,
106  Vector & F1,
107  Vector & F2
108  ) const;
109 
110  /// @brief Evaluate derivatives giving the Constraint objects held within this object
111  /// two residues. Warning: if this Constraints object contains Constraint objects
112  /// that operate on other residues besides the two being given them, then this function
113  /// will cause the program to exit.
114  void
116  id::AtomID const & atom_id,
117  conformation::Residue const & residue1,
118  conformation::Residue const & residue2,
119  EnergyMap const & weights,
120  Vector & F1,
121  Vector & F2
122  ) const;
123 
124  /// @brief Evaluate derivatives giving the Constraint objects held within this object
125  /// the entire Conformation (a whole structure, ws) with which to work.
126  void
128  AtomID const & atom_id,
129  Conformation const & conformation,
130  EnergyMap const & weights,
131  Vector & F1,
132  Vector & F2
133  ) const;
134 
135  ///
136  void
138 
139  /// @brief Returns true iff the constraint was successfully found and removed.
140  bool
142  ConstraintCOP cst,
143  bool object_comparison
144  );
145 
146  const_iterator begin() const;
147  const_iterator end() const;
148 
149  void
150  show( std::ostream& out );
151 
152  void
153  show_definition( std::ostream& out, pose::Pose const& pose ) const;
154 
155  virtual Size
156  show_violations( std::ostream& out, pose::Pose const& pose, Size verbose_level, core::Real threshold = 1 );
157 
158  Size
159  size() const;
160 
161  void
162  clear();
163 
164  ConstraintCOPs const& constraints() const { return constraints_; }
165 
166 private:
167  void
168  energy( XYZ_Func const & xyz_func, EnergyMap const & weights, EnergyMap & emap ) const;
169 
170  // There's no implementation for this method in the .cc file ...
171  //void
172  //add_residue_pair_constraint( Size const pos1, Size const pos2, ConstraintCOP cst );
173 
174  void
175  copy_from( Constraints const & );
176 
177 private:
178 
180 
181 };
182 
183 
184 } // constraints
185 } // scoring
186 } // core
187 
188 #endif