Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
core::pack::interaction_graph::DoubleDensePDEdge Class Reference

#include <DoubleDensePDInteractionGraph.hh>

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

Public Member Functions

 DoubleDensePDEdge (InteractionGraphBase *owner, int first_node_ind, int second_node_ind)
 main constructor - no default nor copy constructors provided More...
 
virtual ~DoubleDensePDEdge ()
 destructor. All dynamically allocated memory is managed by the objects contained inside the DoubleDensePDEdge, so there is no work to be (explicitly) done. More...
 
virtual void set_sparse_aa_info (ObjexxFCL::FArray2_bool const &)
 
virtual bool get_sparse_aa_info (int, int) const
 
virtual void add_to_two_body_energy (int const, int const, core::PackerEnergy const)
 adds the input energy to the two body energy for state1 on the node with the smaller index and state2 on the node with the larger index. More...
 
virtual void add_to_two_body_energies (ObjexxFCL::FArray2< core::PackerEnergy > const &res_res_energy_array)
 Adds all the energies stored in the oversized_res_res_energy array to the two body energy table for those states whose amion acid types were previoudsly declared to be amino-acid neighbors. The res-res array should have the dimension (node1->get_num_states() x node2->get_num_states());. More...
 
virtual void set_two_body_energy (int const, int const, core::PackerEnergy const)
 Sets the two-body energy for a pair of states. That is, it overwrites whatever two-body energy there was previously for that state pair with a new energy. Ignores non-neighboring state pairs. More...
 
virtual void clear_two_body_energy (int const, int const)
 Sets the two-body energy for a pair of states. That is, it overwrites whatever two-body energy there was previously for that state pair with a new energy. Ignores non-neighboring state pairs. More...
 
virtual core::PackerEnergy get_two_body_energy (int const, int const ) const
 returns the two body energy for a pair of states: 0 if those states are not neighbors More...
 
virtual void force_aa_neighbors (int, int)
 
virtual void force_all_aa_neighbors ()
 
virtual void declare_energies_final ()
 If all of the energies for an edge have been added in, then declare the edge energies final. This may mean that the edge deletes itself. More...
 
virtual void prepare_for_simulated_annealing ()
 looks at all pair energies, and if they are all 0, deletes itself More...
 
core::PackerEnergy get_current_two_body_energy ()
 returns the two body energy corresponding to the current states assigned to the nodes this edge is incident upon. More...
 
void acknowledge_state_change (int node_ind, int new_state, core::PackerEnergy &new_energy)
 updates bookkeeping information when one of the two nodes changes its state More...
 
void acknowledge_state_zeroed (int node_ind)
 updates bookkeeping information when one of the two nodes enters its "unassigned" state. More...
 
void acknowledge_substitution (int substituted_node_index, core::PackerEnergy const curr_state_energy, int nodes_new_state)
 update bookkeeping information when one of the nodes an edge is incident upon changes state More...
 
int get_two_body_table_size () const
 Returns a reference to the first element in the dense two-body energy table. Used to create a proxy array on the nodes for cache efficiency. More...
 
virtual unsigned int count_static_memory () const
 returns sizeof DoubleDensePDEdge if this is the most-derived instance of the class More...
 
virtual unsigned int count_dynamic_memory () const
 returns the amount of memory dynamically allocated by the edge and recurses on its parent (in this case, the EdgeBase class) More...
 
virtual void set_edge_weight (Real weight)
 
- Public Member Functions inherited from core::pack::interaction_graph::PrecomputedPairEnergiesEdge
virtual ~PrecomputedPairEnergiesEdge ()
 
 PrecomputedPairEnergiesEdge (InteractionGraphBase *owner, int first_node_ind, int second_node_ind)
 
- Public Member Functions inherited from core::pack::interaction_graph::FixedBBEdge
virtual ~FixedBBEdge ()
 
 FixedBBEdge (InteractionGraphBase *owner, int first_node_ind, int second_node_ind)
 
- Public Member Functions inherited from core::pack::interaction_graph::EdgeBase
virtual ~EdgeBase ()
 copy constructor, do not use More...
 
 EdgeBase (InteractionGraphBase *owner, int first_node_ind, int second_node_ind)
 main constructor for edge, no default nor copy constructors More...
 
