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::EnergyEdge Class Reference

#include <EnergyGraph.hh>

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

Public Types

typedef utility::graph::Edge parent
 
typedef scoring::EnergyMap EnergyMap
 

Public Member Functions

 EnergyEdge (EnergyGraph *owner, Size n1, Size n2)
 Energy edge ctor. More...
 
 EnergyEdge (EnergyGraph *owner, EnergyEdge const &example_edge)
 
 ~EnergyEdge () override
 virtual dstor; The EnergyEdge must free the array pool element it holds before it disappears. More...
 
void copy_from (parent const *source) override
 Copy the data held on the example edge, source. The source edge must be castable to class EnergyEdge. More...
 
void store_active_energies (EnergyMap const &emap)
 Store the energies held in the input emap on this edge; only those ScoreTypes which are active are stored. More...
 
void store_active_energies (EnergyMap const &emap, ScoreTypes const &subset)
 Store the intersection of the energies held in the input emap on this edge: The intersection is between the set of active ScoreTypes and the ScoreTypes given in the input "subset" list. subset need not be sorted. More...
 
EnergyMap fill_energy_map () const
 Load an energy map with the non-zero. More...
 
void add_to_energy_map (EnergyMap &emap) const
 Add the non-zero elements into the energy map. More...
 
void add_to_energy_map (EnergyMap &emap, ScoreTypes const &subset) const
 Add the non-zero elements into the energy map. More...
 
Real operator[] (ScoreType st) const
 Read the value stored on this edge for a particular score type. More...
 
Real dot (EnergyMap const &weights) const
 Compute the weighted energy for the components stored on this edge. More...
 
Real dot_abs (EnergyMap const &weights) const
 Compute the weighted energy for the absolute value of the components stored on this edge. More...
 
DistanceSquared square_distance () const
 
void square_distance (DistanceSquared dsqr)
 
void mark_energies_computed ()
 set energies_computed_ to true for an edge More...
 
void mark_energies_uncomputed ()
 set energies_computed_ to false for an edge More...
 
bool energies_not_yet_computed () const
 
Size count_static_memory () const override
 virtual call to determine the static size of an Edge object dynamic memory use is counted through the recursive count_dynamic_memory() calling path More...
 
Size count_dynamic_memory () const override
 virtual call to determine the amount of dynamic memory allocated by an edge; this function must recurse to the parent class to determine how much memory the parent class is responsible for. Do not account for the size of the ArrayPool array here; instead, that is accounted for in the EnergyGraph::count_dynamic_memory method. More...
 

Protected Member Functions

EnergyGraph const * get_energy_owner () const
 Downcasts. More...
 
EnergyGraphget_energy_owner ()
 

Private Attributes

bool energies_not_yet_computed_
 
DistanceSquared dsqr_
 
utility::graph::ArrayPoolElement
< Real
array_
 

Detailed Description

Class EnergyEdge holds scores for pair interactions for short-ranged energy functions. It also records whether or not it has been scored – when an edge is added to the graph, it sets "energies_computed_" as false, and the ScoreFunction class marks edges as having their energies computed once it computes them.

Member Typedef Documentation

typedef utility::graph::Edge core::scoring::EnergyEdge::parent

Constructor & Destructor Documentation

core::scoring::EnergyEdge::EnergyEdge ( EnergyGraph owner,
Size  n1,
Size  n2 
)

Energy edge ctor.

when first added to the graph, sets its enegies_not_yet_computed_ to true the responsibility of marking the energies as having been computed falls on class ScoringFunction

Referenced by count_static_memory().

core::scoring::EnergyEdge::EnergyEdge ( EnergyGraph owner,
EnergyEdge const &  example_edge 
)

References array_.

core::scoring::EnergyEdge::~EnergyEdge ( )
override

virtual dstor; The EnergyEdge must free the array pool element it holds before it disappears.

References array_, core::scoring::EnergyGraph::deallocate_arraypoolelement(), and get_energy_owner().

Member Function Documentation

void core::scoring::EnergyEdge::add_to_energy_map ( EnergyMap emap) const
inline
void core::scoring::EnergyEdge::add_to_energy_map ( EnergyMap emap,
ScoreTypes const &  subset 
) const
inline

Add the non-zero elements into the energy map.

References array_, and get_energy_owner().

void core::scoring::EnergyEdge::copy_from ( parent const *  source)
override

Copy the data held on the example edge, source. The source edge must be castable to class EnergyEdge.

copies data from EnergyEdge const * source;

called from the copy ctor and operator= methods defined in the Graph base class

References array_, dsqr_, and energies_not_yet_computed_.

Size core::scoring::EnergyEdge::count_dynamic_memory ( ) const
override

virtual call to determine the amount of dynamic memory allocated by an edge; this function must recurse to the parent class to determine how much memory the parent class is responsible for. Do not account for the size of the ArrayPool array here; instead, that is accounted for in the EnergyGraph::count_dynamic_memory method.

Size core::scoring::EnergyEdge::count_static_memory ( ) const
override

virtual call to determine the static size of an Edge object dynamic memory use is counted through the recursive count_dynamic_memory() calling path

References EnergyEdge().

Real core::scoring::EnergyEdge::dot ( EnergyMap const &  weights) const
inline
Real core::scoring::EnergyEdge::dot_abs ( EnergyMap const &  weights) const
inline

Compute the weighted energy for the absolute value of the components stored on this edge.

References array_, and get_energy_owner().

bool core::scoring::EnergyEdge::energies_not_yet_computed ( ) const
inline
EnergyMap core::scoring::EnergyEdge::fill_energy_map ( ) const
inline

Load an energy map with the non-zero.

Only load the non-zero terms – the zero entries are already

References array_, and get_energy_owner().

Referenced by core::simple_metrics::metrics::InteractionEnergyMetric::calculate(), and core::simple_metrics::per_residue_metrics::PerResidueClashMetric::calculate().

EnergyGraph const * core::scoring::EnergyEdge::get_energy_owner ( ) const
inlineprotected
EnergyGraph * core::scoring::EnergyEdge::get_energy_owner ( )
inlineprotected
void core::scoring::EnergyEdge::mark_energies_computed ( )

set energies_computed_ to true for an edge

References energies_not_yet_computed_.

void core::scoring::EnergyEdge::mark_energies_uncomputed ( )

set energies_computed_ to false for an edge

this function would allow edges to be marked as dirty without deleting it from the graph. Currently, edges are not marked as dirty; they are simply deleted (and if still needed) returned to the graph. If edge addition and deletion starts to show up as a hotspot, we will examine if simply marking edges as dirty is faster. For now, this function is not used.

References energies_not_yet_computed_.

Real core::scoring::EnergyEdge::operator[] ( ScoreType  st) const
inline

Read the value stored on this edge for a particular score type.

The owner stores a map from score types to indices indicating score types not represented in the mapping with an index of -1.

References array_, get_energy_owner(), and core::scoring::EnergyGraph::score_type_2_active().

DistanceSquared core::scoring::EnergyEdge::square_distance ( ) const
inline

References dsqr_.

void core::scoring::EnergyEdge::square_distance ( DistanceSquared  dsqr)
inline

References dsqr_.

void core::scoring::EnergyEdge::store_active_energies ( EnergyMap const &  emap)
inline

Store the energies held in the input emap on this edge; only those ScoreTypes which are active are stored.

Store only the active terms – active meaning with non-zero weight.

References array_, and get_energy_owner().

void core::scoring::EnergyEdge::store_active_energies ( EnergyMap const &  emap,
ScoreTypes const &  subset 
)
inline

Store the intersection of the energies held in the input emap on this edge: The intersection is between the set of active ScoreTypes and the ScoreTypes given in the input "subset" list. subset need not be sorted.

Subset may specify ScoreTypes that are not active, but only the active ScoreTypes have their eneriges stored.

References array_, and get_energy_owner().

Member Data Documentation

utility::graph::ArrayPoolElement< Real > core::scoring::EnergyEdge::array_
private
DistanceSquared core::scoring::EnergyEdge::dsqr_
private

Referenced by copy_from(), and square_distance().

bool core::scoring::EnergyEdge::energies_not_yet_computed_
private

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