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

#include <DoubleLazyInteractionGraph.hh>

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

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...
 
- Public Member Functions inherited from core::pack::interaction_graph::OnTheFlyEdge
 ~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
 
- 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 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
 
- Protected Member Functions inherited from core::pack::interaction_graph::OnTheFlyEdge
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
 
OnTheFlyNodeget_otf_node (int which_node)
 
- 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...
 

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
 
DoubleLazyNodeget_dlazy_node (int index)
 
DoubleLazyInteractionGraph const * get_dlazy_ig_owner () const
 
DoubleLazyInteractionGraphget_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 &)
 
DoubleLazyEdgeoperator= (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_
 

Constructor & Destructor Documentation

core::pack::interaction_graph::DoubleLazyEdge::DoubleLazyEdge ( InteractionGraphBase owner,
int  first_node_ind,
int  second_node_ind 
)
Parameters
par Global Read:
Global Write:
Remarks
References:
Author
apl
core::pack::interaction_graph::DoubleLazyEdge::~DoubleLazyEdge ( )
override

explicity deallocate the FArrays that were dynamically allocated

References two_body_energies_.

core::pack::interaction_graph::DoubleLazyEdge::DoubleLazyEdge ( )
private

Referenced by count_static_memory().

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

Member Function Documentation

std::pair< int, int > core::pack::interaction_graph::DoubleLazyEdge::aa_indices_from_submatrix_index ( int  submat_ind) const
private
void core::pack::interaction_graph::DoubleLazyEdge::acknowledge_partial_state_change ( int  node_ind,
int  new_state,
SparseMatrixIndex const &  new_state_sparse_info 
)
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 
)
void core::pack::interaction_graph::DoubleLazyEdge::acknowledge_state_zeroed ( int  node_ind)
void core::pack::interaction_graph::DoubleLazyEdge::acknowledge_substitution ( int  substituted_node_index,
core::PackerEnergy const  curr_state_energy,
int  nodes_new_state,
SparseMatrixIndex const &  nodes_new_state_sparse_info 
)
inline
unsigned int core::pack::interaction_graph::DoubleLazyEdge::actual_twobody_memory_use ( ) const
bool core::pack::interaction_graph::DoubleLazyEdge::build_sc_only_rotamer ( )
inline
unsigned int core::pack::interaction_graph::DoubleLazyEdge::count_dynamic_memory ( ) const
overridevirtual
unsigned int core::pack::interaction_graph::DoubleLazyEdge::count_static_memory ( ) const
overridevirtual
void core::pack::interaction_graph::DoubleLazyEdge::declare_energies_final ( )
overridevirtual
void core::pack::interaction_graph::DoubleLazyEdge::declare_energies_final_no_deletion ( )
inlineprotected
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_.

void core::pack::interaction_graph::DoubleLazyEdge::force_aa_neighbors ( int  node1aa,
int  node2aa 
)
overridevirtual
void core::pack::interaction_graph::DoubleLazyEdge::force_all_aa_neighbors ( )
overridevirtual
ObjexxFCL::FArray2D< core::PackerEnergy > core::pack::interaction_graph::DoubleLazyEdge::get_aa_submatrix_energies ( int  node1aa,
int  node2aa 
) const
core::PackerEnergy core::pack::interaction_graph::DoubleLazyEdge::get_current_two_body_energy ( ) const
Parameters
par Global Read:
Global Write:
Remarks
References:
Author
apl

References curr_state_energy_.

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

DoubleLazyInteractionGraph const * core::pack::interaction_graph::DoubleLazyEdge::get_dlazy_ig_owner ( ) const
inlineprivate
DoubleLazyInteractionGraph * core::pack::interaction_graph::DoubleLazyEdge::get_dlazy_ig_owner ( )
inlineprivate
DoubleLazyNode const * core::pack::interaction_graph::DoubleLazyEdge::get_dlazy_node ( int  index) const
inlineprivate
DoubleLazyNode * core::pack::interaction_graph::DoubleLazyEdge::get_dlazy_node ( int  index)
inlineprivate
core::PackerEnergy core::pack::interaction_graph::DoubleLazyEdge::get_energy_following_partial_state_assignment ( )
void core::pack::interaction_graph::DoubleLazyEdge::get_energy_for_state_pair ( int  nodes_states[2],
SparseMatrixIndex  sparse_matrix_indices[2] 
)
private
Parameters
par Global Read:
Global Write:
Remarks
References:
Author
apl

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

bool core::pack::interaction_graph::DoubleLazyEdge::get_sparse_aa_info ( int  node1aa,
int  node2aa 
) const
overridevirtual

returns whether two amino acid types are represented as neighbors

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

References sparse_aa_neighbors_.

core::PackerEnergy core::pack::interaction_graph::DoubleLazyEdge::get_two_body_energy ( int const  node1state,
int const  node2state 
) const
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
int core::pack::interaction_graph::DoubleLazyEdge::get_two_body_table_size ( ) const
Parameters
par Global Read:
Global Write:
Remarks
References:
Author
apl
DoubleLazyEdge& core::pack::interaction_graph::DoubleLazyEdge::operator= ( DoubleLazyEdge const &  )
private
bool core::pack::interaction_graph::DoubleLazyEdge::pd_edge_table_all_zeros ( ) const
inlineprotected
unsigned int core::pack::interaction_graph::DoubleLazyEdge::potential_twobody_memory_use ( ) const
void core::pack::interaction_graph::DoubleLazyEdge::prep_aa_submatrix ( int  node1aa,
int  node2aa 
) const
private
void core::pack::interaction_graph::DoubleLazyEdge::prepare_for_simulated_annealing ( )
overridevirtual
void core::pack::interaction_graph::DoubleLazyEdge::prepare_for_simulated_annealing_no_deletion ( )
inlineprotected
void core::pack::interaction_graph::DoubleLazyEdge::print_current_energy ( ) const
core::PackerEnergy core::pack::interaction_graph::DoubleLazyEdge::read_aa_submatrix ( SparseMatrixIndex  node1info,
SparseMatrixIndex  node2info 
) const
private
void core::pack::interaction_graph::DoubleLazyEdge::set_aa_submatrix ( SparseMatrixIndex  node1info,
SparseMatrixIndex  node2info,
core::PackerEnergy  setting 
) const
private
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().

void core::pack::interaction_graph::DoubleLazyEdge::set_edge_weight ( Real  weight)
overridevirtual
void core::pack::interaction_graph::DoubleLazyEdge::set_sparse_aa_info ( ObjexxFCL::FArray2_bool const &  aa_neighbors)
overridevirtual
int core::pack::interaction_graph::DoubleLazyEdge::submatrix_index ( int  node1aa,
int  node2aa 
) const
private
int core::pack::interaction_graph::DoubleLazyEdge::submatrix_size ( int  node1aa,
int  node2aa 
) const
private
void core::pack::interaction_graph::DoubleLazyEdge::wipe_two_body_energies_for_node_state ( int  node,
int  state 
)
private

Member Data Documentation

core::PackerEnergy core::pack::interaction_graph::DoubleLazyEdge::curr_state_energy_
private
int core::pack::interaction_graph::DoubleLazyEdge::edge_index_
private
core::PackerEnergy const core::pack::interaction_graph::DoubleLazyEdge::NOT_YET_COMPUTED_ENERGY = -1234
static
bool core::pack::interaction_graph::DoubleLazyEdge::partial_state_assignment_
private
bool core::pack::interaction_graph::DoubleLazyEdge::ran_annealing_since_pair_energy_table_cleared_
private
ObjexxFCL::FArray2D< unsigned char > core::pack::interaction_graph::DoubleLazyEdge::sparse_aa_neighbors_
private
ObjexxFCL::FArray2D< ObjexxFCL::FArray2D< core::PackerEnergy > * > core::pack::interaction_graph::DoubleLazyEdge::two_body_energies_
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().


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