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

#include <LazyInteractionGraph.hh>

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

Public Member Functions

 LazyInteractionGraph (int numNodes)
 
 ~LazyInteractionGraph () override
 
void blanket_assign_state_0 () override
 
core::PackerEnergy set_state_for_node (int node_ind, int new_state) override
 
core::PackerEnergy set_network_state (ObjexxFCL::FArray1_int &node_states) override
 
void consider_substitution (int node_ind, int new_state, core::PackerEnergy &delta_energy, core::PackerEnergy &prev_energy_for_node) override
 
core::PackerEnergy commit_considered_substitution () override
 
core::PackerEnergy get_energy_current_state_assignment () override
 
int get_edge_memory_usage () const override
 
void print_current_state_assignment () const override
 
void set_errorfull_deltaE_threshold (core::PackerEnergy deltaE) override
 
core::PackerEnergy get_energy_sum_for_vertex_group (int group_id) override
 
bool aa_submatrix_energies_retrievable () const override
 Override the FixedBBInteractionGraph class's implementation of this function to return 'true'. More...
 
int aatype_for_node_state (int node_ind, int node_state) const override
 
ObjexxFCL::FArray2D
< core::PackerEnergy
get_aa_submatrix_energies_for_edge (int node1, int node2, int node1aa, int node2aa) const override
 
unsigned int count_static_memory () const override
 
unsigned int count_dynamic_memory () const override
 
- Public Member Functions inherited from core::pack::interaction_graph::OnTheFlyInteractionGraph
 OnTheFlyInteractionGraph (int num_nodes)
 
 ~OnTheFlyInteractionGraph () override
 
void initialize (pack_basic::RotamerSetsBase const &rot_sets) override
 
int get_num_aatypes () const override
 
bool distinguish_backbone_and_sidechain_for_node (int node) const
 
void distinguish_backbone_and_sidechain_for_node (int node, bool setting)
 
void set_score_function (ScoreFunction const &)
 
void set_pose (Pose const &)
 
Pose const & pose () const
 
Posenon_const_pose ()
 debugging only – modify the pose during simulated annealing, if you're so inclined More...
 
ScoreFunction const & score_function () const
 
void zero_one_body_energy_for_node_state (int node_ind, int state)
 
void add_to_one_body_energy_for_node_state (int node_ind, int state, core::PackerEnergy one_body_energy)
 
void set_one_body_energy_for_node_state (int node_ind, int state, core::PackerEnergy one_body_energy)
 
core::PackerEnergy get_one_body_energy_for_node_state (int node, int state) override
 
void set_sparse_aa_info_for_edge (int node1, int node2, ObjexxFCL::FArray2_bool const &sparse_conn_info)
 
void reset_rpe_calculations_count ()
 
Size get_num_rpe_calculations_count () const
 
void note_rpe_calculated () const
 to be called by owned OTF node only More...
 
void set_ProCorrection_values_for_edge (int node1, int node2, int node_not_neccessarily_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_for_edge (int node1, int node2, int node_not_neccessarily_glycine, int state, core::PackerEnergy bb_regbb_E, core::PackerEnergy bb_glybb_E, core::PackerEnergy sc_regbb_E, core::PackerEnergy sc_glybb_E)
 
void note_short_range_interactions_exist_for_edge (int node1, int node2)
 
void note_long_range_interactions_exist_for_edge (int node1, int node2)
 
unsigned int count_dynamic_memory () const override
 
- Public Member Functions inherited from core::pack::interaction_graph::FixedBBInteractionGraph
 ~FixedBBInteractionGraph () override
 
 FixedBBInteractionGraph (int num_nodes)
 
void set_sparse_aa_info_for_edge (int node1, int node2, ObjexxFCL::FArray2_bool const &sparse_conn_info)
 interface to PDEdge::set_sparse_aa_info More...
 
bool get_sparse_aa_info_for_edge (int node1, int node2, int node1aa, int node2aa)
 returns true if node1aa and node2aa are amino acid neighbors More...
 
void force_aa_neighbors_for_edge (int node1, int node2, int node1aa, int node2aa)
 interface to FixedBBEdge::force_aa_neighbors More...
 
void force_all_aa_neighbors_for_edge (int node1, int node2)
 interface to PDEdge::force_aa_neighbors More...
 
virtual core::PackerEnergy get_two_body_energy_for_edge (int node1, int node2, int state_node1, int state_node2) const
 interface to FixedBBEdge::get_two_body_energy More...
 
- Public Member Functions inherited from core::pack::interaction_graph::InteractionGraphBase
 ~InteractionGraphBase () override
 destructor More...
 
 InteractionGraphBase (int num_nodes)
 main constructor More...
 
int get_num_nodes () const override
 Get the number of nodes in the graph. More...
 
void set_num_states_for_node (int node, int num_states)
 sets the number of states for a node of a particular index NEW REQUIREMENT: Nodes must have their num-states set in ascending order by node index; that is, node 1 must go first, node 2 next, and so on. More...
 
int get_num_states_for_node (int node) const override
 returns the number of states for a particular node More...
 
int get_num_total_states () const override
 Get the total number of states. More...
 
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 More...
 
bool get_edge_exists (int node1, int node2) const
 returns true if an edge between node1 and node2 exists More...
 
void drop_all_edges_for_node (int node)
 deletes all edges adjacent to the node specified More...
 
void print_vertices () const
 calls print() on each of the nodes in the graph More...
 
virtual void print () const
 
void output_connectivity (std::ostream &os) const
 writes out a list of all the edges in the graph More...
 
void output_dimacs (std::ostream &os) const
 writes out a connectivity description of the graph in the famous dimacs format. (where the first column "DIMACS:" should be sed'ed out) More...
 
void set_onebody_energies_multithreaded (core::Size const node_index, core::pack::rotamer_set::RotamerSetCOP rotset, core::pose::Pose const &pose, core::scoring::ScoreFunction const &sfxn, task::PackerTask const &task, utility::graph::GraphCOP packer_neighbor_graph, basic::thread_manager::RosettaThreadAssignmentInfo const &thread_assignments)
 Compute and store the onebody energy for all rotamers at a position. Safe for a multithreaded context. More...
 
void prepare_graph_for_simulated_annealing () override
 iterate across edges and nodes and allow them to prepare for simulated annealing More...
 
void set_edge_weight (int node1, int node2, Real edge_weight)
 
Real get_edge_weight (int node1, int node2) const
 
bool any_vertex_state_unassigned () const override
 Returns true if any node in the graph is in state 0, the unassigned state. More...
 
void add_to_one_body_energies (ObjexxFCL::FArray1< core::PackerEnergy > &one_body_energies)
 takes one FArray of energies – one energy for each state for each node More...
 
void update_one_body_energies (ObjexxFCL::FArray1< core::PackerEnergy > &old_energy1b, ObjexxFCL::FArray1< core::PackerEnergy > &new_energy1b)
 decrements the one body energies by the values held in old_energy1b, increments the one body energies by the values held in new_energy1b, and copies new_energy1b into old_energy1b. More...
 
void zero_one_body_energies_for_node (int node)
 
void add_to_nodes_one_body_energy (int node_ind, utility::vector1< core::PackerEnergy > const &one_body_energies)
 
void add_to_nodes_one_body_energy (int node_ind, ObjexxFCL::FArray1< core::PackerEnergy > const &one_body_energies)
 
void add_to_nodes_one_body_energy (int node_ind, int state_id, core::PackerEnergy const one_body_energy)
 interface to PrecomputedPairEnergiesNode::add_to_nodes_one_body_energy More...
 
void set_number_of_energy_sum_vertex_groups (int num_groups)
 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.) More...
 
void set_vertex_member_of_group (int vertex, int group)
 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.) More...
 
void print_vertex_groups ()
 
int count_connected_components_and_initialize_vertex_groups ()
 makes a depth first traversal of the graph, counting the number of connected components, and initializes the vertex group memberships to reflect the connected components. Returns the number of connected components in the graph. More...
 
void note_vertex_reached (int node_index)
 marks a vertex as belonging to the connected component currently being traversed in the depth first traversal. More...
 
bool vertex_already_reached (int node_index)
 used by class NodeBase during the depth-first traversal to determine the number of connected components in the graph. returns true if the dft has already reached the node. More...
 
bool get_vertex_member_of_energy_sum_group (int node_index, int group_id)
 
virtual unsigned int getTotalMemoryUsage () const
 
void reset_edge_list_iterator_for_node (int node_index) const
 set the Graph's (single) edge list iterator to the beginning of the edge list for a particular node More...
 
void increment_edge_list_iterator () const
 increment the (single) edge list iterator to the next element More...
 
bool edge_list_iterator_at_end () const
 test: have we arrived at the edge list end? More...
 
EdgeBase const & get_edge () const
 return a const reference to an edge pointed at by the list iterator More...
 
virtual void declare_all_edge_energies_final ()
 Iterates over all edges and calls declare_energies_final() on all of them. Takes O(N) time, where N is the number of edges. More...
 
EdgeBase const * find_edge (int node1, int node2, bool const use_threadsafe_lookup=false) const
 Find an edge and return a const pointer to it. More...
 
EdgeBasefind_edge (int node1, int node2, bool const use_threadsafe_lookup=false)
 Find an edge and return a nonconst pointer to it. More...
 
