Rosetta  2020.37
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Protected Member Functions | Private Attributes | List of all members
core::scoring::EnergyGraph Class Reference

Class to hold the component energies between pairs of residues. Each node represents a residue in its corresponding structure. Each edge in the graph holds a two-body energy map representing the unweighted components of the energy function for those terms with non-zero weight. The EnergyGraph may be accessed from the pose's Energies object, but at a price of an extra score evaluation. This second score evaluation may be avoided if you use the ScoreFunction::score_components( pose ) method. More...

#include <EnergyGraph.hh>

Inheritance diagram for core::scoring::EnergyGraph:
Inheritance graph
[legend]

Public Types

typedef utility::graph::Graph parent
 

Public Member Functions

 ~EnergyGraph () override
 
 EnergyGraph (Size num_nodes)
 
 EnergyGraph ()
 
 EnergyGraph (EnergyGraph const &src)
 
EnergyGraphoperator= (EnergyGraph const &rhs)
 assignment operator – performs a deep copy More...
 
Size n_active_score_types () const
 
bool active_score_types (ScoreTypes const &active)
 Set the active score types, and return true if the new score types are the same as the old score types and the graph state is still good. Returns false if the score types have changed, indicating that the graph has dropped all of its edges;. More...
 
void add_energy_edge (Size index1, Size index2, DistanceSquared dsq)
 Add an energy edge to the graph and store the square distance. More...
 
EnergyNode const * get_energy_node (Size index) const
 Add an energy edge to the graph and set the energies for the non-zero-weighted components of the input emap. void add_energy_edge( Size index1, Size index2, EnergyMap const & emap );. More...
 
EnergyNodeget_energy_node (Size index)
 
EnergyEdgefind_energy_edge (Size n1, Size n2)
 
EnergyEdge const * find_energy_edge (Size n1, Size n2) const
 
void delete_edge (utility::graph::Edge *edge) override
 
void deallocate_arraypoolelement (utility::graph::ArrayPoolElement< Real > &element)
 As an edge is deleted from the graph, it must reliquish hold over its array-pool element so that the element may be reused by new edges. More...
 
utility::vector1< int > const & score_type_2_active () const
 
ScoreTypes const & active_2b_score_types () const
 
utility::graph::ArrayPool< Real > & array_pool ()
 Give non-const access to the array pool – this function should only be called by class EnergyEdge. I wish C++ let me declare this function private and that EnergyEdge could be a "friend" of this function. More...
 

Protected Member Functions

Size count_static_memory () const override
 
Size count_dynamic_memory () const override
 
utility::graph::Node * create_new_node (Size index) override
 Factory method for node creation. More...
 
utility::graph::Edge * create_new_edge (Size index1, Size index2) override
 Factory method for edge creation. More...
 
utility::graph::Edge * create_new_edge (utility::graph::Edge const *example_edge) override
 Factory copy-constructor method for edge creation. More...
 

Private Attributes

boost::unordered_object_pool
< EnergyEdge > * 
energy_edge_pool_
 
utility::graph::ArrayPool< Realenergy_array_pool_
 
ScoreTypes active_2b_score_types_
 
utility::vector1< int > score_type_2_active_
 these are flag values; <0 has a special meaning, so they need to be ints More...
 

Detailed Description

Class to hold the component energies between pairs of residues. Each node represents a residue in its corresponding structure. Each edge in the graph holds a two-body energy map representing the unweighted components of the energy function for those terms with non-zero weight. The EnergyGraph may be accessed from the pose's Energies object, but at a price of an extra score evaluation. This second score evaluation may be avoided if you use the ScoreFunction::score_components( pose ) method.

Member Typedef Documentation

typedef utility::graph::Graph core::scoring::EnergyGraph::parent

Constructor & Destructor Documentation

core::scoring::EnergyGraph::~EnergyGraph ( )
override

References energy_edge_pool_.

core::scoring::EnergyGraph::EnergyGraph ( Size  num_nodes)

This does not call the base class parent( Size ) constructor since that produces calls to the polymorphic function create_new_node() and polymorphism does not work during constructor intialization.

core::scoring::EnergyGraph::EnergyGraph ( )

Referenced by count_static_memory().

core::scoring::EnergyGraph::EnergyGraph ( EnergyGraph const &  src)

