Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ScalarWeightedFunc.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/ScalarWeightedFunc.hh
11 /// @brief Weighted constraint function that encapsulates other constraints
12 /// @author James Thompson, Greg Taylor
13 /// @details The ScalarWeightedFunc is a class used to scale other
14 /// constraints by multiplying it by a constant value.
15 /// This is useful in cases where constraint templates are similar
16 /// to each other and should be down-weighted to avoid double counting
17 /// for the same structural information.
18 
19 
20 #ifndef INCLUDED_core_scoring_constraints_ScalarWeightedFunc_hh
21 #define INCLUDED_core_scoring_constraints_ScalarWeightedFunc_hh
22 
24 
26 
27 #include <core/types.hh>
28 
29 #include <utility/pointer/ReferenceCount.hh>
30 
31 
32 // C++ Headers
33 
34 namespace core {
35 namespace scoring {
36 namespace constraints {
37 
38  class ScalarWeightedFunc : public Func {
39  public:
41  Real const weight,
42  FuncOP myfunc
43  ): weight_( weight ), func_to_weight_( myfunc ) {}
44 
45  virtual ~ScalarWeightedFunc();
46 
47  virtual
48  FuncOP
49  clone() const { return new ScalarWeightedFunc( *this ); }
50 
51  virtual
52  Real func( Real const x ) const;
53  virtual
54  Real dfunc( Real const x ) const;
55 
56  virtual
57  void read_data( std::istream& );
58 
59  virtual
60  void show_definition( std::ostream &out ) const;
61  virtual
62  Size show_violations(std::ostream &out, Real x, Size verbose_level, Real threshold = 1) const;
63 
64 
65  private:
68  };
69 } // constraints
70 } // scoring
71 } // core
72 
73 #endif