Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SquareWellFunc.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 src/core/scoring/constraints/SquareWellFunc.hh
11 /// @brief Definition for functions used in definition of constraints.
12 /// @author Rhiju Das
13 
14 
16 
17 #include <core/types.hh>
18 
19 #include <utility/pointer/ReferenceCount.hh>
20 
21 // AUTO-REMOVED #include <ObjexxFCL/format.hh>
22 // AUTO-REMOVED #include <basic/Tracer.hh>
23 
24 #include <utility/vector1.hh>
25 #include <sstream>
26 
27 
28 // C++ Headers
29 
30 
31 namespace core {
32 namespace scoring {
33 namespace constraints {
34 
35 Real
36 SquareWellFunc::func( Real const x ) const
37 {
38  if ( x < x0_ ) {
39  return well_depth_;
40  }
41  return 0.0;
42 }
43 
44 Real
45 SquareWellFunc::dfunc( Real const /*x*/ ) const
46 {
47  return 0.0; //This is bad news for the minimizer...
48 }
49 
50 void
51 SquareWellFunc::read_data( std::istream& in ) {
52  in >> x0_ >> well_depth_;
53 }
54 
55 void
56 SquareWellFunc::show_definition( std::ostream &out ) const {
57  out << "SQUARE_WELL " << x0_ << " " << well_depth_ << std::endl;
58 }
59 
60 Size
61 SquareWellFunc::show_violations( std::ostream& out, Real x, Size verbose_level, Real threshold) const {
62  if (verbose_level > 100 ) {
63  out << "SQUARE_WELL " << ( x < x0_ ) << std::endl;
64  }
65  return Func::show_violations( out, x, verbose_level, threshold);
66 }
67 
68 
69 } // namespace constraints
70 } // namespace scoring
71 } // namespace core
72