Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ConstantConstraint.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 /// @file core/scoring/constraints/ConstantConstraint.cc
11 
12 #include <core/types.hh>
15 // AUTO-REMOVED #include <core/scoring/constraints/XYZ_Func.hh>
18 
19 #include <core/id/AtomID.hh>
20 
21 #include <utility/vector1.hh>
22 
23 
24 namespace core {
25 namespace scoring {
26 namespace constraints {
27 
28 /// @brief compute score
29 Real
31  return func_->func(0);
32 }
33 
35  return "Constant";
36 }
37 
38 /// @brief compute score
39 void
40 ConstantConstraint::score( XYZ_Func const &, EnergyMap const &, EnergyMap & emap ) const
41 {
42  emap[ this->score_type() ] += score();
43 }
44 
45 /// @brief compute atom deriv
46 void
48  AtomID const & ,
49  XYZ_Func const &,
50  Vector & /*F1*/,
51  Vector & /*F2*/,
52  EnergyMap const &
53 ) const {}
54 
55 /// @brief Constructor
57  FuncOP func_in, // we take ownership of this guy
58  ScoreType scotype
59 ):
60  Constraint( scotype ),
61  func_( func_in )
62 {}
63 
65 
66 /// @brief number of atoms --- zero
67 Size
69 {
70  return 0;
71 }
72 
73 id::AtomID const &
74 ConstantConstraint::atom( core::Size const /*n*/ ) const {
75  utility_exit_with_message( "ConstantConstraint::atom() - no atoms exist" );
76  return *(new AtomID); // never happens
77 }
78 
79 /// @brief output violation of constraint (none!)
80 Size ConstantConstraint::show_violations( std::ostream &, pose::Pose const &, Size, Real ) const {
81  return 0;
82 }
83 
84 void ConstantConstraint::show( std::ostream& out ) const {
85  out << "ConstantConstraint" << std::endl;
86  func_->show( out );
87 }
88 
89 } // constraints
90 } // scoring
91 } // core