Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
CountViolFunc.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_CountViolFunc_hh
21 #define INCLUDED_core_scoring_constraints_CountViolFunc_hh
22 
24 
25 #include <core/types.hh>
26 
27 #include <utility/pointer/ReferenceCount.hh>
28 
29 
30 // C++ Headers
31 
32 namespace core {
33 namespace scoring {
34 namespace constraints {
35 
36  class CountViolFunc : public Func {
37  public:
39  Real const weight,
40  FuncOP myfunc
41  ): weight_( weight ),
42  count_viols_( 0 ),
43  func_to_weight_( myfunc ) {}
44 
46 
47  FuncOP
48  clone() const { return new CountViolFunc( *this ); }
49 
50  Real func( Real const x ) const;
51  Real dfunc( Real const x ) const;
52 
53  void read_data( std::istream& );
54 
55  /// @brief show some sort of stringified representation of the violations for this constraint.
56  virtual core::Size show_violations( std::ostream& out, Real r, core::Size verbose_level, Real threshold = 1 ) const;
57 
58  /// @brief shows the definition of this function, usually the string type of function and the
59  /// parameters passed in to the constructor.
60  virtual void show_definition( std::ostream & out ) const;
61 
62  Size viols() const {
63  return count_viols_;
64  }
65 
66  private:
70 
71  //typedef std::map< std::string, scoring::constraints::FuncOP > FuncTypes;
72  // static FuncTypes func_types_;
73 
74  };
75 } // constraints
76 } // scoring
77 } // core
78 
79 #endif