NodeBaseget_node (int index) const
 
int get_num_edges () const
 
std::list< EdgeBase * >::iterator get_edge_list_begin ()
 
std::list< EdgeBase * >::iterator get_edge_list_end ()
 
std::list< EdgeBase * >
::const_iterator 
get_edge_list_begin () const
 
std::list< EdgeBase * >
::const_iterator 
get_edge_list_end () const
 
- Public Member Functions inherited from core::pack::interaction_graph::AnnealableGraphBase
 AnnealableGraphBase ()
 Constructor. More...
 
 AnnealableGraphBase (AnnealableGraphBase const &src)
 Copy constructor. More...
 
 ~AnnealableGraphBase () override
 Destructor. More...
 
virtual void clean_up_after_packing (core::pose::Pose &pose)
 Provide the opportunity for an AnnealableGraph to clean up cached data in the pose or inside itself after packing. More...
 

Protected Member Functions

NodeBasecreate_new_node (int node_index, int num_states) override
 
EdgeBasecreate_new_edge (int index1, int index2) override
 
core::PackerEnergy get_energy_PD_current_state_assignment ()
 
void update_internal_energy_totals ()
 
LazyNode const * get_lazy_node (int index) const
 
LazyNodeget_lazy_node (int index)
 
LazyEdge const * get_lazy_edge (int node1, int node2) const
 
LazyEdgeget_lazy_edge (int node1, int node2)
 
- Protected Member Functions inherited from core::pack::interaction_graph::OnTheFlyInteractionGraph
OnTheFlyNodeget_on_the_fly_node (int node_index)
 
OnTheFlyNode const * get_on_the_fly_node (int node_index) const
 
- Protected Member Functions inherited from core::pack::interaction_graph::FixedBBInteractionGraph
FixedBBNode const * get_fixedbb_node (int node_index) const
 Downcasts. More...
 
FixedBBNodeget_fixedbb_node (int node_index)
 
FixedBBEdge const * get_fixedbb_edge (int node1, int node2) const
 
FixedBBEdgeget_fixedbb_edge (int node1, int node2)
 
- Protected Member Functions inherited from core::pack::interaction_graph::InteractionGraphBase
void clean_up_edges_marked_for_deletion ()
 Remove those edges that have marked themselves for deletion. More...
 
void drop_edge (std::list< EdgeBase * >::iterator edge)
 removes edge from edge list at iterator iter More...
 
int get_node_state_offset (int index) const
 
bool mine (EdgeBase const *edge) const
 

Private Member Functions

 LazyInteractionGraph ()
 
 LazyInteractionGraph (LazyInteractionGraph const &)
 
LazyInteractionGraphoperator= (LazyInteractionGraph const &)
 

Private Attributes

int num_aa_types_
 
int num_commits_since_last_update_
 
core::PackerEnergy total_energy_current_state_assignment_
 
core::PackerEnergy total_energy_alternate_state_assignment_
 
int node_considering_alt_state_
 

Static Private Attributes

static const int COMMIT_LIMIT_BETWEEN_UPDATES = 1024
 

Additional Inherited Members

- Public Types inherited from core::pack::interaction_graph::OnTheFlyInteractionGraph
typedef pose::Pose Pose
 
typedef pose::PoseOP PoseOP
 
typedef scoring::ScoreFunction ScoreFunction
 
typedef scoring::ScoreFunctionOP ScoreFunctionOP
 

Constructor & Destructor Documentation

core::pack::interaction_graph::LazyInteractionGraph::LazyInteractionGraph ( int  numNodes)
Parameters
par Global Read:
Global Write:
Remarks
References:
Author
apl
core::pack::interaction_graph::LazyInteractionGraph::~LazyInteractionGraph ( )
overridedefault
Parameters
par Global Read:
Global Write:
Remarks
References:
Author
apl
core::pack::interaction_graph::LazyInteractionGraph::LazyInteractionGraph ( )
private

Referenced by count_static_memory().

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

Member Function Documentation

bool core::pack::interaction_graph::LazyInteractionGraph::aa_submatrix_energies_retrievable ( ) const
overridevirtual

Override the FixedBBInteractionGraph class's implementation of this function to return 'true'.

LazyInteractionGraph will return aa submatrices as requested.

Reimplemented from core::pack::interaction_graph::FixedBBInteractionGraph.

int core::pack::interaction_graph::LazyInteractionGraph::aatype_for_node_state ( int  node_ind,
int  node_state 
) const
overridevirtual

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::LazyNode::aatype_for_state(), and get_lazy_node().

