Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
EtableFunc.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/EtableFunc.hh
11 /// @brief Definition for functions used in definition of constraints.
12 /// @author James Thompson
13 
14 #ifndef INCLUDED_core_scoring_constraints_EtableFunc_hh
15 #define INCLUDED_core_scoring_constraints_EtableFunc_hh
16 
18 #include <core/types.hh>
19 
20 // AUTO-REMOVED #include <utility/vector1.hh>
21 
22 // C++ Headers
23 // AUTO-REMOVED #include <ostream>
24 
25 #include <utility/vector1_bool.hh>
26 
27 
28 namespace core {
29 namespace scoring {
30 namespace constraints {
31 
32 /// @brief Class for representing arbitrarily defined functions.
33 class EtableFunc : public Func {
34 public:
35 
36  /*!
37  * Constuctor for EtableFunc. Arguments to the constructor are:
38  * - mean: parameter representing the mean of this function.
39  * - sd: parameter representing the standard deviation of this function.
40  */
41 
43  Real const min_,
44  Real const max_,
45  Real const stepsize_
46  ) :
47  min_ ( min_ ),
48  max_ ( max_ ),
49  stepsize_( stepsize_ )
50  {}
51 
52  /// @brief returns a clone of this EtableFunc
53  FuncOP clone() const { return new EtableFunc( *this ); }
54 
55  /// @brief Returns the value of this EtableFunc evaluated at distance x.
56  Real func( Real const x ) const;
57 
58  /// @brief Returns the value of the first derivative of this EtableFunc at distance x.
59  Real dfunc( Real const x ) const;
60 
61  /// @brief show the definitio of this EtableFunc to the specified output stream.
62  virtual void show_definition( std::ostream &out ) const;
63 
64  /// @brief Calls show( out ) on this EtableFunc.
65  friend std::ostream& operator<<(std::ostream& out, const EtableFunc& f ) {
66  f.show( out );
67  return out;
68  } // operator<<
69 
70 
71  void read_data( std::istream& in );
72 
73 private:
78 };
79 
80 
81 
82 } // constraints
83 } // scoring
84 } // core
85 
86 #endif