Rosetta 3.5
 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]
Collaboration diagram for core::scoring::EnergyEdge:
Collaboration graph
[legend]

Public Types

typedef graph::Edge parent
 
typedef scoring::EnergyMap EnergyMap
 
- Public Types inherited from core::graph::Edge
typedef EdgeListIterator EdgeListIter
 

Public Member Functions

 EnergyEdge (EnergyGraph *owner, Size n1, Size n2)
 Energy edge ctor. More...
 
 EnergyEdge (EnergyGraph *owner, EnergyEdge const &example_edge)
 
virtual ~EnergyEdge ()
 virtual dstor; The EnergyEdge must free the array pool element it holds before it disappears. More...
 
virtual void copy_from (parent const *source)
 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...
 
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
 
virtual Size count_static_memory () const
 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...
 
virtual Size count_dynamic_memory () const
 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...
 
- Public Member Functions inherited from core::graph::Edge
virtual ~Edge ()
 destructor More...
 
 Edge (Graph *owner, platform::Size first_node_ind, platform::Size second_node_ind)
 Main edge constructor. This should only be invoked by create_new_edge, which itself is only called by add_edge. The ONLY way an edge should be added to a graph is through add_edge. NOTE: edges should be only be deleted by a call to the Graph's delete_edge method, and this method absolutely must be implemented by derived Graph classes. More...
 
platform::Size get_other_ind (platform::Size node_index) const
 returns the index of the one node given the index of the other. node_index must be one of the two nodes that this edge is incident upon. More...
 
Node const * get_other_node (platform::Size node_index) const
 returns a const pointer to one node given the index of the other. node_index must be one of the two nodes that this edge is incident upon. More...
 
Nodeget_other_node (platform::Size node_index)
 returns a non-const pointer to one node given the index of the other. node_index must be one of the two nodes that this edge is incident upon. More...
 
platform::Size get_first_node_ind () const
 returns the index of the lower node More...
 
platform::Size get_second_node_ind () const
 returns the index of the upper node More...
 
void set_pos_in_owners_list (EdgeListIter edge_iterator)
 called only by class Graph, this function gives the Edge the data it needs to later delete itself from its owner's edge list in constant time. More...
 
bool same_edge (platform::Size node1, platform::Size node2) const
 Is this the same edge as another edge (node1,node2)? Note: this graph does not work for multi-graphs. Edges must be unique. More...
 
bool is_loop () const
 Is this edge a loop? In Pseudographs, loop edges are incident twice on a single vertex. More...
 

Protected Member Functions

EnergyGraph const * get_energy_owner () const
 Downcasts. More...
 
EnergyGraphget_energy_owner ()
 
- Protected Member Functions inherited from core::graph::Edge
platform::Size get_node_index (platform::Size index) const
 get the node index for one of the two nodes this edge is incident upon uses c-style index-from-0. More...
 
Node const * get_node (platform::Size index) const
 get a const * to one node that this edge is incident upon uses c-style index-from-0 for these two nodes More...
 
Nodeget_node (platform::Size index)
 get a non-const * to one node that this edge is incident upon uses c-style index-from-0 for these two nodes More...
 
Graph const * get_owner () const
 get a const * to the owning graph More...
 
Graphget_owner ()
 get a non-const * to the owning graph More...
 

Private Attributes

bool energies_not_yet_computed_
 
DistanceSquared dsqr_
 
graph::ArrayPoolElement< Realarray_
 

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

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 
)
core::scoring::EnergyEdge::~EnergyEdge ( )
virtual

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)
virtual

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

Reimplemented from core::graph::Edge.

References array_, core::graph::ArrayPoolElement< T >::copy_array_contents(), dsqr_, and energies_not_yet_computed_.

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

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.

Reimplemented from core::graph::Edge.

References core::graph::Edge::count_dynamic_memory().

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

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

Reimplemented from core::graph::Edge.

References EnergyEdge().

Real core::scoring::EnergyEdge::dot ( EnergyMap const &  weights) const
inline
bool core::scoring::EnergyEdge::energies_not_yet_computed ( ) const
inline
EnergyMap core::scoring::EnergyEdge::fill_energy_map ( ) const
inline
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 ( )
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
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().

Referenced by core::scoring::symmetry::SymmetricScoreFunction::eval_twobody_neighbor_energies(), and core::scoring::ScoreFunction::eval_twobody_neighbor_energies().

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

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: