Rosetta 3.4
Public Types | Public Member Functions | Protected Member Functions
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]
Collaboration diagram for core::scoring::EnergyGraph:
Collaboration graph
[legend]

List of all members.

Public Types

typedef graph::Graph parent

Public Member Functions

virtual ~EnergyGraph ()
 EnergyGraph (Size num_nodes)
 EnergyGraph ()
 EnergyGraph (EnergyGraph const &src)
EnergyGraph const & operator= (EnergyGraph const &rhs)
 assignment operator -- performs a deep copy
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;.
void add_energy_edge (Size index1, Size index2, DistanceSquared dsq)
 Add an energy edge to the graph and store the square distance.
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 );.
EnergyNodeget_energy_node (Size index)
EnergyEdgefind_energy_edge (Size n1, Size n2)
EnergyEdge const * find_energy_edge (Size n1, Size n2) const
virtual void delete_edge (graph::Edge *edge)
 remove an edge from the graph. (NEW AS OF 12/9/07) Never call C++'s "delete" function on an edge pointer directly. Derived classes must implement this function. If they wish to use unordered_object_pools to manage their memory
void deallocate_arraypoolelement (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.
utility::vector1< int > const & score_type_2_active () const
ScoreTypes const & active_2b_score_types () const
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.

Protected Member Functions

virtual Size count_static_memory () const
virtual Size count_dynamic_memory () const
virtual graph::Nodecreate_new_node (Size index)
 Factory method for node creation.
virtual graph::Edgecreate_new_edge (Size index1, Size index2)
 Factory method for edge creation.
virtual graph::Edgecreate_new_edge (graph::Edge const *example_edge)
 Factory copy-constructor method for edge creation.

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

Reimplemented from core::graph::Graph.


Constructor & Destructor Documentation

core::scoring::EnergyGraph::~EnergyGraph ( ) [virtual]
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.

References core::graph::Graph::set_num_nodes().

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_score_types(), and core::graph::Graph::operator=().


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 core::graph::Graph::drop_all_edges(), and core::graph::ArrayPool< T >::set_array_size().

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.

References core::graph::Graph::add_edge().

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.

Size core::scoring::EnergyGraph::count_dynamic_memory ( ) const [protected, virtual]
Size core::scoring::EnergyGraph::count_static_memory ( ) const [protected, virtual]

Reimplemented from core::graph::Graph.

References EnergyGraph().

Edge * core::scoring::EnergyGraph::create_new_edge ( Size  index1,
Size  index2 
) [protected, virtual]

Factory method for edge creation.

Reimplemented from core::graph::Graph.

References boost::unordered_object_pool< T, UserAllocator >::construct().

Edge * core::scoring::EnergyGraph::create_new_edge ( graph::Edge const *  example_edge) [protected, virtual]

Factory copy-constructor method for edge creation.

Reimplemented from core::graph::Graph.

References boost::unordered_object_pool< T, UserAllocator >::construct().

Node * core::scoring::EnergyGraph::create_new_node ( Size  index) [protected, virtual]

Factory method for node creation.

Reimplemented from core::graph::Graph.

void core::scoring::EnergyGraph::deallocate_arraypoolelement ( 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 core::graph::ArrayPool< T >::deallocate_array().

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

void core::scoring::EnergyGraph::delete_edge ( graph::Edge edge) [virtual]

remove an edge from the graph. (NEW AS OF 12/9/07) Never call C++'s "delete" function on an edge pointer directly. Derived classes must implement this function. If they wish to use unordered_object_pools to manage their memory

Reimplemented from core::graph::Graph.

References boost::unordered_object_pool< T, UserAllocator >::destroy().

EnergyEdge const * core::scoring::EnergyGraph::find_energy_edge ( Size  n1,
Size  n2 
) const
EnergyEdge * core::scoring::EnergyGraph::find_energy_edge ( Size  n1,
Size  n2 
)
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 );.

References core::graph::Graph::get_node().

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

assignment operator -- performs a deep copy

References active_score_types(), and core::graph::Graph::operator=().

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

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines