Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
LinearPenaltyFunction.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 src/core/scoring/constraints/LinearPenaltyFunction.hh
11 /// @brief Linear penalty for values outside a certain range
12 /// @author Dominik Gront
13 
14 #ifndef INCLUDED_core_scoring_constraints_LinearPenaltyFunction_hh
15 #define INCLUDED_core_scoring_constraints_LinearPenaltyFunction_hh
16 
18 
19 #include <core/types.hh>
20 
21 // #include <utility/pointer/ReferenceCount.hh>
22 
23 // #include <ObjexxFCL/format.hh>
24 // #include <basic/Tracer.hh>
25 
26 namespace core {
27 namespace scoring {
28 namespace constraints {
29 
30 class LinearPenaltyFunction : public Func {
31 public:
32  LinearPenaltyFunction( Real const x_middle, Real const well_depth, Real const half_width, Real const slope ):
33  x_middle_( x_middle ), well_depth_( well_depth ), half_width_ ( half_width ), slope_ ( slope ) {}
34 
35  FuncOP
36  clone() const { return new LinearPenaltyFunction( *this ); }
37 
38  Real func( Real const x ) const;
39  Real dfunc( Real const x ) const;
40 
41  void read_data( std::istream& in );
42 
43  void show_definition( std::ostream &out ) const;
44 
45  Real get_x_middle() const { return x_middle_; }
46  Real get_well_depth() const { return well_depth_; }
47  Real get_half_width() const { return half_width_; }
48  Real get_slope() const { return slope_; }
49  void set_x_middle( Real x ) { x_middle_ = x; }
50  void set_well_depth( Real well_depth ){ well_depth_ = well_depth;}
51  void set_half_width(Real half_width) { half_width_ = half_width;}
52  void set_slope(Real slope) { slope_ = slope; }
53  Size
54  show_violations( std::ostream& out, Real x, Size verbose_level, core::Real threshold = 1 ) const;
55 
56 private:
61 };
62 
63 
64 
65 } // constraints
66 } // scoring
67 } // core
68 
69 #endif