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
methods
EnergyMethod.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 core/scoring/method/EnergyMethod.cc
11
/// @brief Base class for energy classes
12
/// @author Phil Bradley
13
14
15
16
// Unit headers
17
#include <
core/scoring/methods/EnergyMethod.hh
>
18
19
// Package headers
20
#include <
core/scoring/methods/EnergyMethodCreator.hh
>
21
22
#include <utility/vector1.hh>
23
24
25
namespace
core {
26
namespace
scoring {
27
namespace
methods {
28
29
EnergyMethod::EnergyMethod
(
EnergyMethodCreatorOP
creator ) :
30
score_types_( creator->score_types_for_method() )
31
{
32
}
33
34
EnergyMethod::EnergyMethod
(
EnergyMethod
const
& src ) :
35
parent
(),
36
score_types_( src.score_types_ )
37
{
38
}
39
40
41
EnergyMethod::~EnergyMethod
() {}
42
43
44
bool
45
EnergyMethod::minimize_in_whole_structure_context
(
pose::Pose
const
& )
const
46
{
47
/// APL -- Grandfathering mechanism. As energy methods are updated to use
48
/// the new derivative evaluation machinery, they can set this function to
49
/// return "false", and therefore be used in rtmin.
50
return
true
;
51
}
52
53
bool
54
EnergyMethod::defines_high_order_terms
(
pose::Pose
const
& )
const
55
{
56
return
false
;
57
}
58
59
/// @details default implementation noop
60
void
61
EnergyMethod::setup_for_packing
(
pose::Pose
&,
utility::vector1< bool >
const
&,
utility::vector1< bool >
const
& )
const
{}
62
63
64
/// @details default implementation noop
65
void
66
EnergyMethod::prepare_rotamers_for_packing
(
67
pose::Pose
const
&,
68
conformation::RotamerSetBase
& )
const
69
{}
70
71
72
/// @details default implementation noop
73
void
74
EnergyMethod::update_residue_for_packing
(
75
pose::Pose
&,
76
Size
)
const
77
{}
78
79
void
80
EnergyMethod::setup_for_scoring
(
pose::Pose
&,
ScoreFunction
const
& )
const
{}
81
82
/// @details default implementation noop
83
void
84
EnergyMethod::setup_for_minimizing
(
85
pose::Pose
& ,
86
ScoreFunction
const
& ,
87
kinematics::MinimizerMapBase
const
&
88
)
const
{}
89
90
/// @details default implementation noop
91
void
92
EnergyMethod::setup_for_derivatives
(
pose::Pose
&,
ScoreFunction
const
& )
const
{}
93
94
/// @details default implementation noop
95
void
96
EnergyMethod::finalize_after_derivatives
(
pose::Pose
&,
ScoreFunction
const
& )
const
97
{}
98
99
/// @details default implementation does not alter either the F1 or F2 vectors.
100
void
101
EnergyMethod::eval_atom_derivative
(
102
id::AtomID
const
&,
103
pose::Pose
const
&,
104
kinematics::DomainMap
const
&,
105
ScoreFunction
const
&,
106
EnergyMap
const
&,
107
Vector
&,
// F1,
108
Vector
&
// F2
109
)
const
{}
110
111
/*
112
/// @details default behavior is to return 0
113
Real
114
EnergyMethod::eval_dof_derivative(
115
id::DOF_ID const &,
116
id::TorsionID const &,
117
pose::Pose const &,
118
ScoreFunction const &,
119
EnergyMap const &
120
) const
121
{
122
return 0.0;
123
}*/
124
125
/// called at the end of energy evaluation
126
void
127
EnergyMethod::finalize_total_energy
(
128
pose::Pose
&,
129
ScoreFunction
const
&,
130
EnergyMap
&
131
)
const
{}
132
133
/// @details Enforce that the derived class which has been
134
/// instantiated does not attempt to use an inactive score type.
135
/// If an inactive score type should be used, the ScoreType enumeration
136
/// in ScoreType.hh must be modified so that the desired type appears
137
/// before the n_score_types position in the enumeration. Rosetta
138
/// must then be recompiled.
139
140
/* DEPRICATED! ALL SCORE TYPE REGISTRATION SHOULD BE PERFORMED BY AN EnergyMethodCreator
141
void
142
EnergyMethod::add_score_type( ScoreType const & type )
143
{
144
if ( type > n_score_types ) {
145
std::cerr << "Critical error in EnergyMethod::add_score_type().\nAn EnergyMethod class has been instantiated ";
146
std::cerr << "that will compute the inactive score type '" << type;
147
std::cerr << "' defined at position " << (int) type << " in the ScoreType enumeration.\n";
148
std::cerr << "This energy method would produce a segmentation fault down the road as it tried to write to ";
149
std::cerr << "a position in an EnergyMap object beyond the end of the array contained in that object.\n";
150
std::cerr << "Active score types must appear before the n_score_types element ";
151
std::cerr << "(at position " << (int) n_score_types << ") as this element marks the end of the active score types.\n";
152
std::cerr << "Rosetta must be recompiled after src/core/scoring/ScoreType.hh is modified to include " << type;
153
std::cerr << " as an active score type." << std::endl;
154
utility_exit_with_message( "ERROR: Attempted to use an inactive score type" );
155
}
156
score_types_.push_back( type );
157
}
158
*/
159
160
/// @brief Override the entirety of the score types list if they
161
/// were initialized incorrectly in a parent's constructor.
162
void
163
EnergyMethod::set_score_types
(
EnergyMethodCreatorOP
creator ) {
164
score_types_
= creator->score_types_for_method();
165
}
166
167
168
}
// methods
169
}
// scoring
170
}
// core
Generated on Sat Jun 1 2013 11:37:52 for Rosetta 3.5 by
1.8.4