Notice that this does not call the parent( src ) copy constructor. This is because the copy constructor relies on polymorphic functions which are unavailable during the Graph constructor. Instead, this function waits until parent construction is complete, and relies on the assigmnent operator.

References active_2b_score_types_, and active_score_types().

Member Function Documentation

ScoreTypes const& core::scoring::EnergyGraph::active_2b_score_types ( ) const
inline
bool core::scoring::EnergyGraph::active_score_types ( ScoreTypes const &  active)

Set the active score types, and return true if the new score types are the same as the old score types and the graph state is still good. Returns false if the score types have changed, indicating that the graph has dropped all of its edges;.

The array pool only needs to be resized if the number of active score types has changed; it doesn't have to be resized if the actual active types have changed but the number of active score types has remained constant. However, if either the number or the identity of the active score types have changed, then all old edges in the EnergyGraph should be dropped. The input array "active" must be sorted.

References active_2b_score_types_, energy_array_pool_, and score_type_2_active_.

Referenced by EnergyGraph(), and operator=().

void core::scoring::EnergyGraph::add_energy_edge ( Size  index1,
Size  index2,
DistanceSquared  dsq 
)

Add an energy edge to the graph and store the square distance.

Referenced by core::scoring::symmetry::SymmetricEnergies::update_neighbor_links().

utility::graph::ArrayPool< Real >& core::scoring::EnergyGraph::array_pool ( )
inline

Give non-const access to the array pool – this function should only be called by class EnergyEdge. I wish C++ let me declare this function private and that EnergyEdge could be a "friend" of this function.

References energy_array_pool_.

Size core::scoring::EnergyGraph::count_dynamic_memory ( ) const
overrideprotected

References energy_array_pool_.

Size core::scoring::EnergyGraph::count_static_memory ( ) const
overrideprotected

References EnergyGraph().

Edge * core::scoring::EnergyGraph::create_new_edge ( Size  index1,
Size  index2 
)
overrideprotected

Factory method for edge creation.

References energy_edge_pool_.

Edge * core::scoring::EnergyGraph::create_new_edge ( utility::graph::Edge const *  example_edge)
overrideprotected

Factory copy-constructor method for edge creation.

References energy_edge_pool_.

Node * core::scoring::EnergyGraph::create_new_node ( Size  index)
overrideprotected

Factory method for node creation.

void core::scoring::EnergyGraph::deallocate_arraypoolelement ( utility::graph::ArrayPoolElement< Real > &  element)

As an edge is deleted from the graph, it must reliquish hold over its array-pool element so that the element may be reused by new edges.

References energy_array_pool_.

Referenced by core::scoring::EnergyEdge::~EnergyEdge().

void core::scoring::EnergyGraph::delete_edge ( utility::graph::Edge *  edge)
override

References energy_edge_pool_.

EnergyEdge * core::scoring::EnergyGraph::find_energy_edge ( Size  n1,
Size  n2 
)
EnergyEdge const * core::scoring::EnergyGraph::find_energy_edge ( Size  n1,
Size  n2 
) const
EnergyNode const* core::scoring::EnergyGraph::get_energy_node ( Size  index) const
inline

Add an energy edge to the graph and set the energies for the non-zero-weighted components of the input emap. void add_energy_edge( Size index1, Size index2, EnergyMap const & emap );.

EnergyNode* core::scoring::EnergyGraph::get_energy_node ( Size  index)
inline
Size core::scoring::EnergyGraph::n_active_score_types ( ) const
inline
EnergyGraph & core::scoring::EnergyGraph::operator= ( EnergyGraph const &  rhs)

assignment operator – performs a deep copy

References active_2b_score_types_, and active_score_types().

utility::vector1< int > const& core::scoring::EnergyGraph::score_type_2_active ( ) const
inline

Member Data Documentation

ScoreTypes core::scoring::EnergyGraph::active_2b_score_types_
private
utility::graph::ArrayPool< Real > core::scoring::EnergyGraph::energy_array_pool_
private
boost::unordered_object_pool< EnergyEdge >* core::scoring::EnergyGraph::energy_edge_pool_
private
utility::vector1< int > core::scoring::EnergyGraph::score_type_2_active_
private

these are flag values; <0 has a special meaning, so they need to be ints

Referenced by active_score_types(), and score_type_2_active().


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