void core::pack::interaction_graph::LazyInteractionGraph::blanket_assign_state_0 ( )
overridevirtual
core::PackerEnergy core::pack::interaction_graph::LazyInteractionGraph::commit_considered_substitution ( )
overridevirtual
void core::pack::interaction_graph::LazyInteractionGraph::consider_substitution ( int  node_ind,
int  new_state,
core::PackerEnergy delta_energy,
core::PackerEnergy prev_energy_for_node 
)
overridevirtual
unsigned int core::pack::interaction_graph::LazyInteractionGraph::count_dynamic_memory ( ) const
overridevirtual
unsigned int core::pack::interaction_graph::LazyInteractionGraph::count_static_memory ( ) const
overridevirtual
Parameters
par Global Read:
Global Write:
Remarks
References:
Author
apl

Implements core::pack::interaction_graph::InteractionGraphBase.

References LazyInteractionGraph().

EdgeBase * core::pack::interaction_graph::LazyInteractionGraph::create_new_edge ( int  index1,
int  index2 
)
overrideprotectedvirtual
Parameters
par Global Read:
Global Write:
Remarks
References:
Author
apl

Implements core::pack::interaction_graph::InteractionGraphBase.

NodeBase * core::pack::interaction_graph::LazyInteractionGraph::create_new_node ( int  node_index,
int  num_states 
)
overrideprotectedvirtual
Parameters
par Global Read:
Global Write:
Remarks
References:
Author
apl

Implements core::pack::interaction_graph::InteractionGraphBase.

ObjexxFCL::FArray2D< core::PackerEnergy > core::pack::interaction_graph::LazyInteractionGraph::get_aa_submatrix_energies_for_edge ( int  node1,
int  node2,
int  node1aa,
int  node2aa 
) const
overridevirtual

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::LazyEdge::get_aa_submatrix_energies(), and get_lazy_edge().

int core::pack::interaction_graph::LazyInteractionGraph::get_edge_memory_usage ( ) const
overridevirtual
core::PackerEnergy core::pack::interaction_graph::LazyInteractionGraph::get_energy_current_state_assignment ( )
overridevirtual
Parameters
par Global Read:
Global Write:
Remarks
References:
Author
apl

Implements core::pack::interaction_graph::InteractionGraphBase.

References total_energy_current_state_assignment_, and update_internal_energy_totals().

core::PackerEnergy core::pack::interaction_graph::LazyInteractionGraph::get_energy_PD_current_state_assignment ( )
protected
core::PackerEnergy core::pack::interaction_graph::LazyInteractionGraph::get_energy_sum_for_vertex_group ( int  group_id)
overridevirtual
LazyEdge const* core::pack::interaction_graph::LazyInteractionGraph::get_lazy_edge ( int  node1,
int  node2 
) const
inlineprotected
LazyEdge* core::pack::interaction_graph::LazyInteractionGraph::get_lazy_edge ( int  node1,
int  node2 
)
inlineprotected
LazyNode const* core::pack::interaction_graph::LazyInteractionGraph::get_lazy_node ( int  index) const
inlineprotected
LazyNode* core::pack::interaction_graph::LazyInteractionGraph::get_lazy_node ( int  index)
inlineprotected
LazyInteractionGraph& core::pack::interaction_graph::LazyInteractionGraph::operator= ( LazyInteractionGraph const &  )
private
void core::pack::interaction_graph::LazyInteractionGraph::print_current_state_assignment ( ) const
overridevirtual
void core::pack::interaction_graph::LazyInteractionGraph::set_errorfull_deltaE_threshold ( core::PackerEnergy  deltaE)
overridevirtual
Parameters
par Global Read:
Global Write:
Remarks
References:
Author
apl

Implements core::pack::interaction_graph::InteractionGraphBase.

core::PackerEnergy core::pack::interaction_graph::LazyInteractionGraph::set_network_state ( ObjexxFCL::FArray1_int &  node_states)
overridevirtual
core::PackerEnergy core::pack::interaction_graph::LazyInteractionGraph::set_state_for_node ( int  node_ind,
int  new_state 
)
overridevirtual
void core::pack::interaction_graph::LazyInteractionGraph::update_internal_energy_totals ( )
protected

Member Data Documentation

const int core::pack::interaction_graph::LazyInteractionGraph::COMMIT_LIMIT_BETWEEN_UPDATES = 1024
staticprivate
int core::pack::interaction_graph::LazyInteractionGraph::node_considering_alt_state_
private
int core::pack::interaction_graph::LazyInteractionGraph::num_aa_types_
private
int core::pack::interaction_graph::LazyInteractionGraph::num_commits_since_last_update_
private
core::PackerEnergy core::pack::interaction_graph::LazyInteractionGraph::total_energy_alternate_state_assignment_
private
core::PackerEnergy core::pack::interaction_graph::LazyInteractionGraph::total_energy_current_state_assignment_
private

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