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
pack
scmin
CartSCMinMinimizerMap.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 core/pack/scmin/CartSCMinMinimizerMap.hh
11
/// @brief Class for identifying the sidechain DOFs in the AtomTree which are free during
12
/// any particular call to the minimizer.
13
/// @author Andrew Leaver-Fay (aleaverfay@gmail.com)
14
15
#ifndef INCLUDED_core_pack_scmin_CartSCMinMinimizerMap_hh
16
#define INCLUDED_core_pack_scmin_CartSCMinMinimizerMap_hh
17
18
// Unit headers
19
#include <
core/pack/scmin/CartSCMinMinimizerMap.fwd.hh
>
20
#include <
core/pack/scmin/SCMinMinimizerMap.hh
>
21
#include <
core/pack/scmin/CartSCMinMultifunc.hh
>
22
#include <
core/optimization/Multifunc.fwd.hh
>
23
24
// Package Headers
25
#include <
core/pack/scmin/AtomTreeCollection.hh
>
26
27
// Project Headers
28
#include <
core/types.hh
>
29
#include <
core/conformation/Residue.fwd.hh
>
30
#include <
core/id/AtomID_Map.hh
>
31
#include <
core/id/DOF_ID.hh
>
32
#include <
core/kinematics/MinimizerMapBase.hh
>
33
#include <
core/kinematics/tree/Atom.fwd.hh
>
34
#include <
core/scoring/DerivVectorPair.hh
>
35
#include <
core/optimization/types.hh
>
36
#include <
core/optimization/DOF_Node.hh
>
37
38
// Utility headers
39
#include <utility/vector1.hh>
40
#include <utility/pointer/ReferenceCount.hh>
41
42
#include <
core/id/DOF_ID_Map.hh
>
43
#include <
core/id/DOF_ID_Mask.fwd.hh
>
44
#include <
core/id/TorsionID.fwd.hh
>
45
#include <ObjexxFCL/FArray1D.hh>
46
47
48
namespace
core {
49
namespace
pack {
50
namespace
scmin {
51
52
/// @brief
53
class
CartSCMinMinimizerMap
:
public
SCMinMinimizerMap
54
{
55
public
:
56
typedef
optimization::DOF_Node
DOF_Node
;
57
typedef
optimization::DOF_NodeOP
DOF_NodeOP
;
58
59
public
:
60
CartSCMinMinimizerMap
();
61
virtual
~CartSCMinMinimizerMap
();
62
63
/// @brief the CartSCMinMinimizerMap has to know how many residues are in the pose; this allows
64
/// it to do O(1) updates to its DomainMap -- this function costs O(N).
65
virtual
66
void
set_total_residue
(
Size
total_residue );
67
68
/// @brief Disable the minimization for all residues. Ammortized O(1).
69
virtual
70
void
clear_active_dofs
();
71
72
/// @brief Activate all the dofs for a particular residue. Ammortized O(1).
73
virtual
74
void
activate_residue_dofs
(
Size
resindex );
75
76
/// @brief Invoked during the depth-first traversal through the AtomTree. The AtomTree
77
/// is indicating that a particular torsion is dependent on another torsion. Record
78
/// that fact.
79
virtual
80
void
81
add_torsion
(
82
DOF_ID
const
& new_torsion,
83
DOF_ID
const
& parent
84
);
85
86
/// @brief Invoked during the depth-first traversal through the AtomTree; the atom
87
/// tree is indicating that a given atom is controlled by a particular DOF. Record
88
/// that fact.
89
virtual
90
void
91
add_atom
(
92
AtomID
const
& atom_id,
93
DOF_ID
const
& dof_id
94
);
95
96
/// @brief Traverse the atom trees in preparation for minimization to tie together all the
97
/// DOFs and the atoms they control.
98
void
99
setup
(
AtomTreeCollectionOP
trees );
100
101
public
:
102
103
/// Accessors
104
Size
nactive_residues
()
const
{
return
nactive_residues_
; }
105
Size
active_residue
(
Size
index )
const
{ assert( index <=
nactive_residues_
);
return
active_residues_
[ index ]; }
106
107
/// @brief MinimizerMapBase class virtual accessor
108
virtual
kinematics::DomainMap
const
&
domain_map
()
const
{
return
domain_map_
; }
109
110
/// @brief Inline accessor
111
inline
kinematics::DomainMap
const
&
dm
()
const
{
return
domain_map_
; }
112
113
Size
n_dof_nodes
()
const
{
return
nactive_moving_atoms_total_
; }
114
115
/// @brief Initialize a multivec with the dofs reflected in the current residue(s)
116
void
starting_dofs
(
optimization::Multivec
& dofs )
const
;
117
118
/// @brief Assign the chi values to the residue(s)
119
void
assign_dofs_to_mobile_residues
(
optimization::Multivec
const
& dofs );
120
121
optimization::DOF_Node
&
122
dof_node
(
Size
index );
123
124
virtual
125
conformation::Residue
const
&
126
residue
(
Size
seqpos )
const
;
127
128
optimization::DOF_Node
const
&
129
dof_node_for_chi
(
Size
resid,
Size
chiid )
const
;
130
131
id::TorsionID
132
tor_for_dof
(
id::DOF_ID
const
& dofid )
const
;
133
134
kinematics::tree::Atom
const
&
135
atom
(
AtomID
const
& atid )
const
;
136
137
void
zero_atom_derivative_vectors
();
138
139
/// @brief propagate f1/f2's up from children to parents
140
void
link_torsion_vectors
();
141
142
void
set_natoms_for_residue
(
Size
resid,
Size
natoms );
143
144
Size
get_atom_index
(
id::AtomID
const
& atm ) {
145
assert (atm.
rsd
()>0 && atm.
rsd
()<=
atoms_to_dofid_
.size());
146
assert (atm.
atomno
()>0 && atm.
atomno
()<=
atoms_to_dofid_
[atm.
rsd
()].size());
147
return
atoms_to_dofid_
[atm.
rsd
()][atm.
atomno
()];
148
}
149
150
id::AtomID
const
&
get_atom
(
Size
idx ) {
151
assert (idx>0 && idx<
dofid_to_atoms_
.size());
152
return
dofid_to_atoms_
[idx];
153
}
154
155
optimization::MultifuncOP
156
make_multifunc
(
157
pose::Pose
& p,
158
utility::vector1< conformation::ResidueCOP >
const
& bg_residues,
159
scoring::ScoreFunction
const
& sfxn,
160
scoring::MinimizationGraph
& mingraph)
161
{
162
optimization::MultifuncOP
retval(
new
CartSCMinMultifunc
(p,bg_residues,sfxn,mingraph,*
this
) );
163
return
retval;
164
}
165
166
167
protected
:
168
void
reset_dof_nodes
();
169
170
private
:
171
// cartesian dofs (split per-residue)
172
utility::vector1< utility::vector1< id::AtomID >
>
moving_atoms_
;
173
utility::vector1< core::Size >
nactive_moving_atoms_
;
174
core::Size
nactive_moving_atoms_total_
;
175
176
// map atomIDs <-> dof indices
177
utility::vector1< id::AtomID >
dofid_to_atoms_
;
178
utility::vector1< utility::vector1< Size >
>
atoms_to_dofid_
;
179
180
// temporary storage for converting coords <-> multivec
181
utility::vector1< core::Vector >
residue_coord_workspace_
;
// temporary space
182
183
// even though we don't need _all_ of this data, use the same datatypes as atomtree variant
184
AtomTreeCollectionOP
atom_tree_collection_
;
185
utility::vector1< ResidueAtomTreeCollectionOP >
atcs_for_residues_
;
186
187
kinematics::DomainMap
domain_map_
;
188
};
189
190
extern
optimization::DOF_NodeOP
dummy_nodeop
;
191
192
193
}
// namespace scmin
194
}
// namespace pack
195
}
// namespace core
196
197
#endif
Generated on Sat Jun 1 2013 11:33:49 for Rosetta 3.5 by
1.8.4