Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
DOF_Constraint.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_DOF_Constraint_hh
15 #define INCLUDED_core_scoring_constraints_DOF_Constraint_hh
16 
17 // Unit header
21 #include <core/id/DOF_ID.hh>
22 
23 //Utility Headers
24 #include <utility/pointer/ReferenceCount.hh>
25 #include <utility/exit.hh>
26 
27 #include <utility/vector1.hh>
28 
29 
30 // C++ Headers
31 
32 namespace core {
33 namespace scoring {
34 namespace constraints {
35 
36 
37 
38 /// @brief This isn't quite a standard constraint since it acts on DOF's directly
39 /// rather than on XYZ coordinates.
40 /// @details All DOF_Constraints are expected to be immutable once created,
41 /// meaning their internal data (state) should not change over their lifetime.
42 /// This allows DOF_Constraints to be shared between copies of Poses (e.g. in Monte Carlo),
43 /// and is important for both speed (with thousands of contraints) and correctness.
44 ///
45 /// To "change" a constraint, remove the old one and add a new and different one.
46 /// The clone() and steal() methods have been removed because they are
47 /// unneccessary and incompatible (respectively) with the idea of immutable constraints.
49 
50 public:
52  dof_id_( id ),
53  func_( func),
54  score_type_(t) {}
55 
56  /// @brief Returns the ScoreType
57  id::DOF_ID const &
58  dof_id() const
59  {
60  return dof_id_;
61  }
62 
63  /// @brief Returns the ScoreType
64  ScoreType const &
65  score_type() const
66  {
67  return score_type_;
68  }
69 
70  /// @brief Returns the Function
71  Real
72  func( Real const val ) const
73  {
74  return func_->func( val );
75  }
76 
77  /// @brief Returns the Function Derivative
78  Real
79  dfunc( Real const val ) const
80  {
81  return func_->dfunc( val );
82  }
83 
84 
85  virtual
87 
88  virtual void show( std::ostream& out ) const {
89  out << "DOF_Constraint::show stubbed out!" << std::endl;
90  }
91 
92 private:
93 
97 
98 };
99 
100 
101 } // constraints
102 } // scoring
103 } // core
104 
105 #endif