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
EtableFunc.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/EtableFunc.hh
11
/// @brief Definition for functions used in definition of constraints.
12
/// @author James Thompson
13
14
#include <
core/scoring/constraints/EtableFunc.hh
>
15
#include <
core/scoring/constraints/util.hh
>
16
17
// AUTO-REMOVED #include <basic/Tracer.hh>
18
#include <
core/types.hh
>
19
20
#include <utility/exit.hh>
21
22
// C++ Headers
23
24
#include <iostream>
25
26
#include <utility/vector1.hh>
27
28
29
namespace
core {
30
namespace
scoring {
31
namespace
constraints {
32
33
void
34
EtableFunc::read_data
( std::istream& in ) {
35
in >>
min_
>>
max_
;
36
stepsize_
= 0.1;
37
for
(
Real
r =
min_
; r <=
max_
; r +=
stepsize_
) {
38
core::Real
func_temp;
39
in >> func_temp;
40
func_
.push_back( func_temp );
41
}
// for ( Real r = min_; r <= max_; r += stepsize_ )
42
}
43
44
Real
45
EtableFunc::func
(
Real
const
x )
const
{
46
// find the appopriate index into func_
47
Real
index = ( x -
min_
) /
stepsize_
;
48
Size
x_lower_idx = (
Size
) (index);
49
Size
x_upper_idx = x_lower_idx + 1;
50
51
Real
x_lower =
min_
+ (x_lower_idx *
stepsize_
);
52
Real
x_upper =
min_
+ (x_upper_idx *
stepsize_
);
53
return
linear_interpolate
( x, x_lower, x_upper,
func_
[x_lower_idx],
func_
[x_upper_idx] );
54
}
// func
55
56
Real
57
EtableFunc::dfunc
(
Real
const
)
const
{
58
utility_exit_with_message(
"dfunc not implemented!\n"
);
59
return
-1;
60
}
// dfunc
61
62
void
EtableFunc::show_definition
( std::ostream& out )
const
{
63
out <<
"ETABLEFUNC "
<<
min_
<<
' '
<<
max_
;
64
for
(
utility::vector1< core::Real >::const_iterator
f_it =
func_
.begin(), f_end =
func_
.end();
65
f_it != f_end;
66
++f_it
67
) {
68
out <<
' '
<< *f_it;
69
}
// for func_ and dfunc_
70
71
out <<
"\n"
;
72
}
// show_definition
73
74
}
// namespace constraints
75
}
// namespace scoring
76
}
// namespace core
77
Generated on Sat Jun 1 2013 11:35:23 for Rosetta 3.5 by
1.8.4