Rosetta 3.5
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
src
core
scoring
constraints
CountViolFunc.cc
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/CountViolFunc.cc
11
/// @brief Weighted constraint function that reweights other constraints
12
/// by a constant scalar value.
13
/// @author James Thompson, Greg Taylor
14
15
16
#include <
core/scoring/constraints/CountViolFunc.hh
>
17
#include <
core/scoring/constraints/FuncFactory.hh
>
18
19
#include <
core/types.hh
>
20
21
#include <utility/pointer/ReferenceCount.hh>
22
23
// AUTO-REMOVED #include <numeric/angle.functions.hh>
24
#include <ObjexxFCL/format.hh>
25
// AUTO-REMOVED #include <basic/Tracer.hh>
26
27
// C++ Headers
28
#include <string>
29
30
namespace
core {
31
namespace
scoring {
32
namespace
constraints {
33
34
Real
35
CountViolFunc::func
(
Real
const
x )
const
36
{
37
return
func_to_weight_
->func( x ) *
weight_
;
38
}
39
40
Real
41
CountViolFunc::dfunc
(
Real
const
x )
const
42
{
43
return
func_to_weight_
->dfunc( x ) *
weight_
;
44
}
45
46
void
47
CountViolFunc::read_data
( std::istream& in )
48
{
49
in >>
count_viols_
;
50
weight_
= 1.0;
51
FuncFactory
func_factory;
52
std::string
func_type;
53
in >> func_type;
54
func_to_weight_
= func_factory.
func_types_
[ func_type ]->clone();
55
func_to_weight_
->read_data( in );
56
}
57
58
/// @brief show some sort of stringified representation of the violations for this constraint.
59
core::Size
CountViolFunc::show_violations
(
60
std::ostream& out,
61
Real
r,
62
Size
verbose_level,
63
Real
threshold
64
)
const
{
65
Size
ct (
func_to_weight_
->show_violations( out, r, verbose_level, threshold ) );
66
// if ( verbose_level == 100 ) {
67
count_viols_
+= ct;
68
// }
69
return
ct;
70
}
71
72
void
73
CountViolFunc::show_definition
( std::ostream &out )
const
{
74
using namespace
ObjexxFCL::fmt;
75
out <<
"COUNTVIOLFUNC"
<< RJ( 7,
count_viols_
) <<
" "
;
76
func_to_weight_
->show_definition( out );
77
}
78
79
}
// namespace constraints
80
}
// namespace scoring
81
}
// namespace core
82
Generated on Sat Jun 1 2013 11:35:20 for Rosetta 3.5 by
1.8.4