Rosetta 3.4
Public Types | Public Member Functions | Protected Member Functions | Friends
core::pack::interaction_graph::AdditionalBackgroundNodesInteractionGraph< V, E, G > Class Template Reference

Function declarations for the AdditionalBackgroundNodesInteractionGraph. More...

#include <AdditionalBackgroundNodesInteractionGraph.hh>

Inheritance diagram for core::pack::interaction_graph::AdditionalBackgroundNodesInteractionGraph< V, E, G >:
Inheritance graph
[legend]
Collaboration diagram for core::pack::interaction_graph::AdditionalBackgroundNodesInteractionGraph< V, E, G >:
Collaboration graph
[legend]

List of all members.

Public Types

typedef std::vector
< BackgroundNode< V, E, G > * > 
BackgroundNodeVector
typedef std::list
< BackgroundToFirstClassEdge
< V, E, G > * > 
BackgroundEdgeList
typedef std::list
< BackgroundToFirstClassEdge
< V, E, G > * >::iterator 
BackgroundEdgeListIter
typedef std::list
< BackgroundToFirstClassEdge
< V, E, G >
* >::const_iterator 
BackgroundEdgeListConstIter

Public Member Functions

 AdditionalBackgroundNodesInteractionGraph (int num_nodes)
 AdditionalBackgroundNodesInteractionGraph constructor; no default or copy constructors; no operator =.
virtual ~AdditionalBackgroundNodesInteractionGraph ()
 AdditionalBackgroundNodesInteractionGraph destructor.
virtual unsigned int getTotalMemoryUsage () const
 Returns an int representing the total amount of memory in bytes used by this graph.
virtual unsigned int count_dynamic_memory () const
 Returns an int representing the amount of dynamic memory in bytes used by this graph.
int get_num_background_nodes () const

Protected Member Functions

void drop_background_edge (BackgroundEdgeListIter iter)
 Constant time edge removal.
virtual BackgroundNode< V, E, G > * create_background_node (int bg_node_index)=0
virtual
BackgroundToFirstClassEdge< V,
E, G > * 
create_background_edge (int fc_node_index, int bg_node_index)=0
void set_num_background_nodes (int num_bg_nodes)
 sets the number of background nodes in the graph. Should be called no more than once. Some problem instances do not require background nodes.
void add_background_edge (int first_class_node_index, int bg_node_index)
 adds a BackgroundToFirstClassEdge to the graph and performs the requisite bookkeepking.
BackgroundToFirstClassEdge< V,
E, G > * 
find_background_edge (int first_class_node_index, int bg_node_index) const
 returns a pointer to the background edge, identified by the indices of the first and second class nodes it connects. Returns the null pointer if the edge does not exist. Possibly linear time operation (in the number of BackgroundToFirstClassEdges).
int get_num_bg_edges () const
BackgroundNode< V, E, G > * get_background_node (int index) const
void prepare_for_simulated_annealing ()
 invokes prepare_for_simulated_annealing on each of the BackgroundToFirstClassEdges and then invokes prepare_for_simulated_annealing on each of the BackgroundNodes.
BackgroundEdgeListConstIter get_bg_edge_list_begin () const
BackgroundEdgeListConstIter get_bg_edge_list_end () const

Friends

class BackgroundToFirstClassEdge< V, E, G >

Detailed Description

template<typename V, typename E, typename G>
class core::pack::interaction_graph::AdditionalBackgroundNodesInteractionGraph< V, E, G >

Function declarations for the AdditionalBackgroundNodesInteractionGraph.

AdditionalBackgroundNodesInteractionGraph


Member Typedef Documentation

template<typename V, typename E, typename G>
typedef std::list< BackgroundToFirstClassEdge< V, E, G > * > core::pack::interaction_graph::AdditionalBackgroundNodesInteractionGraph< V, E, G >::BackgroundEdgeList
template<typename V, typename E, typename G>
typedef std::list< BackgroundToFirstClassEdge< V, E, G > * >::const_iterator core::pack::interaction_graph::AdditionalBackgroundNodesInteractionGraph< V, E, G >::BackgroundEdgeListConstIter
template<typename V, typename E, typename G>
typedef std::list< BackgroundToFirstClassEdge< V, E, G > * >::iterator core::pack::interaction_graph::AdditionalBackgroundNodesInteractionGraph< V, E, G >::BackgroundEdgeListIter
template<typename V, typename E, typename G>
typedef std::vector< BackgroundNode< V, E, G > * > core::pack::interaction_graph::AdditionalBackgroundNodesInteractionGraph< V, E, G >::BackgroundNodeVector

Constructor & Destructor Documentation

template<typename V , typename E , typename G >
core::pack::interaction_graph::AdditionalBackgroundNodesInteractionGraph< V, E, G >::AdditionalBackgroundNodesInteractionGraph ( int  num_nodes)

AdditionalBackgroundNodesInteractionGraph constructor; no default or copy constructors; no operator =.

AdditionalBackgroundNodesInteractionGraph::AdditionalBackgroundNodesInteractionGraph

Parameters:
num_nodes- [in] - the number of first class nodes
template<typename V , typename E , typename G >
core::pack::interaction_graph::AdditionalBackgroundNodesInteractionGraph< V, E, G >::~AdditionalBackgroundNodesInteractionGraph ( ) [virtual]

AdditionalBackgroundNodesInteractionGraph destructor.

AdditionalBackgroundNodesInteractionGraph::~AdditionalBackgroundNodesInteractionGraph

Detailed:
deallocates each BackgroundToFirstClassEdge. Then deallocates each background node. Order is important. The edges assume that its vertices still exist at the time it is removed. This destructor enforces that.

Member Function Documentation

template<typename V , typename E , typename G >
void core::pack::interaction_graph::AdditionalBackgroundNodesInteractionGraph< V, E, G >::add_background_edge ( int  first_class_node_index,
int  bg_node_index 
) [protected]

adds a BackgroundToFirstClassEdge to the graph and performs the requisite bookkeepking.

AdditionalBackgroundNodesInteractionGraph::add_background_edge

Parameters:
first_class_node_index- [in] - the index of the first class node bg_node_index - [in] - the index of the second class node

References core::pack::interaction_graph::BackgroundToFirstClassEdge< V, E, G >::set_pos_in_owners_list().

template<typename V , typename E , typename G >
unsigned int core::pack::interaction_graph::AdditionalBackgroundNodesInteractionGraph< V, E, G >::count_dynamic_memory ( ) const [virtual]
template<typename V, typename E, typename G>
virtual BackgroundToFirstClassEdge< V, E, G >* core::pack::interaction_graph::AdditionalBackgroundNodesInteractionGraph< V, E, G >::create_background_edge ( int  fc_node_index,
int  bg_node_index 
) [protected, pure virtual]
template<typename V, typename E, typename G>
virtual BackgroundNode< V, E, G >* core::pack::interaction_graph::AdditionalBackgroundNodesInteractionGraph< V, E, G >::create_background_node ( int  bg_node_index) [protected, pure virtual]
template<typename V , typename E , typename G >
void core::pack::interaction_graph::AdditionalBackgroundNodesInteractionGraph< V, E, G >::drop_background_edge ( BackgroundEdgeListIter  iter) [protected]

Constant time edge removal.

AdditionalBackgroundNodesInteractionGraph::drop_background_edge

Detailed:
Parameters:
iter- [in] - the iterator to the position in the graph's edge list for the edge that is removing itself.
template<typename V , typename E , typename G >
BackgroundToFirstClassEdge< V, E, G > * core::pack::interaction_graph::AdditionalBackgroundNodesInteractionGraph< V, E, G >::find_background_edge ( int  first_class_node_index,
int  bg_node_index 
) const [protected]

returns a pointer to the background edge, identified by the indices of the first and second class nodes it connects. Returns the null pointer if the edge does not exist. Possibly linear time operation (in the number of BackgroundToFirstClassEdges).

AdditionalBackgroundNodesInteractionGraph::find_background_edge

Detailed:
The graph keeps a pointer to a "focused edge" so that repeated requests for the same edge take constant time.
Parameters:
first_class_node_index- [in] - the index of the first class node bg_node_index - [in] - the index of the second class node
template<typename V, typename E, typename G>
BackgroundNode< V, E, G >* core::pack::interaction_graph::AdditionalBackgroundNodesInteractionGraph< V, E, G >::get_background_node ( int  index) const [inline, protected]
template<typename V, typename E, typename G>
BackgroundEdgeListConstIter core::pack::interaction_graph::AdditionalBackgroundNodesInteractionGraph< V, E, G >::get_bg_edge_list_begin ( ) const [inline, protected]
template<typename V, typename E, typename G>
BackgroundEdgeListConstIter core::pack::interaction_graph::AdditionalBackgroundNodesInteractionGraph< V, E, G >::get_bg_edge_list_end ( ) const [inline, protected]
template<typename V, typename E, typename G>
int core::pack::interaction_graph::AdditionalBackgroundNodesInteractionGraph< V, E, G >::get_num_background_nodes ( ) const [inline]
template<typename V, typename E, typename G>
int core::pack::interaction_graph::AdditionalBackgroundNodesInteractionGraph< V, E, G >::get_num_bg_edges ( ) const [inline, protected]
template<typename V , typename E , typename G >
unsigned int core::pack::interaction_graph::AdditionalBackgroundNodesInteractionGraph< V, E, G >::getTotalMemoryUsage ( ) const [virtual]

Returns an int representing the total amount of memory in bytes used by this graph.

AdditionalBackgroundNodesInteractionGraph::getTotalMemoryUsage

template<typename V , typename E , typename G >
void core::pack::interaction_graph::AdditionalBackgroundNodesInteractionGraph< V, E, G >::prepare_for_simulated_annealing ( ) [protected]

invokes prepare_for_simulated_annealing on each of the BackgroundToFirstClassEdges and then invokes prepare_for_simulated_annealing on each of the BackgroundNodes.

AdditionalBackgroundNodesInteractionGraph::prepare_for_simulated_annealing

Detailed:
A BackgroundToFirstClassEdges may decide to delete itself before sim annealing begins. Since the second class node will likely update is edge vector in its (virtual) call to prepare_for_sim_annealing, any edges that should be should be removed before the second class nodes update their edge vectors.
Remarks:
does not invoke InteractionGraphBase::prepare_for_simulated_annealing()

Reimplemented in core::pack::interaction_graph::HPatchInteractionGraph< V, E, G >, and core::pack::interaction_graph::SurfaceInteractionGraph< V, E, G >.

template<typename V , typename E , typename G >
void core::pack::interaction_graph::AdditionalBackgroundNodesInteractionGraph< V, E, G >::set_num_background_nodes ( int  num_bg_nodes) [protected]

sets the number of background nodes in the graph. Should be called no more than once. Some problem instances do not require background nodes.

AdditionalBackgroundNodesInteractionGraph::set_num_background_nodes

Detailed:
Allocates the background nodes using a factory method. Their indices start from 1. The create_background_node() method is virtual.

Friends And Related Function Documentation

template<typename V, typename E, typename G>
friend class BackgroundToFirstClassEdge< V, E, G > [friend]

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