Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
MultiConstraint.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/scoring/constraints/MultiConstraint.hh
11 /// @brief contains declarations for a type of constraint that holds multiple
12 /// other constrains that belong to each other and are all evaluate at once
13 /// @author Florian Richter (floric@u.washington.edu, march 2008)
14 
15 
16 #ifndef INCLUDED_core_scoring_constraints_MultiConstraint_hh
17 #define INCLUDED_core_scoring_constraints_MultiConstraint_hh
18 
20 
21 // Unit header
23 
24 // AUTO-REMOVED #include <core/scoring/constraints/XYZ_Func.hh>
26 
27 #include <core/id/AtomID.hh>
33 #include <core/pose/Pose.fwd.hh>
34 #include <numeric/random/random.fwd.hh>
36 //Utility Headers
37 #include <numeric/xyzVector.fwd.hh>
38 
39 // STL Headers
40 #include <map>
41 
42 #include <utility/vector1.hh>
43 
44 
45 namespace core {
46 namespace scoring {
47 namespace constraints {
48 
49 
50 class MultiConstraint : public Constraint {
51 public:
52 
53  /// @brief default Constructor
55  Constraint( t ),
57  {}
58 
59  /// @brief Constructor
60  MultiConstraint( const ConstraintCOPs & cst_in, ScoreType const & t = dof_constraint );
61 
62  ///
63  virtual
64  ConstraintOP clone() const {
65  if ( member_constraints_.size() > 0 ) {
67  } else {
68  return new MultiConstraint();
69  }
70  }
71 
72  virtual
74  return new MultiConstraint;
75  }
76 
77  /// @brief number of atoms involved in this MultiConstraint container
78  Size natoms() const
79  {
80  return member_atoms_.size();
81  }
82  /// @brief number of constraints data
83  Size size() const { return member_constraints_.size(); }
84 
85  virtual std::string type() const {
86  return "MultiConstraint";
87  }
88 
89  /// @brief read in constraint defiinition
90  virtual
91  void read_def( std::istream& data, pose::Pose const& pose, FuncFactory const& func_factory );
92 
93  /// @brief possibility to compare constraint according to data
94  /// and not just pointers
95  virtual
96  bool operator == ( Constraint const & other ) const;
97 
98  /// @brief compute score
99  virtual
100  void
101  score( XYZ_Func const & xyz_func, EnergyMap const & weights, EnergyMap & emap ) const;
102 
103  virtual
104  AtomID const & atom( Size const n ) const{
105  assert( n <= member_atoms_.size() );
106  return member_atoms_[n];
107  }
108 
109  virtual
111  residues() const { return member_residues_; }
112 
113  //@brief translates the atom-names into numbers
114  virtual void setup_for_scoring( XYZ_Func const &, ScoreFunction const & ) const;
115 
116  ///@brief add individual constraint into MultiConstraint
117  virtual
118  void
120 
121  virtual
123  remap_resid( core::id::SequenceMapping const &seqmap ) const;
124 
125  /// @brief compute atom deriv
126  virtual
127  void
128  fill_f1_f2(
129  AtomID const & atom,
130  XYZ_Func const & xyz,
131  Vector & F1,
132  Vector & F2,
133  EnergyMap const & weights
134  ) const;
135 
136  virtual
137  void show( std::ostream& out ) const;
138 
139  virtual
140  void show_def( std::ostream& out, pose::Pose const& pose ) const;
141 
142  virtual
143  Size show_violations( std::ostream & out, pose::Pose const & pose, Size verbose_level, Real threshold = 1.0 ) const;
144 
145  ConstraintCOPs const &
147  return member_constraints_;
148  }
149 
151  pose::Pose const& /*src*/,
152  pose::Pose const& /*dest*/,
153  id::SequenceMappingCOP map=NULL ) const;
154 
157  }
158 
159  virtual
160  core::Size choose_effective_sequence_separation( core::kinematics::ShortestPathInFoldTree const& sp, numeric::random::RandomGenerator& );
161 
162  virtual
165  }
166 
167 protected:
168 
169  //vector that holds the constraints
171 
172 private:
173 
174  //data structure that holds the atoms and atom numbers
177  std::map< AtomID, ConstraintCOPs > AtomID_to_Csts_;
178 
179  //
181 
182 }; //MultiConstraint
183 
184 } //constraints
185 } //scoring
186 } //core
187 
188 #endif