int get_other_ind (int callers_index) const
 returns the index of the other node that the edge is incident upon More...
 
NodeBaseget_other_node (int callers_index) const
 returns a pointer to the other node that the edge is incident upon More...
 
int get_first_node_ind () const
 returns the index of the smaller-indexed node More...
 
int get_second_node_ind () const
 returns the index of the larger-indexed node More...
 
void set_pos_in_owners_list (std::list< EdgeBase * >::iterator edge_iterator)
 edge keeps iterator to its position in it's owner's edge list More...
 
void set_pos_in_node_edgevector (int callers_index, int position)
 edge keeps index it has in node_ind's edge vector More...
 
bool same_edge (int node1, int node2) const
 returns true if this edge connects nodes of index node1 and node2 the order of node1 and node2 is not important More...
 
Real edge_weight () const
 
InteractionGraphBase const * get_owner () const
 
InteractionGraphBaseget_owner ()
 

Static Public Member Functions

static core::PackerEnergy get_alternate_state_energy (int first_node_state, int second_node_state, ObjexxFCL::FArray2< core::PackerEnergy > &edge_energy_table)
 static method that looks up the two body energy when the node with the smaller index on an edge is considering an alternate state More...
 

Private Member Functions

DoubleDensePDNodeget_dpd_node (int index) const
 
DoubleDensePDInteractionGraphget_dpdig_owner () const
 
 DoubleDensePDEdge ()
 
 DoubleDensePDEdge (DoubleDensePDEdge const &)
 
DoubleDensePDEdgeoperator= (DoubleDensePDEdge const &)
 

Private Attributes

ObjexxFCL::FArray2D
< core::PackerEnergy
two_body_energies_
 
core::PackerEnergy curr_state_energy_
 
bool energies_updated_since_last_prep_for_simA_
 

Additional Inherited Members

- Protected Member Functions inherited from core::pack::interaction_graph::EdgeBase
int get_node_index (int index) const
 
int get_num_states_for_node (int index) const
 
NodeBase const * get_node (int index) const
 
NodeBaseget_node (int index)
 
int get_edges_position_in_nodes_edge_vector (int index) const
 
int which_node (int node_index) const
 is a node the first or second node this edge is incident upon? More...
 
void edge_weight (Real)
 protected setter of the edge weight. To be called by derived classes after they have completed the conversion from the previous edge weighting to the new edge weighting. More...
 

Constructor & Destructor Documentation

core::pack::interaction_graph::DoubleDensePDEdge::DoubleDensePDEdge ( InteractionGraphBase owner,
int  first_node_ind,
int  second_node_ind 
)

main constructor - no default nor copy constructors provided

Parameters
owner- [in] - pointer to the graph that created this node
first_node_ind- [in] - the index of the smaller-indexed node
second_node_ind- [in] - the index of the larger-indexed node
core::pack::interaction_graph::DoubleDensePDEdge::~DoubleDensePDEdge ( )
virtual

destructor. All dynamically allocated memory is managed by the objects contained inside the DoubleDensePDEdge, so there is no work to be (explicitly) done.

core::pack::interaction_graph::DoubleDensePDEdge::DoubleDensePDEdge ( )
private

Referenced by count_static_memory().

core::pack::interaction_graph::DoubleDensePDEdge::DoubleDensePDEdge ( DoubleDensePDEdge const &  )
private

Member Function Documentation

void core::pack::interaction_graph::DoubleDensePDEdge::acknowledge_state_change ( int  node_ind,
int  new_state,
core::PackerEnergy new_energy 
)

updates bookkeeping information when one of the two nodes changes its state

Parameters
node_ind- [in] - the index of the node that changed its state
node_state- [in] - the index of the new state it assumed
new_energy- [out] - the two body energy produced by the new state and the current state on the other node

Referenced by core::pack::interaction_graph::DoubleDensePDNode::assign_state().

void core::pack::interaction_graph::DoubleDensePDEdge::acknowledge_state_zeroed ( int  node_ind)

updates bookkeeping information when one of the two nodes enters its "unassigned" state.

Parameters
node_ind- [in] - the index of the node that has just entered its 0 state

