![]() |
Rosetta
2020.50
|
#include <DoubleLazyInteractionGraph.hh>
Public Member Functions | |
DoubleLazyEdge (InteractionGraphBase *owner, int first_node_ind, int second_node_ind) | |
~DoubleLazyEdge () override | |
void | set_sparse_aa_info (ObjexxFCL::FArray2_bool const &) override |
void | force_aa_neighbors (int node1aa, int node2aa) override |
void | force_all_aa_neighbors () override |
bool | get_sparse_aa_info (int node1aa, int node2aa) const override |
returns whether two amino acid types are represented as neighbors More... | |
core::PackerEnergy | get_two_body_energy (int const node1state, int const node2state) const override |
core::PackerEnergy | get_two_body_energy_smi (int const node1state, int const node2state, SparseMatrixIndex const &node1info, SparseMatrixIndex const &node2info) const |
void | declare_energies_final () override |
void | prepare_for_simulated_annealing () override |
core::PackerEnergy | get_current_two_body_energy () const |
void | acknowledge_state_change (int node_ind, int new_state, SparseMatrixIndex const &new_state_sparse_info, core::PackerEnergy &new_energy) |
void | acknowledge_state_zeroed (int node_ind) |
void | acknowledge_partial_state_change (int node_ind, int new_state, SparseMatrixIndex const &new_state_sparse_info) |
core::PackerEnergy | get_energy_following_partial_state_assignment () |
void | acknowledge_substitution (int substituted_node_index, core::PackerEnergy const curr_state_energy, int nodes_new_state, SparseMatrixIndex const &nodes_new_state_sparse_info) |
void | set_edge_weight (Real weight) override |
int | get_two_body_table_size () const |
void | print_current_energy () const |
bool | build_sc_only_rotamer () |
ObjexxFCL::FArray2D < core::PackerEnergy > | get_aa_submatrix_energies (int node1aa, int node2aa) const |
unsigned int | count_static_memory () const override |
unsigned int | count_dynamic_memory () const override |
unsigned int | actual_twobody_memory_use () const |
unsigned int | potential_twobody_memory_use () const |
void | set_edge_index (int index) |
For use by the DoubleLazyInteractionGraph only; sets the edge index for this edge – this is an arbitrary index, but is used to so that the DLIG can communicate back and forth with this edge. More... | |
int | drop_aa_submatrix (int submat_ind) const |
For use by the DoubleLazyInteractionGraph only; if the DLIG is in "memory conservation" mode, then it may request that its edges drop certain amino acid submatrices which have not been activated for a "long time." This function will cause an amino-acid submatrix to be dropped, and will return the number of bytes that have been freed in the process. "const" but accesses mutable data. More... | |
![]() | |
~OnTheFlyEdge () override | |
OnTheFlyEdge (InteractionGraphBase *owner, int first_node_ind, int second_node_ind) | |
void | set_ProCorrection_values (int node_not_necessarily_proline, int state, core::PackerEnergy bb_regbb_E, core::PackerEnergy bb_probb_E, core::PackerEnergy sc_regbb_E, core::PackerEnergy sc_probb_E) |
void | set_GlyCorrection_values (int node_not_necessarily_glycine, int state, core::PackerEnergy bb_regbb_E, core::PackerEnergy bb_glybb_E, core::PackerEnergy sc_regbb_E, core::PackerEnergy sc_glybb_E) |
core::PackerEnergy | get_proline_correction_for_node (int node_ind, int state) const |
core::PackerEnergy | get_glycine_correction_for_node (int node_ind, int state) const |
unsigned int | count_dynamic_memory () const override |
bool | long_range_interactions_exist () const |
bool | short_range_interactions_exist () const |
void | note_long_range_interactions_exist () |
void | note_short_range_interactions_exist () |
ResiduePairEvalType | eval_type (int node_index) const |
![]() | |
~FixedBBEdge () override | |
FixedBBEdge (InteractionGraphBase *owner, int first_node_ind, int second_node_ind) | |
![]() | |
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... | |
NodeBase * | get_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 |
InteractionGraphBase * | get_owner () |
Static Public Attributes | |
static core::PackerEnergy const | NOT_YET_COMPUTED_ENERGY = -1234 |
Protected Member Functions | |
void | declare_energies_final_no_deletion () |
void | prepare_for_simulated_annealing_no_deletion () |
bool | pd_edge_table_all_zeros () const |
![]() | |
core::PackerEnergy | get_proline_correction (int which_node, int state) const |
core::PackerEnergy | get_glycine_correction (int which_node, int state) const |
OnTheFlyNode const * | get_otf_node (int which_node) const |
OnTheFlyNode * | get_otf_node (int which_node) |
![]() | |
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 |
NodeBase * | get_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... | |
Private Member Functions | |
void | prep_aa_submatrix (int node1aa, int node2aa) const |
core::PackerEnergy | read_aa_submatrix (SparseMatrixIndex node1info, SparseMatrixIndex node2info) const |
void | set_aa_submatrix (SparseMatrixIndex node1info, SparseMatrixIndex node2info, core::PackerEnergy setting) const |
void | get_energy_for_state_pair (int nodes_states[2], SparseMatrixIndex sparse_matrix_indices[2]) |
DoubleLazyNode const * | get_dlazy_node (int index) const |
DoubleLazyNode * | get_dlazy_node (int index) |
DoubleLazyInteractionGraph const * | get_dlazy_ig_owner () const |
DoubleLazyInteractionGraph * | get_dlazy_ig_owner () |
void | wipe_two_body_energies_for_node_state (int node, int state) |
int | submatrix_index (int nod1aa, int node2aa) const |
int | submatrix_size (int node1aa, int node2aa) const |
std::pair< int, int > | aa_indices_from_submatrix_index (int submat_ind) const |
DoubleLazyEdge () | |
DoubleLazyEdge (DoubleLazyEdge const &) | |
DoubleLazyEdge & | operator= (DoubleLazyEdge const &) |
Private Attributes | |
ObjexxFCL::FArray2D< unsigned char > | sparse_aa_neighbors_ |
record which amino acid pairs are neighbors More... | |
ObjexxFCL::FArray2D < ObjexxFCL::FArray2D < core::PackerEnergy > * > | two_body_energies_ |
core::PackerEnergy | curr_state_energy_ |
bool | partial_state_assignment_ |
bool | ran_annealing_since_pair_energy_table_cleared_ |
int | edge_index_ |
core::pack::interaction_graph::DoubleLazyEdge::DoubleLazyEdge | ( | InteractionGraphBase * | owner, |
int | first_node_ind, | ||
int | second_node_ind | ||
) |
par Global Read: |
|
override |
explicity deallocate the FArrays that were dynamically allocated
References two_body_energies_.
|
private |
Referenced by count_static_memory().
|
private |
|
private |
References get_dlazy_ig_owner(), and core::pack::interaction_graph::OnTheFlyInteractionGraph::get_num_aatypes().
Referenced by drop_aa_submatrix().
void core::pack::interaction_graph::DoubleLazyEdge::acknowledge_partial_state_change | ( | int | node_ind, |
int | new_state, | ||
SparseMatrixIndex const & | new_state_sparse_info | ||
) |
par Global Read: |
References core::pack::interaction_graph::DoubleLazyNode::acknowledge_neighbors_partial_state_substitution(), curr_state_energy_, get_dlazy_node(), core::pack::interaction_graph::EdgeBase::get_edges_position_in_nodes_edge_vector(), core::pack::interaction_graph::EdgeBase::get_node_index(), and partial_state_assignment_.
Referenced by core::pack::interaction_graph::DoubleLazyNode::partial_assign_state().
void core::pack::interaction_graph::DoubleLazyEdge::acknowledge_state_change | ( | int | node_ind, |
int | new_state, | ||
SparseMatrixIndex const & | new_state_sparse_info, | ||
core::PackerEnergy & | new_energy | ||
) |
par Global Read: |
References core::pack::interaction_graph::DoubleLazyNode::acknowledge_neighbors_state_substitution(), curr_state_energy_, core::pack::interaction_graph::DoubleLazyNode::get_current_state(), get_dlazy_node(), core::pack::interaction_graph::EdgeBase::get_edges_position_in_nodes_edge_vector(), get_energy_for_state_pair(), and core::pack::interaction_graph::EdgeBase::get_node_index().
Referenced by core::pack::interaction_graph::DoubleLazyNode::assign_state().
void core::pack::interaction_graph::DoubleLazyEdge::acknowledge_state_zeroed | ( | int | node_ind | ) |
par Global Read: |
References core::pack::interaction_graph::DoubleLazyNode::acknowledge_neighbors_state_substitution(), curr_state_energy_, get_dlazy_node(), core::pack::interaction_graph::EdgeBase::get_edges_position_in_nodes_edge_vector(), core::pack::interaction_graph::EdgeBase::get_node_index(), core::pack::interaction_graph::SparseMatrixIndex::set_aa_type(), and core::pack::interaction_graph::SparseMatrixIndex::set_state_ind_for_this_aa_type().
Referenced by core::pack::interaction_graph::DoubleLazyNode::assign_zero_state().
|
inline |
References core::pack::interaction_graph::DoubleLazyNode::acknowledge_neighbors_state_substitution(), curr_state_energy_, get_dlazy_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::DoubleLazyNode::commit_considered_substitution().
unsigned int core::pack::interaction_graph::DoubleLazyEdge::actual_twobody_memory_use | ( | ) | const |
References two_body_energies_.
Referenced by count_dynamic_memory(), and core::pack::interaction_graph::DoubleLazyInteractionGraph::~DoubleLazyInteractionGraph().
|
inline |
|
overridevirtual |
add up all the submatrices
Reimplemented from core::pack::interaction_graph::EdgeBase.
References actual_twobody_memory_use(), core::pack::interaction_graph::OnTheFlyEdge::count_dynamic_memory(), sparse_aa_neighbors_, and two_body_energies_.
|
overridevirtual |
Implements core::pack::interaction_graph::OnTheFlyEdge.
References DoubleLazyEdge().
|
overridevirtual |
Implements core::pack::interaction_graph::EdgeBase.
|
inlineprotected |
References prepare_for_simulated_annealing().
int core::pack::interaction_graph::DoubleLazyEdge::drop_aa_submatrix | ( | int | submat_ind | ) | const |
For use by the DoubleLazyInteractionGraph only; if the DLIG is in "memory conservation" mode, then it may request that its edges drop certain amino acid submatrices which have not been activated for a "long time." This function will cause an amino-acid submatrix to be dropped, and will return the number of bytes that have been freed in the process. "const" but accesses mutable data.
References aa_indices_from_submatrix_index(), submatrix_size(), and two_body_energies_.
|
overridevirtual |
Implements core::pack::interaction_graph::FixedBBEdge.
References sparse_aa_neighbors_.
|
overridevirtual |
Implements core::pack::interaction_graph::FixedBBEdge.
References ran_annealing_since_pair_energy_table_cleared_, and sparse_aa_neighbors_.
ObjexxFCL::FArray2D< core::PackerEnergy > core::pack::interaction_graph::DoubleLazyEdge::get_aa_submatrix_energies | ( | int | node1aa, |
int | node2aa | ||
) | const |
References core::pack::interaction_graph::OnTheFlyNode::compute_rotamer_pair_energy(), edge_index_, get_dlazy_ig_owner(), get_dlazy_node(), core::pack::interaction_graph::EdgeBase::get_edges_position_in_nodes_edge_vector(), core::pack::interaction_graph::OnTheFlyEdge::get_otf_node(), core::pack::interaction_graph::OnTheFlyNode::get_state_offset_for_aatype(), NOT_YET_COMPUTED_ENERGY, core::pack::interaction_graph::DoubleLazyInteractionGraph::note_submatrix_accessed(), prep_aa_submatrix(), sparse_aa_neighbors_, submatrix_index(), and two_body_energies_.
Referenced by core::pack::interaction_graph::DoubleLazyInteractionGraph::get_aa_submatrix_energies_for_edge().
core::PackerEnergy core::pack::interaction_graph::DoubleLazyEdge::get_current_two_body_energy | ( | ) | const |
par Global Read: |
References curr_state_energy_.
Referenced by core::pack::interaction_graph::DoubleLazyNode::update_internal_energy_sums().
|
inlineprivate |
References core::pack::interaction_graph::EdgeBase::get_owner().
Referenced by aa_indices_from_submatrix_index(), get_aa_submatrix_energies(), prep_aa_submatrix(), and submatrix_index().
|
inlineprivate |
|
inlineprivate |
References core::pack::interaction_graph::EdgeBase::get_node().
Referenced by acknowledge_partial_state_change(), acknowledge_state_change(), acknowledge_state_zeroed(), acknowledge_substitution(), get_aa_submatrix_energies(), get_energy_following_partial_state_assignment(), potential_twobody_memory_use(), prep_aa_submatrix(), and submatrix_size().
|
inlineprivate |
core::PackerEnergy core::pack::interaction_graph::DoubleLazyEdge::get_energy_following_partial_state_assignment | ( | ) |
par Global Read: |
References curr_state_energy_, core::pack::interaction_graph::DoubleLazyNode::get_current_state(), get_dlazy_node(), get_energy_for_state_pair(), core::pack::interaction_graph::DoubleLazyNode::get_sparse_mat_info_for_curr_state(), and partial_state_assignment_.
|
private |
par Global Read: |
References curr_state_energy_, get_two_body_energy_smi(), and sparse_aa_neighbors_.
Referenced by acknowledge_state_change(), and get_energy_following_partial_state_assignment().
|
overridevirtual |
returns whether two amino acid types are represented as neighbors
Implements core::pack::interaction_graph::FixedBBEdge.
References sparse_aa_neighbors_.
|
overridevirtual |
core::PackerEnergy core::pack::interaction_graph::DoubleLazyEdge::get_two_body_energy_smi | ( | int const | node1state, |
int const | node2state, | ||
SparseMatrixIndex const & | node1info, | ||
SparseMatrixIndex const & | node2info | ||
) | const |
References core::pack::interaction_graph::OnTheFlyNode::compute_rotamer_pair_energy(), core::pack::interaction_graph::EdgeBase::edge_weight(), core::pack::interaction_graph::SparseMatrixIndex::get_aa_type(), core::pack::interaction_graph::EdgeBase::get_edges_position_in_nodes_edge_vector(), core::pack::interaction_graph::OnTheFlyEdge::get_otf_node(), NOT_YET_COMPUTED_ENERGY, prep_aa_submatrix(), read_aa_submatrix(), set_aa_submatrix(), and sparse_aa_neighbors_.
Referenced by get_energy_for_state_pair(), and get_two_body_energy().
int core::pack::interaction_graph::DoubleLazyEdge::get_two_body_table_size | ( | ) | const |
par Global Read: |
|
private |
|
inlineprotected |
unsigned int core::pack::interaction_graph::DoubleLazyEdge::potential_twobody_memory_use | ( | ) | const |
|
private |
– const to be called within const functions; updates mutable data
References edge_index_, get_dlazy_ig_owner(), get_dlazy_node(), core::pack::interaction_graph::OnTheFlyNode::get_num_states_for_aa_types(), NOT_YET_COMPUTED_ENERGY, core::pack::interaction_graph::DoubleLazyInteractionGraph::note_submatrix_added(), sparse_aa_neighbors_, submatrix_index(), submatrix_size(), and two_body_energies_.
Referenced by get_aa_submatrix_energies(), and get_two_body_energy_smi().
|
overridevirtual |
Implements core::pack::interaction_graph::EdgeBase.
References core::pack::interaction_graph::EdgeBase::mark_edge_for_deletion(), ran_annealing_since_pair_energy_table_cleared_, and sparse_aa_neighbors_.
Referenced by declare_energies_final_no_deletion(), and prepare_for_simulated_annealing_no_deletion().
|
inlineprotected |
References prepare_for_simulated_annealing().
void core::pack::interaction_graph::DoubleLazyEdge::print_current_energy | ( | ) | const |
|
private |
|
private |
updates mutable data
References core::pack::interaction_graph::SparseMatrixIndex::get_aa_type(), core::pack::interaction_graph::SparseMatrixIndex::get_state_ind_for_this_aa_type(), and two_body_energies_.
Referenced by get_two_body_energy_smi().
void core::pack::interaction_graph::DoubleLazyEdge::set_edge_index | ( | int | index | ) |
For use by the DoubleLazyInteractionGraph only; sets the edge index for this edge – this is an arbitrary index, but is used to so that the DLIG can communicate back and forth with this edge.
This function is only invoked if the graph is going to attempt to use a memory-use cap. The edge_index_ serves to both identify that the memory-use cap is in effect, and to allow efficient communication between the graph and its edges.
References edge_index_.
Referenced by core::pack::interaction_graph::DoubleLazyInteractionGraph::prepare_graph_for_simulated_annealing().
|
overridevirtual |
|
overridevirtual |
|
private |
– node1aa and node2aa are both indexed from 1
References get_dlazy_ig_owner(), and core::pack::interaction_graph::OnTheFlyInteractionGraph::get_num_aatypes().
Referenced by get_aa_submatrix_energies(), and prep_aa_submatrix().
|
private |
References get_dlazy_node(), and core::pack::interaction_graph::OnTheFlyNode::get_num_states_for_aa_types().
Referenced by drop_aa_submatrix(), and prep_aa_submatrix().
|
private |
|
private |
|
private |
Referenced by get_aa_submatrix_energies(), prep_aa_submatrix(), and set_edge_index().
|
static |
Referenced by get_aa_submatrix_energies(), get_two_body_energy_smi(), prep_aa_submatrix(), set_edge_weight(), and set_sparse_aa_info().
|
private |
Referenced by acknowledge_partial_state_change(), and get_energy_following_partial_state_assignment().
|
private |
Referenced by force_all_aa_neighbors(), prepare_for_simulated_annealing(), and set_sparse_aa_info().
|
private |
record which amino acid pairs are neighbors
Referenced by count_dynamic_memory(), force_aa_neighbors(), force_all_aa_neighbors(), get_aa_submatrix_energies(), get_energy_for_state_pair(), get_sparse_aa_info(), get_two_body_energy_smi(), potential_twobody_memory_use(), prep_aa_submatrix(), prepare_for_simulated_annealing(), and set_sparse_aa_info().
|
mutableprivate |
Allocate the amino-acid submatrices of the two-body energy table only as needed. In a more advanced version of this graph, these submatrices would be deleted again (and possibly re-instantiated!) after a long time had passed since they were last useful.
Referenced by actual_twobody_memory_use(), count_dynamic_memory(), drop_aa_submatrix(), get_aa_submatrix_energies(), potential_twobody_memory_use(), prep_aa_submatrix(), read_aa_submatrix(), set_aa_submatrix(), set_edge_weight(), set_sparse_aa_info(), and ~DoubleLazyEdge().