Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
CircularSigmoidalFunc.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/SigmoidalFunc.hh
11 /// @brief Definition for functions used in definition of constraints.
12 /// @author RobertVernon
13 
14 #ifndef INCLUDED_core_scoring_constraints_CircularSigmoidalFunc_hh
15 #define INCLUDED_core_scoring_constraints_CircularSigmoidalFunc_hh
16 
19 #include <core/types.hh>
20 
21 // C++ Headers
22 
23 namespace core {
24 namespace scoring {
25 namespace constraints {
26 
27 /// @brief Function that operates in radians, for applications like DihedralConstraint.
28 /// Prevents discontinuities at 0/360 or -180/180 degrees for dihedral constraints.
29 class CircularSigmoidalFunc : public Func {
30 public:
32  Real const center_radians, Real const width_radians, Real const slope_radians
33  ) : xC_( center_radians ), m_( slope_radians ),
34  o1_( -width_radians/2 ), o2_( width_radians/2 ), offset_( 1.0 ) {}
35 
37  Real const center_radians, Real const width_radians, Real const slope_radians,
38  Real const offset ) : xC_( center_radians ), m_( slope_radians ),
39  o1_( -width_radians/2 ), o2_( width_radians/2 ), offset_( offset ) {}
40 
41  FuncOP clone() const { return new CircularSigmoidalFunc( *this ); }
42 
43  Real func( Real const x ) const;
44  Real dfunc( Real const x ) const;
45 
46  virtual void read_data( std::istream & in );
47  virtual void show_definition( std::ostream & out ) const;
48 
49 private:
55 };
56 
57 } // constraints
58 } // scoring
59 } // core
60 
61 #endif