References core::pack::interaction_graph::DoubleDensePDNode::acknowledge_neighbors_state_substitution(), curr_state_energy_, get_dpd_node(), core::pack::interaction_graph::EdgeBase::get_edges_position_in_nodes_edge_vector(), and core::pack::interaction_graph::EdgeBase::get_node_index().

void core::pack::interaction_graph::DoubleDensePDEdge::acknowledge_substitution ( int  substituted_node_index,
core::PackerEnergy const  curr_state_energy,
int  nodes_new_state 
)
inline

update bookkeeping information when one of the nodes an edge is incident upon changes state

Parameters
substituted_node_index- [in] - index of the node that chagned its state
curr_state_energy- [in] - the two body energy given the new state
nodes_new_state- [in] - the state the node just transitioned into
nodes_new_state_sparse_info- [in] - sparse matrix info for the new state

References curr_state_energy_, get_dpd_node(), core::pack::interaction_graph::EdgeBase::get_edges_position_in_nodes_edge_vector(), and core::pack::interaction_graph::EdgeBase::get_node_index().

Referenced by core::pack::interaction_graph::DoubleDensePDNode::commit_considered_substitution().

void core::pack::interaction_graph::DoubleDensePDEdge::add_to_two_body_energies ( ObjexxFCL::FArray2< core::PackerEnergy > const &  res_res_energy_array)
virtual

Adds all the energies stored in the oversized_res_res_energy array to the two body energy table for those states whose amion acid types were previoudsly declared to be amino-acid neighbors. The res-res array should have the dimension (node1->get_num_states() x node2->get_num_states());.

Parameters
res_res_energy_array- [in] - an array containing the state pair energies

Implements core::pack::interaction_graph::PrecomputedPairEnergiesEdge.

void core::pack::interaction_graph::DoubleDensePDEdge::add_to_two_body_energy ( int const  state1,
int const  state2,
core::PackerEnergy const  energy 
)
virtual

adds the input energy to the two body energy for state1 on the node with the smaller index and state2 on the node with the larger index.

Implements core::pack::interaction_graph::PrecomputedPairEnergiesEdge.

void core::pack::interaction_graph::DoubleDensePDEdge::clear_two_body_energy ( int const  state1,
int const  state2 
)
virtual

Sets the two-body energy for a pair of states. That is, it overwrites whatever two-body energy there was previously for that state pair with a new energy. Ignores non-neighboring state pairs.

Parameters
state1- [in] - state index for the node with the smaller index
state2- [in] - state index for the node with the larger index
energy- [in] - the energy which replaces the old two-body energy

Implements core::pack::interaction_graph::PrecomputedPairEnergiesEdge.

unsigned int core::pack::interaction_graph::DoubleDensePDEdge::count_dynamic_memory ( ) const
virtual

returns the amount of memory dynamically allocated by the edge and recurses on its parent (in this case, the EdgeBase class)

Reimplemented from core::pack::interaction_graph::EdgeBase.

References core::pack::interaction_graph::EdgeBase::count_dynamic_memory(), and two_body_energies_.

unsigned int core::pack::interaction_graph::DoubleDensePDEdge::count_static_memory ( ) const
virtual

returns sizeof DoubleDensePDEdge if this is the most-derived instance of the class

Implements core::pack::interaction_graph::EdgeBase.

References DoubleDensePDEdge().

void core::pack::interaction_graph::DoubleDensePDEdge::declare_energies_final ( )
virtual

If all of the energies for an edge have been added in, then declare the edge energies final. This may mean that the edge deletes itself.

Implements core::pack::interaction_graph::EdgeBase.

References prepare_for_simulated_annealing().

virtual void core::pack::interaction_graph::DoubleDensePDEdge::force_aa_neighbors ( int  ,
int   
)
inlinevirtual
virtual void core::pack::interaction_graph::DoubleDensePDEdge::force_all_aa_neighbors ( )
inlinevirtual
core::PackerEnergy core::pack::interaction_graph::DoubleDensePDEdge::get_alternate_state_energy ( int  first_node_state,
int  second_node_state,
ObjexxFCL::FArray2< core::PackerEnergy > &  edge_energy_table 
)
inlinestatic

static method that looks up the two body energy when the node with the smaller index on an edge is considering an alternate state

