![]() |
Rosetta Core
2014.35
|
#include <PDInteractionGraph.hh>
Public Member Functions | |
PDInteractionGraph (int num_nodes) | |
main constructor: no default nor copy constructors provided. More... | |
virtual void | initialize (rotamer_set::RotamerSetsBase const &rot_sets) |
virtual core::PackerEnergy | get_one_body_energy_for_node_state (int node, int state) |
accessor More... | |
virtual int | get_num_aatypes () const |
sets the number of amino acid types present. More... | |
virtual void | add_edge (int node1, int node2) |
virtual void | blanket_assign_state_0 () |
assigns the state of all nodes in the interaction graph to their unassigned or zero states. More... | |
virtual core::PackerEnergy | set_state_for_node (int node_ind, int new_state) |
sets the state on node node_ind to new_state More... | |
virtual core::PackerEnergy | set_network_state (ObjexxFCL::FArray1_int &node_states) |
takes in a vector of states, one state per node, and sets the state for each of the nodes to the specified state. More... | |
virtual void | consider_substitution (int node_ind, int new_state, core::PackerEnergy &delta_energy, core::PackerEnergy &prev_energy_for_node) |
considers altering the state of a particular node; returns the change in energy that the state substitution would produce More... | |
virtual core::PackerEnergy | commit_considered_substitution () |
Accepts (commits) the state change previously considered in a call to consider_substitution and returns the energy of the entire graph. More... | |
virtual core::PackerEnergy | get_energy_current_state_assignment () |
@ brief O(1) total energy report. Protected read access for derived classes. More... | |
virtual int | get_edge_memory_usage () const |
older scheme for memory accounting – replace this asap More... | |
virtual void | print_current_state_assignment () const |
outputs the current state for each node, useful for debugging More... | |
virtual void | set_errorfull_deltaE_threshold (core::PackerEnergy) |
virtual unsigned int | count_static_memory () const |
virtual unsigned int | count_dynamic_memory () const |
virtual core::PackerEnergy | get_energy_sum_for_vertex_group (int group_id) |
a user may define subsets of the vertex set for which they would like to know the internal energy sum. More... | |
core::PackerEnergy | get_weighted_energy (ObjexxFCL::FArray2D< core::PackerEnergy > const &weights) const |
core::PackerEnergy | set_network_state (ObjexxFCL::FArray1_int &node_states, ObjexxFCL::FArray2D< core::PackerEnergy > const &weights) |
virtual void | consider_substitution (int node_ind, int new_state, core::PackerEnergy &deltaE_unweighted, core::PackerEnergy &prevE_unweighted, core::PackerEnergy &deltaE_weighted, core::PackerEnergy &prevE_weighted, ObjexxFCL::FArray2D< core::PackerEnergy > const &weights) |
virtual core::PackerEnergy | commit_considered_substitution (ObjexxFCL::FArray2D< core::PackerEnergy > const &weights) |
virtual bool | aa_submatrix_energies_retrievable () const |
Override the InteractionGraphBase class's implementation of this function to return 'true'. More... | |
virtual int | aatype_for_node_state (int node_ind, int node_state) const |
virtual ObjexxFCL::FArray2D < core::PackerEnergy > | get_aa_submatrix_energies_for_edge (int node1, int node2, int node1aa, int node2aa) const |
![]() | |
virtual | ~PrecomputedPairEnergiesInteractionGraph () |
PrecomputedPairEnergiesInteractionGraph (int num_nodes) | |
void | add_to_two_body_energies_for_edge (int node1, int node2, ObjexxFCL::FArray2< core::PackerEnergy > const &res_res_energy_array) |
interface for PrecomputedPairEnergiesEdge::add_to_two_body_energies More... | |
void | add_to_two_body_energies_for_edge (int node1, int node2, int state_node1, int state_node2, core::PackerEnergy const two_body_energy) |
interface to PrecomputedPairEnergiesEdge::add_to_two_body_energies More... | |
void | set_two_body_energy_for_edge (int node1, int node2, int state_node1, int state_node2, core::PackerEnergy const two_body_energy) |
interface to PDEdge::set_two_body_energy More... | |
void | clear_two_body_energy_for_edge (int node1, int node2, int state_node1, int state_node2) |
interface to PDEdge::clear_two_body_energy More... | |
virtual void | declare_edge_energies_final (int node1, int node2) |
call this if you're done storing energies in an edge - it will reduce the memory usage for that edge if possible More... | |
![]() | |
virtual | ~FixedBBInteractionGraph () |
FixedBBInteractionGraph (int num_nodes) | |
void | set_sparse_aa_info_for_edge (int node1, int node2, ObjexxFCL::FArray2_bool const &sparse_conn_info) |
interface to PDEdge::set_sparse_aa_info More... | |
bool | get_sparse_aa_info_for_edge (int node1, int node2, int node1aa, int node2aa) |
returns true if node1aa and node2aa are amino acid neighbors More... | |
void | force_aa_neighbors_for_edge (int node1, int node2, int node1aa, int node2aa) |
interface to FixedBBEdge::force_aa_neighbors More... | |
void | force_all_aa_neighbors_for_edge (int node1, int node2) |
interface to PDEdge::force_aa_neighbors More... | |
virtual core::PackerEnergy | get_two_body_energy_for_edge (int node1, int node2, int state_node1, int state_node2) const |
interface to FixedBBEdge::get_two_body_energy More... | |
![]() | |
virtual | ~InteractionGraphBase () |
destructor More... | |
InteractionGraphBase (int num_nodes) | |
main constructor More... | |
virtual int | get_num_nodes_v () const |
int | get_num_nodes () const |
void | set_num_states_for_node (int node, int num_states) |
sets the number of states for a node of a particular index NEW REQUIREMENT: Nodes must have their num-states set in ascending order by node index; that is, node 1 must go first, node 2 next, and so on. More... | |
int | get_num_states_for_node (int node) const |
returns the number of states for a particular node More... | |
int | get_num_total_states () const |
void | add_edge (int node1, int node2) |
creates a new edge between nodes index1 and index2. Nodes do not have to be listed in order More... | |
bool | get_edge_exists (int node1, int node2) |
returns true if an edge between node1 and node2 exists More... | |
void | drop_all_edges_for_node (int node) |
deletes all edges adjacent to the node specified More... | |
void | print_vertices () const |
calls print() on each of the nodes in the graph More... | |
virtual void | print () const |
void | output_connectivity (std::ostream &os) const |
writes out a list of all the edges in the graph More... | |
void | output_dimacs (std::ostream &os) const |
writes out a connectivity description of the graph in the famous dimacs format. (where the first column "DIMACS:" should be sed'ed out) More... | |
virtual void | prepare_for_simulated_annealing () |
iterate across edges and nodes and allow them to prepare for simulated annealing More... | |
void | set_edge_weight (int node1, int node2, Real edge_weight) |
Real | get_edge_weight (int node1, int node2) const |
bool | any_vertex_state_unassigned () const |
Returns true if any node in the graph is in state 0, the unassigned state. More... | |
void | add_to_one_body_energies (ObjexxFCL::FArray1< core::PackerEnergy > &one_body_energies) |
takes one FArray of energies – one energy for each state for each node More... | |
void | update_one_body_energies (ObjexxFCL::FArray1< core::PackerEnergy > &old_energy1b, ObjexxFCL::FArray1< core::PackerEnergy > &new_energy1b) |
decrements the one body energies by the values held in old_energy1b, increments the one body energies by the values held in new_energy1b, and copies new_energy1b into old_energy1b. More... | |
void | zero_one_body_energies_for_node (int node) |
void | add_to_nodes_one_body_energy (int node_ind, utility::vector1< core::PackerEnergy > const &one_body_energies) |
void | add_to_nodes_one_body_energy (int node_ind, ObjexxFCL::FArray1< core::PackerEnergy > const &one_body_energies) |
void | add_to_nodes_one_body_energy (int node_ind, int state_id, core::PackerEnergy const one_body_energy) |
interface to PrecomputedPairEnergiesNode::add_to_nodes_one_body_energy More... | |
void | set_number_of_energy_sum_vertex_groups (int num_groups) |
a user may define subsets of the vertex set for which they would like to know the internal energy sum. For instance in a graph with 6 vertices, {a,b,c,d,e,f} a user may be interested in the sum of the one- and two-body energies for vertices {a,b,c}. The graph will return sum of the one body energies for vertices a b and c and also any two-body energies for the edges in the subgraph induced by a,b, and c. (In this case, edges {a,b}, {a,c} and {b,c} if these edges are part of the graph. The edge {a,d} will not be counted if it is part of the graph.) More... | |
void | set_vertex_member_of_group (int vertex, int group) |
a user may define subsets of the vertex set for which they would like to know the internal energy sum. For instance in a graph with 6 vertices, {a,b,c,d,e,f} a user may be interested in the sum of the one- and two-body energies for vertices {a,b,c}. The graph will return sum of the one body energies for vertices a b and c and also any two-body energies for the edges in the subgraph induced by a,b, and c. (In this case, edges {a,b}, {a,c} and {b,c} if these edges are part of the graph. The edge {a,d} will not be counted if it is part of the graph.) More... | |
void | print_vertex_groups () |
int | count_connected_components_and_initialize_vertex_groups () |
makes a depth first traversal of the graph, counting the number of connected components, and initializes the vertex group memberships to reflect the connected components. Returns the number of connected components in the graph. More... | |
void | note_vertex_reached (int node_index) |
marks a vertex as belonging to the connected component currently being traversed in the depth first traversal. More... | |
bool | vertex_already_reached (int node_index) |
used by class NodeBase during the depth-first traversal to determine the number of connected components in the graph. returns true if the dft has already reached the node. More... | |
bool | get_vertex_member_of_energy_sum_group (int node_index, int group_id) |
virtual unsigned int | getTotalMemoryUsage () const |
void | reset_edge_list_iterator_for_node (int node_index) const |
set the Graph's (single) edge list iterator to the beginning of the edge list for a particular node More... | |
void | increment_edge_list_iterator () const |
increment the (single) edge list iterator to the next element More... | |
bool | edge_list_iterator_at_end () const |
test: have we arrived at the edge list end? More... | |
EdgeBase const & | get_edge () const |
return a const reference to an edge pointed at by the list iterator More... | |
EdgeBase const * | find_edge (int node1, int node2) const |
returns the edge connecting node1 and node2 More... | |
EdgeBase * | find_edge (int node1, int node2) |
NodeBase * | get_node (int index) const |
int | get_num_edges () const |
std::list< EdgeBase * >::iterator | get_edge_list_begin () |
std::list< EdgeBase * > ::const_iterator | get_edge_list_begin () const |
std::list< EdgeBase * > ::const_iterator | get_edge_list_end () const |
Protected Member Functions | |
virtual unsigned int | getMemoryUsageInBytes () const |
virtual NodeBase * | create_new_node (int node_index, int num_states) |
factory method that instantiates a PDNode. More... | |
virtual EdgeBase * | create_new_edge (int index1, int index2) |
factory method that instantiates a PDEdge More... | |
core::PackerEnergy | get_energy_PD_current_state_assignment () |
void | update_internal_energy_totals () |
removes numerical drift that can accumulate over the course of many state assignment changes within simulated annealing More... | |
PDNode * | get_pd_node (int index) const |
PDEdge const * | get_pd_edge (int node1, int node2) const |
PDEdge * | get_pd_edge (int node1, int node2) |
![]() | |
FixedBBNode const * | get_fixedbb_node (int node_index) const |
Downcasts. More... | |
FixedBBNode * | get_fixedbb_node (int node_index) |
FixedBBEdge const * | get_fixedbb_edge (int node1, int node2) const |
FixedBBEdge * | get_fixedbb_edge (int node1, int node2) |
![]() | |
void | drop_edge (std::list< EdgeBase * >::iterator edge) |
removes edge from edge list at iterator iter More... | |
int | get_node_state_offset (int index) const |
bool | mine (EdgeBase const *edge) const |
Private Member Functions | |
PDInteractionGraph () | |
PDInteractionGraph (PDInteractionGraph const &) | |
PDInteractionGraph & | operator= (PDInteractionGraph const &) |
Private Attributes | |
int | num_aa_types_ |
int | num_commits_since_last_update_ |
core::PackerEnergy | total_energy_current_state_assignment_ |
core::PackerEnergy | total_energy_alternate_state_assignment_ |
int | node_considering_alt_state_ |
int | num_nodes_in_file_ |
int | num_file_aa_types_ |
ObjexxFCL::FArray1D_int | file_node_2_instance_node_ |
ObjexxFCL::FArray1D_int | instance_node_2_file_node_ |
ObjexxFCL::FArray1D < ObjexxFCL::FArray1D_int > | aa_types_for_states_on_file_nodes_ |
ObjexxFCL::FArray1D < ObjexxFCL::FArray1D_int > | num_file_states_for_aa_for_node_ |
Static Private Attributes | |
static const int | COMMIT_LIMIT_BETWEEN_UPDATES = 1024 |
core::pack::interaction_graph::PDInteractionGraph::PDInteractionGraph | ( | int | num_nodes | ) |
main constructor: no default nor copy constructors provided.
num_nodes | - [in] - the number of nodes in this graph |
|
private |
Referenced by count_static_memory(), and getMemoryUsageInBytes().
|
private |
|
virtual |
Override the InteractionGraphBase class's implementation of this function to return 'true'.
PDInteractionGraph will return aa submatrices as requested.
Reimplemented from core::pack::interaction_graph::FixedBBInteractionGraph.
|
virtual |
Derived classes wishing to respond to the get_aa_submatrix_energies_for_edge must implement this function as well, which allows the mapping between states and their on-node amino-acid index (which may very well represent something other than the index of the enumeration element for the rotamer's "aa()").
Reimplemented from core::pack::interaction_graph::FixedBBInteractionGraph.
References core::pack::interaction_graph::PDNode::aatype_for_state(), and get_pd_node().
|
virtual |
assigns the state of all nodes in the interaction graph to their unassigned or zero states.
Implements core::pack::interaction_graph::InteractionGraphBase.
References core::pack::interaction_graph::PDNode::assign_zero_state(), core::pack::interaction_graph::InteractionGraphBase::get_num_nodes(), get_pd_node(), and total_energy_current_state_assignment_.
|
virtual |
Accepts (commits) the state change previously considered in a call to consider_substitution and returns the energy of the entire graph.
to avoid too much numerical drift from accumulating, the bookkeeping arrays are updated once every 2^10 state commits
Implements core::pack::interaction_graph::InteractionGraphBase.
References COMMIT_LIMIT_BETWEEN_UPDATES, get_pd_node(), node_considering_alt_state_, num_commits_since_last_update_, total_energy_alternate_state_assignment_, total_energy_current_state_assignment_, and update_internal_energy_totals().
Referenced by commit_considered_substitution().
|
virtual |
References commit_considered_substitution(), and get_weighted_energy().
|
virtual |
considers altering the state of a particular node; returns the change in energy that the state substitution would produce
To avoid too much numerical drift from accumulating, the bookkeeping arrays are updated once every 2^10 state commits
node_ind | - [in] - the index of the node considering a state change |
new_state | - [in] - the new state that node is considering |
alt_total_energy | - [out] - the total network energy produced under the new state |
delta_energy | - [out] - the change in energy produced under the substitution |
prev_energy_for_node | - [out] - the sum of the one and two body energies for this node under the current state assignment |
Implements core::pack::interaction_graph::InteractionGraphBase.
|
virtual |
|
virtual |
Reimplemented from core::pack::interaction_graph::InteractionGraphBase.
References core::pack::interaction_graph::InteractionGraphBase::count_dynamic_memory().
|
virtual |
Implements core::pack::interaction_graph::InteractionGraphBase.
References PDInteractionGraph().
|
protectedvirtual |
factory method that instantiates a PDEdge
index1 | - [in] - the smaller-indexed node this edge is incident upon |
index2 | - [in] - the larger-indexed node this edge is incident upon |
Implements core::pack::interaction_graph::InteractionGraphBase.
|
protectedvirtual |
factory method that instantiates a PDNode.
node_index | - [in] - the index of the node being created |
num_states | - [in] - the total number of states for the new node |
Implements core::pack::interaction_graph::InteractionGraphBase.
|
virtual |
Do not call this function unless it is implemented in the derived class, as should be indicated by the "aa_submatrix_energies_retrivable" method.
Reimplemented from core::pack::interaction_graph::FixedBBInteractionGraph.
References core::pack::interaction_graph::PDEdge::get_aa_submatrix_energies(), and get_pd_edge().
|
virtual |
older scheme for memory accounting – replace this asap
returns the number of floats used in all edge two-body energy tables
Implements core::pack::interaction_graph::InteractionGraphBase.
References core::pack::interaction_graph::InteractionGraphBase::get_edge_list_begin(), core::pack::interaction_graph::InteractionGraphBase::get_edge_list_end(), and sum().
|
virtual |
@ brief O(1) total energy report. Protected read access for derived classes.
removes all accumulated numerical drift and returns the energy for the current state assignment.
Implements core::pack::interaction_graph::InteractionGraphBase.
References total_energy_current_state_assignment_, and update_internal_energy_totals().
|
protected |
References total_energy_current_state_assignment_.
|
virtual |
a user may define subsets of the vertex set for which they would like to know the internal energy sum.
For instance in a graph with 6 vertices,{a,b,c,d,e,f} a user may be interested in the sum of the one- and two-body energies for vertices {a,b,c}. The graph will return sum of the one body energies for vertices a b and c and also any two-body energies for the edges in the subgraph induced by a,b, and c. (In this case, edges {a,b}, {a,c} and {b,c} if these edges are part of the graph. The edge {a,d} will not be counted if it is part of the graph.). ask the graph for the energies of the induced subgraph defined by a particular group.
group_id | - [in] - the groups for which you're interested in retrieving energies of the induced subgraph |
Implements core::pack::interaction_graph::InteractionGraphBase.
References core::pack::interaction_graph::InteractionGraphBase::get_edge_list_begin(), core::pack::interaction_graph::InteractionGraphBase::get_edge_list_end(), core::pack::interaction_graph::InteractionGraphBase::get_num_nodes(), core::pack::interaction_graph::PDNode::get_one_body_energy_current_state(), get_pd_node(), and core::pack::interaction_graph::InteractionGraphBase::get_vertex_member_of_energy_sum_group().
|
virtual |
sets the number of amino acid types present.
returns the number of different amino acid types
The actual meaning of the integers used to represent amino acid types is not important, rather each state is labeled as being of some amino acid type. The amino acid types mean little more than equivalence classes; two states are either in the same equivalence class or they are in different ones. this function should be called once and only once
num_aa_types | - [in] - the number of amino acid types |
Implements core::pack::interaction_graph::FixedBBInteractionGraph.
References num_aa_types_.
|
virtual |
accessor
Implements core::pack::interaction_graph::InteractionGraphBase.
References core::pack::interaction_graph::PDNode::get_one_body_energy(), and get_pd_node().
|
inlineprotected |
References core::pack::interaction_graph::InteractionGraphBase::find_edge().
Referenced by add_edge(), and get_aa_submatrix_energies_for_edge().
|
inlineprotected |
References core::pack::interaction_graph::InteractionGraphBase::get_node().
Referenced by aatype_for_node_state(), blanket_assign_state_0(), commit_considered_substitution(), get_energy_sum_for_vertex_group(), get_one_body_energy_for_node_state(), get_weighted_energy(), initialize(), print_current_state_assignment(), set_network_state(), set_state_for_node(), and update_internal_energy_totals().
float core::pack::interaction_graph::PDInteractionGraph::get_weighted_energy | ( | ObjexxFCL::FArray2D< core::PackerEnergy > const & | weights | ) | const |
|
protectedvirtual |
References PDInteractionGraph().
|
virtual |
Implements core::pack::interaction_graph::InteractionGraphBase.
References get_pd_node(), core::pack::rotamer_set::RotamerSets::nmoltenres(), num_aa_types_, core::pack::rotamer_set::RotamerSets::rotamer_set_for_moltenresidue(), core::pack::interaction_graph::PDNode::set_amino_acid_types(), and core::pack::interaction_graph::InteractionGraphBase::set_num_states_for_node().
|
private |
|
virtual |
outputs the current state for each node, useful for debugging
Implements core::pack::interaction_graph::InteractionGraphBase.
References core::pack::interaction_graph::PDNode::get_current_state(), core::pack::interaction_graph::InteractionGraphBase::get_num_nodes(), get_pd_node(), and core::pack::interaction_graph::PDNode::print_internal_energies().
|
inlinevirtual |
|
virtual |
takes in a vector of states, one state per node, and sets the state for each of the nodes to the specified state.
also calls "update internal energy totals" to undo any numerical noise accumulated during the transition.
node_states | - [in] - array of states, one for each node. |
Implements core::pack::interaction_graph::InteractionGraphBase.
References core::pack::interaction_graph::PDNode::assign_state(), core::pack::interaction_graph::InteractionGraphBase::get_num_nodes(), get_pd_node(), total_energy_current_state_assignment_, and update_internal_energy_totals().
Referenced by set_network_state().
float core::pack::interaction_graph::PDInteractionGraph::set_network_state | ( | ObjexxFCL::FArray1_int & | node_states, |
ObjexxFCL::FArray2D< core::PackerEnergy > const & | weights | ||
) |
References get_weighted_energy(), and set_network_state().
|
virtual |
sets the state on node node_ind to new_state
node_ind | - [in] - the index of the node in question |
new_state | - [in] - the new state the node is being assigned to |
Implements core::pack::interaction_graph::InteractionGraphBase.
References core::pack::interaction_graph::PDNode::assign_state(), get_pd_node(), total_energy_current_state_assignment_, and update_internal_energy_totals().
|
protected |
removes numerical drift that can accumulate over the course of many state assignment changes within simulated annealing
Iterates across nodes and then edges to look-up the energies for the current state assignmnet removing any numerical drift which accumulated in the member variable total_energy_current_state_assignment_.
References core::pack::interaction_graph::InteractionGraphBase::get_edge_list_begin(), core::pack::interaction_graph::InteractionGraphBase::get_edge_list_end(), core::pack::interaction_graph::InteractionGraphBase::get_num_nodes(), get_pd_node(), num_commits_since_last_update_, and total_energy_current_state_assignment_.
Referenced by commit_considered_substitution(), get_energy_current_state_assignment(), set_network_state(), and set_state_for_node().
|
private |
|
staticprivate |
Referenced by commit_considered_substitution().
|
private |
|
private |
|
private |
Referenced by commit_considered_substitution().
|
private |
Referenced by get_num_aatypes(), and initialize().
|
private |
Referenced by commit_considered_substitution(), and update_internal_energy_totals().
|
private |
|
private |
|
private |
|
private |
Referenced by commit_considered_substitution().
|
private |