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

#include <FASTERInteractionGraph.hh>

Inheritance diagram for core::pack::interaction_graph::FASTEREdge:
Inheritance graph
[legend]

Public Types

typedef PrecomputedPairEnergiesEdge parent
 

Public Member Functions

 FASTEREdge (InteractionGraphBase *owner, int first_node_ind, int second_node_ind)
 main constructor - no default nor copy constructors provided More...
 
 ~FASTEREdge () override
 destructor. All dynamically allocated memory is managed by the objects contained inside the FASTEREdge, so there is no work to be (explicitly) done. More...
 
void set_sparse_aa_info (ObjexxFCL::FArray2_bool const &) override
 
bool get_sparse_aa_info (int, int) const override
 
void add_to_two_body_energy (int const, int const, core::PackerEnergy const) override
 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...
 
void add_to_two_body_energies (ObjexxFCL::FArray2< core::PackerEnergy > const &res_res_energy_array) override
 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...
 
void set_two_body_energy (int const, int const, core::PackerEnergy const) override
 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...
 
void clear_two_body_energy (int const, int const) override
 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...
 
core::PackerEnergy get_two_body_energy (int const, int const ) const override
 returns the two body energy for a pair of states: 0 if those states are not neighbors More...
 
void force_aa_neighbors (int, int) override
 
void force_all_aa_neighbors () override
 
void declare_energies_final () override
 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...
 
void prepare_for_simulated_annealing () override
 looks at all pair energies, and if they are all 0, deletes itself More...
 
virtual void prepare_for_FASTER ()
 
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_partial_state_assignment (int node, int new_state)
 
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...
 
ObjexxFCL::FArray2A
< core::PackerEnergy
get_edge_table_ptr ()
 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...
 
int get_two_body_table_size () const
 returns the memory usage of the two body energy table for this edge More...
 
unsigned int count_static_memory () const override
 returns sizeof FASTEREdge if this is the most-derived instance of the class More...
 
unsigned int count_dynamic_memory () const override
 returns the amount of memory dynamically allocated by the edge and recurses on its parent (in this case, the EdgeBase class) More...
 
core::PackerEnergy get_two_body_energies_for_relaxed_states ()
 
core::PackerEnergy get_curr_state_energy_following_partial_state_assignment ()
 
core::PackerEnergy get_energy_for_perturbed_state (int node, int nodes_perturbed_state)
 
void acknowledge_perturbed_state (int node, int neighbors_context_state)
 
void acknowledge_participation_in_perturbation ()
 
core::PackerEnergy get_deltaE_for_perturbation ()
 
core::PackerEnergy get_deltaE_for_neighbor_following_perturbation (int node_index)
 
void set_edge_weight (Real weight) override
 
void swap_edge_energies (ObjexxFCL::FArray2D< core::PackerEnergy > &new_edge_table)
 
- Public Member Functions inherited from core::pack::interaction_graph::PrecomputedPairEnergiesEdge
 ~PrecomputedPairEnergiesEdge () override
 
 PrecomputedPairEnergiesEdge (InteractionGraphBase *owner, int first_node_ind, int second_node_ind)
 
- Public Member Functions inherited from core::pack::interaction_graph::FixedBBEdge
 ~FixedBBEdge () override
 
 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
 
bool marked_for_deletion () const
 Has this edge indicated that it can be deleted? More...
 
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

FASTERNodeget_faster_node (int index) const
 
FASTERInteractionGraphget_fasterig_owner () const
 
 FASTEREdge ()
 
 FASTEREdge (FASTEREdge const &)
 
FASTEREdgeoperator= (FASTEREdge const &)
 

Private Attributes

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

Friends

class ::FASTERInteractionGraphTests
 

Additional Inherited Members

- Protected Member Functions inherited from core::pack::interaction_graph::EdgeBase
void mark_edge_for_deletion ()
 Mark this edge so that it can be deleted. More...
 
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...
 

Member Typedef Documentation

Constructor & Destructor Documentation

core::pack::interaction_graph::FASTEREdge::FASTEREdge ( 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::FASTEREdge::~FASTEREdge ( )
overridedefault

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

core::pack::interaction_graph::FASTEREdge::FASTEREdge ( )
private

Referenced by count_static_memory().

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

Member Function Documentation

void core::pack::interaction_graph::FASTEREdge::acknowledge_partial_state_assignment ( int  node,
int  new_state 
)
void core::pack::interaction_graph::FASTEREdge::acknowledge_participation_in_perturbation ( )
void core::pack::interaction_graph::FASTEREdge::acknowledge_perturbed_state ( int  node,
int  neighbors_context_state 
)
void core::pack::interaction_graph::FASTEREdge::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::FASTERNode::assign_state().

void core::pack::interaction_graph::FASTEREdge::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::FASTERNode::acknowledge_neighbors_state_substitution(), curr_state_energy_, core::pack::interaction_graph::EdgeBase::get_edges_position_in_nodes_edge_vector(), get_faster_node(), and core::pack::interaction_graph::EdgeBase::get_node_index().

Referenced by core::pack::interaction_graph::FASTERNode::assign_zero_state().

void core::pack::interaction_graph::FASTEREdge::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 core::pack::interaction_graph::FASTERNode::acknowledge_neighbors_state_substitution(), curr_state_energy_, core::pack::interaction_graph::EdgeBase::get_edges_position_in_nodes_edge_vector(), get_faster_node(), and core::pack::interaction_graph::EdgeBase::get_node_index().

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

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

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::FASTEREdge::add_to_two_body_energy ( int const  state1,
int const  state2,
core::PackerEnergy const  energy 
)
overridevirtual

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.

References protocols::buns::energy.

void core::pack::interaction_graph::FASTEREdge::clear_two_body_energy ( int const  state1,
int const  state2 
)
overridevirtual

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::FASTEREdge::count_dynamic_memory ( ) const
overridevirtual

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::FASTEREdge::count_static_memory ( ) const
overridevirtual

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

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

References FASTEREdge().

void core::pack::interaction_graph::FASTEREdge::declare_energies_final ( )
overridevirtual

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

void core::pack::interaction_graph::FASTEREdge::force_aa_neighbors ( int  ,
int   
)
inlineoverridevirtual
void core::pack::interaction_graph::FASTEREdge::force_all_aa_neighbors ( )
inlineoverridevirtual
core::PackerEnergy core::pack::interaction_graph::FASTEREdge::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.

Referenced by core::pack::interaction_graph::FASTERNode::project_deltaE_for_substitution().

core::PackerEnergy core::pack::interaction_graph::FASTEREdge::get_curr_state_energy_following_partial_state_assignment ( )
core::PackerEnergy core::pack::interaction_graph::FASTEREdge::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::FASTERNode::update_internal_energy_sums().

core::PackerEnergy core::pack::interaction_graph::FASTEREdge::get_deltaE_for_neighbor_following_perturbation ( int  node_index)
core::PackerEnergy core::pack::interaction_graph::FASTEREdge::get_deltaE_for_perturbation ( )
FArray2A< core::PackerEnergy > core::pack::interaction_graph::FASTEREdge::get_edge_table_ptr ( )

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.

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

core::PackerEnergy core::pack::interaction_graph::FASTEREdge::get_energy_for_perturbed_state ( int  node,
int  nodes_perturbed_state 
)
FASTERNode* core::pack::interaction_graph::FASTEREdge::get_faster_node ( int  index) const
inlineprivate
FASTERInteractionGraph* core::pack::interaction_graph::FASTEREdge::get_fasterig_owner ( ) const
inlineprivate
bool core::pack::interaction_graph::FASTEREdge::get_sparse_aa_info ( int  ,
int   
) const
inlineoverridevirtual
core::PackerEnergy core::pack::interaction_graph::FASTEREdge::get_two_body_energies_for_relaxed_states ( )
core::PackerEnergy core::pack::interaction_graph::FASTEREdge::get_two_body_energy ( int const  state1,
int const  state2 
) const
overridevirtual

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

References two_body_energies_.

Referenced by get_curr_state_energy_following_partial_state_assignment(), get_energy_for_perturbed_state(), and get_two_body_energies_for_relaxed_states().

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

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

References two_body_energies_.

FASTEREdge& core::pack::interaction_graph::FASTEREdge::operator= ( FASTEREdge const &  )
private
void core::pack::interaction_graph::FASTEREdge::prepare_for_FASTER ( )
virtual
void core::pack::interaction_graph::FASTEREdge::prepare_for_simulated_annealing ( )
overridevirtual
void core::pack::interaction_graph::FASTEREdge::set_edge_weight ( Real  weight)
overridevirtual

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_.

void core::pack::interaction_graph::FASTEREdge::set_sparse_aa_info ( ObjexxFCL::FArray2_bool const &  )
inlineoverridevirtual
void core::pack::interaction_graph::FASTEREdge::set_two_body_energy ( int const  state1,
int const  state2,
core::PackerEnergy const  energy 
)
overridevirtual

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.

References protocols::buns::energy.

void core::pack::interaction_graph::FASTEREdge::swap_edge_energies ( ObjexxFCL::FArray2D< core::PackerEnergy > &  new_edge_table)

Friends And Related Function Documentation

friend class ::FASTERInteractionGraphTests
friend

Member Data Documentation

core::PackerEnergy core::pack::interaction_graph::FASTEREdge::curr_state_energy_
private
bool core::pack::interaction_graph::FASTEREdge::energies_updated_since_last_prep_for_simA_
private
bool core::pack::interaction_graph::FASTEREdge::have_contributed_deltaE_following_perturbation_
private
bool core::pack::interaction_graph::FASTEREdge::partial_state_assignment_
private
ObjexxFCL::FArray2D< core::PackerEnergy > core::pack::interaction_graph::FASTEREdge::two_body_energies_
private

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