Parameters
first_node_alt_state- [in] - the alternate state for the lower-indexed node
second_node_orig_state- [in] - the current state for the higher-indexed node
edge_energy_table- [in] - the proxy FArray pointing at the edge table connecting the two nodes.
core::PackerEnergy core::pack::interaction_graph::DoubleDensePDEdge::get_current_two_body_energy ( )

returns the two body energy corresponding to the current states assigned to the nodes this edge is incident upon.

References curr_state_energy_.

Referenced by core::pack::interaction_graph::DoubleDensePDNode::update_internal_energy_sums().

DoubleDensePDNode* core::pack::interaction_graph::DoubleDensePDEdge::get_dpd_node ( int  index) const
inlineprivate
DoubleDensePDInteractionGraph* core::pack::interaction_graph::DoubleDensePDEdge::get_dpdig_owner ( ) const
inlineprivate
virtual bool core::pack::interaction_graph::DoubleDensePDEdge::get_sparse_aa_info ( int  ,
int   
) const
inlinevirtual
core::PackerEnergy core::pack::interaction_graph::DoubleDensePDEdge::get_two_body_energy ( int const  state1,
int const  state2 
) const
virtual

returns the two body energy for a pair of states: 0 if those states are not neighbors

Parameters
state1- [in] - state index for the node with the smaller index
state2- [in] - state index for the node with the larger index

Implements core::pack::interaction_graph::FixedBBEdge.

References two_body_energies_.

Referenced by core::pack::interaction_graph::DoubleDensePDNode::update_internal_vectors().

int core::pack::interaction_graph::DoubleDensePDEdge::get_two_body_table_size ( ) const

Returns a reference to the first element in the dense two-body energy table. Used to create a proxy array on the nodes for cache efficiency.

returns the memory usage of the two body energy table for this edge

References two_body_energies_.

DoubleDensePDEdge& core::pack::interaction_graph::DoubleDensePDEdge::operator= ( DoubleDensePDEdge const &  )
private
void core::pack::interaction_graph::DoubleDensePDEdge::prepare_for_simulated_annealing ( )
virtual

looks at all pair energies, and if they are all 0, deletes itself

Implements core::pack::interaction_graph::EdgeBase.

References energies_updated_since_last_prep_for_simA_, and two_body_energies_.

Referenced by declare_energies_final().

void core::pack::interaction_graph::DoubleDensePDEdge::set_edge_weight ( Real  weight)
virtual

DANGER: If for some reason one were to reweight edges during simulated annealing then some of the cached energies in the adjacent nodes would be out-of-date; data integrity would be violated an all hell would break loose. The same thing is true if one were to change the energies on any edge during simulated annealing. One simple solution: call blanket_assign_state0 to wipe all cahced energies stored on nodes and then assign_network_state to the state just before the reweighting. Of course, since the annealer itself is tracking the "best" network state, you'd have to worry about its data integrity as well. General advice: don't change energies during simA.

Implements core::pack::interaction_graph::EdgeBase.

References curr_state_energy_, core::pack::interaction_graph::EdgeBase::edge_weight(), and two_body_energies_.

virtual void core::pack::interaction_graph::DoubleDensePDEdge::set_sparse_aa_info ( ObjexxFCL::FArray2_bool const &  )
inlinevirtual
void core::pack::interaction_graph::DoubleDensePDEdge::set_two_body_energy ( int const  state1,
int const  state2,
core::PackerEnergy const  energy 
)
virtual

Sets the two-body energy for a pair of states. That is, it overwrites whatever two-body energy there was previously for that state pair with a new energy. Ignores non-neighboring state pairs.

Parameters
state1- [in] - state index for the node with the smaller index
state2- [in] - state index for the node with the larger index
energy- [in] - the energy which replaces the old two-body energy

Implements core::pack::interaction_graph::PrecomputedPairEnergiesEdge.

Member Data Documentation

core::PackerEnergy core::pack::interaction_graph::DoubleDensePDEdge::curr_state_energy_
private
bool core::pack::interaction_graph::DoubleDensePDEdge::energies_updated_since_last_prep_for_simA_
private
ObjexxFCL::FArray2D< core::PackerEnergy > core::pack::interaction_graph::DoubleDensePDEdge::two_body_energies_
private

The documentation for this class was generated from the following files: