Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
CircularHarmonicFunc.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/HarmonicFunc.hh
11 /// @brief Definition for functions used in definition of constraints.
12 /// @author James Thompson
13 
14 #ifndef INCLUDED_core_scoring_constraints_CircularHarmonicFunc_hh
15 #define INCLUDED_core_scoring_constraints_CircularHarmonicFunc_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 CircularHarmonicFunc : public Func {
30 public:
32  Real const x0_radians, Real const sd_radians
33  ): x0_( x0_radians ), sd_( sd_radians ), offset_( 0.0 ) {}
34 
36  Real const x0_radians, Real const sd_radians, Real const offset
37  ): x0_( x0_radians ), sd_( sd_radians ), offset_( offset ) {}
38 
39  FuncOP clone() const { return new CircularHarmonicFunc( *this ); }
40 
41  Real func( Real const x ) const;
42  Real dfunc( Real const x ) const;
43 
44  virtual void read_data( std::istream & in );
45  virtual void show_definition( std::ostream & out ) const;
46 
47  Real x0() const {
48  return x0_;
49  }
50 
51  Real sd() const {
52  return sd_;
53  }
54 
55 private:
59 };
60 
61 } // constraints
62 } // scoring
63 } // core
64 
65 #endif