Rosetta 3.4
Public Member Functions | Protected Member Functions
core::pack::interaction_graph::PDInteractionGraph Class Reference

#include <PDInteractionGraph.hh>

Inheritance diagram for core::pack::interaction_graph::PDInteractionGraph:
Inheritance graph
[legend]
Collaboration diagram for core::pack::interaction_graph::PDInteractionGraph:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 PDInteractionGraph (int num_nodes)
 main constructor: no default nor copy constructors provided.
virtual void initialize (rotamer_set::RotamerSetsBase const &rot_sets)
virtual core::PackerEnergy get_one_body_energy_for_node_state (int node, int state)
 accessor
virtual int get_num_aatypes () const
 sets the number of amino acid types present.
virtual 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
virtual void blanket_assign_state_0 ()
 assigns the state of all nodes in the interaction graph to their unassigned or zero states.
virtual core::PackerEnergy set_state_for_node (int node_ind, int new_state)
 sets the state on node node_ind to new_state
virtual core::PackerEnergy set_network_state (ObjexxFCL::FArray1_int &node_states)
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
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.
virtual core::PackerEnergy get_energy_current_state_assignment ()
 @ brief O(1) total energy report. Protected read access for derived classes.
virtual int get_edge_memory_usage () const
 older scheme for memory accounting -- replace this asap
virtual void print_current_state_assignment () const
 outputs the current state for each node, useful for debugging
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.
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'.
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

Protected Member Functions

virtual unsigned int getMemoryUsageInBytes () const
virtual NodeBasecreate_new_node (int node_index, int num_states)
 factory method that instantiates a PDNode.
virtual EdgeBasecreate_new_edge (int index1, int index2)
 factory method that instantiates a PDEdge
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
PDNodeget_pd_node (int index) const
PDEdge const * get_pd_edge (int node1, int node2) const
PDEdgeget_pd_edge (int node1, int node2)

Constructor & Destructor Documentation

core::pack::interaction_graph::PDInteractionGraph::PDInteractionGraph ( int  num_nodes)

main constructor: no default nor copy constructors provided.

Parameters:
num_nodes- [in] - the number of nodes in this graph

Member Function Documentation

bool core::pack::interaction_graph::PDInteractionGraph::aa_submatrix_energies_retrievable ( ) const [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.

int core::pack::interaction_graph::PDInteractionGraph::aatype_for_node_state ( int  node_ind,
int  node_state 
) const [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().

void core::pack::interaction_graph::PDInteractionGraph::add_edge ( int  index1,
int  index2 
) [virtual]

creates a new edge between nodes index1 and index2. Nodes do not have to be listed in order

InteractionGraphBase::add_edge

Detailed: uses factory method create_new_edge and adds
the created edge to the graph's edge list.
Parameters:
index1- [in] - index of one of the two nodes the edge is to connect
index2- [in] - index of the second of the two nodes the edge is to connect
Global Read:
Global Write:
Remarks:
References:
Authors:
apl
Last Modified:

Reimplemented from core::pack::interaction_graph::InteractionGraphBase.

References core::pack::interaction_graph::PDEdge::force_all_aa_neighbors(), and get_pd_edge().

void core::pack::interaction_graph::PDInteractionGraph::blanket_assign_state_0 ( ) [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(), and get_pd_node().

float core::pack::interaction_graph::PDInteractionGraph::commit_considered_substitution ( ) [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 get_pd_node(), and update_internal_energy_totals().

virtual core::PackerEnergy core::pack::interaction_graph::PDInteractionGraph::commit_considered_substitution ( ObjexxFCL::FArray2D< core::PackerEnergy > const &  weights) [virtual]
void core::pack::interaction_graph::PDInteractionGraph::consider_substitution ( int  node_ind,
int  new_state,
core::PackerEnergy delta_energy,
core::PackerEnergy prev_energy_for_node 
) [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

Parameters:
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 void core::pack::interaction_graph::PDInteractionGraph::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]
unsigned int core::pack::interaction_graph::PDInteractionGraph::count_dynamic_memory ( ) const [virtual]
unsigned int core::pack::interaction_graph::PDInteractionGraph::count_static_memory ( ) const [virtual]
EdgeBase * core::pack::interaction_graph::PDInteractionGraph::create_new_edge ( int  index1,
int  index2 
) [protected, virtual]

factory method that instantiates a PDEdge

Parameters:
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.

NodeBase * core::pack::interaction_graph::PDInteractionGraph::create_new_node ( int  node_index,
int  num_states 
) [protected, virtual]

factory method that instantiates a PDNode.

Parameters:
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.

ObjexxFCL::FArray2D< core::PackerEnergy > core::pack::interaction_graph::PDInteractionGraph::get_aa_submatrix_energies_for_edge ( int  node1,
int  node2,
int  node1aa,
int  node2aa 
) const [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().

int core::pack::interaction_graph::PDInteractionGraph::get_edge_memory_usage ( ) const [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(), and core::pack::interaction_graph::InteractionGraphBase::get_edge_list_end().

float core::pack::interaction_graph::PDInteractionGraph::get_energy_current_state_assignment ( ) [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 update_internal_energy_totals().

float core::pack::interaction_graph::PDInteractionGraph::get_energy_PD_current_state_assignment ( ) [protected]
float core::pack::interaction_graph::PDInteractionGraph::get_energy_sum_for_vertex_group ( int  group_id) [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.

Parameters:
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().

int core::pack::interaction_graph::PDInteractionGraph::get_num_aatypes ( ) const [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

Parameters:
num_aa_types- [in] - the number of amino acid types

Implements core::pack::interaction_graph::FixedBBInteractionGraph.

float core::pack::interaction_graph::PDInteractionGraph::get_one_body_energy_for_node_state ( int  node,
int  state 
) [virtual]
PDEdge* core::pack::interaction_graph::PDInteractionGraph::get_pd_edge ( int  node1,
int  node2 
) [inline, protected]
PDEdge const* core::pack::interaction_graph::PDInteractionGraph::get_pd_edge ( int  node1,
int  node2 
) const [inline, protected]
PDNode* core::pack::interaction_graph::PDInteractionGraph::get_pd_node ( int  index) const [inline, protected]
float core::pack::interaction_graph::PDInteractionGraph::get_weighted_energy ( ObjexxFCL::FArray2D< core::PackerEnergy > const &  weights) const
unsigned int core::pack::interaction_graph::PDInteractionGraph::getMemoryUsageInBytes ( ) const [protected, virtual]
void core::pack::interaction_graph::PDInteractionGraph::initialize ( rotamer_set::RotamerSetsBase const &  rot_sets) [virtual]
void core::pack::interaction_graph::PDInteractionGraph::print_current_state_assignment ( ) const [virtual]
virtual void core::pack::interaction_graph::PDInteractionGraph::set_errorfull_deltaE_threshold ( core::PackerEnergy  ) [inline, virtual]
core::PackerEnergy core::pack::interaction_graph::PDInteractionGraph::set_network_state ( ObjexxFCL::FArray1_int &  node_states,
ObjexxFCL::FArray2D< core::PackerEnergy > const &  weights 
)
virtual core::PackerEnergy core::pack::interaction_graph::PDInteractionGraph::set_network_state ( ObjexxFCL::FArray1_int &  node_states) [virtual]
float core::pack::interaction_graph::PDInteractionGraph::set_state_for_node ( int  node_ind,
int  new_state 
) [virtual]

sets the state on node node_ind to new_state

Parameters:
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(), and update_internal_energy_totals().

void core::pack::interaction_graph::PDInteractionGraph::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(), and get_pd_node().

Referenced by commit_considered_substitution(), get_energy_current_state_assignment(), and set_state_for_node().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines