Rosetta  2020.50
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
core::pack::interaction_graph::AdditionalBackgroundNodesInteractionGraph< V, E, G > Class Template Referenceabstract

Function declarations for the AdditionalBackgroundNodesInteractionGraph. More...

#include <SurfaceInteractionGraph.fwd.hh>

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

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 =. More...
 
 ~AdditionalBackgroundNodesInteractionGraph () override
 AdditionalBackgroundNodesInteractionGraph destructor. More...
 
unsigned int getTotalMemoryUsage () const override
 Returns an int representing the total amount of memory in bytes used by this graph. More...
 
unsigned int count_dynamic_memory () const override
 Returns an int representing the amount of dynamic memory in bytes used by this graph. More...
 
int get_num_background_nodes () const
 

Protected Member Functions

void clean_up_bgtfc_edges_marked_for_deletion ()
 Remove those BackgroundToFirstClassEdges that have marked themselves for deletion. More...
 
void drop_background_edge (BackgroundEdgeListIter iter)
 Constant time edge removal. More...
 
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. More...
 
void add_background_edge (int first_class_node_index, int bg_node_index)
 adds a BackgroundToFirstClassEdge to the graph and performs the requisite bookkeepking. More...
 
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). More...
 
int get_num_bg_edges () const
 
BackgroundNode< V, E, G > * get_background_node (int index) const
 
void prepare_graph_for_simulated_annealing () override
 invokes prepare_for_simulated_annealing on each of the BackgroundToFirstClassEdges and then invokes prepare_for_simulated_annealing on each of the BackgroundNodes. More...
 
BackgroundEdgeListConstIter get_bg_edge_list_begin () const
 
BackgroundEdgeListConstIter get_bg_edge_list_end () const
 

Private Member Functions

 AdditionalBackgroundNodesInteractionGraph ()
 
 AdditionalBackgroundNodesInteractionGraph (AdditionalBackgroundNodesInteractionGraph< V, E, G > const &)
 
AdditionalBackgroundNodesInteractionGraph
< V, E, G > & 
operator= (AdditionalBackgroundNodesInteractionGraph< V, E, G > const &)
 

Private Attributes

int num_bg_nodes_
 
BackgroundNodeVector bg_nodes_
 
BackgroundEdgeList bg_to_fc_edge_list_
 
BackgroundToFirstClassEdge< V,
E, G > * 
focused_bg_edge_
 

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.

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 > * >::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 =.

Parameters
num_nodes- [in] - the number of first class nodes

AdditionalBackgroundNodesInteractionGraph destructor.

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.

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 >
void core::pack::interaction_graph::AdditionalBackgroundNodesInteractionGraph< V, E, G >::clean_up_bgtfc_edges_marked_for_deletion ( )
protected

Remove those BackgroundToFirstClassEdges that have marked themselves for deletion.

Author
Vikram K. Mulligan (vmull.nosp@m.igan.nosp@m.@flat.nosp@m.irio.nosp@m.ninst.nosp@m.itut.nosp@m.e.org).
template<typename V , typename E , typename G >
unsigned int core::pack::interaction_graph::AdditionalBackgroundNodesInteractionGraph< V, E, G >::count_dynamic_memory ( ) const
override

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

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 
)
protectedpure 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)
protectedpure 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.

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

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
inlineprotected
template<typename V, typename E, typename G>
BackgroundEdgeListConstIter core::pack::interaction_graph::AdditionalBackgroundNodesInteractionGraph< V, E, G >::get_bg_edge_list_begin ( ) const
inlineprotected
template<typename V, typename E, typename G>
BackgroundEdgeListConstIter core::pack::interaction_graph::AdditionalBackgroundNodesInteractionGraph< V, E, G >::get_bg_edge_list_end ( ) const
inlineprotected
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
inlineprotected
template<typename V , typename E , typename G >
unsigned int core::pack::interaction_graph::AdditionalBackgroundNodesInteractionGraph< V, E, G >::getTotalMemoryUsage ( ) const
override

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

template<typename V , typename E , typename G >
void core::pack::interaction_graph::AdditionalBackgroundNodesInteractionGraph< V, E, G >::prepare_graph_for_simulated_annealing ( )
overrideprotected

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

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_graph_for_simulated_annealing()
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.

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

Member Data Documentation

template<typename V, typename E, typename G>
BackgroundNodeVector core::pack::interaction_graph::AdditionalBackgroundNodesInteractionGraph< V, E, G >::bg_nodes_
private
template<typename V, typename E, typename G>
BackgroundEdgeList core::pack::interaction_graph::AdditionalBackgroundNodesInteractionGraph< V, E, G >::bg_to_fc_edge_list_
private
template<typename V, typename E, typename G>
BackgroundToFirstClassEdge< V, E, G >* core::pack::interaction_graph::AdditionalBackgroundNodesInteractionGraph< V, E, G >::focused_bg_edge_
mutableprivate
template<typename V, typename E, typename G>
int core::pack::interaction_graph::AdditionalBackgroundNodesInteractionGraph< V, E, G >::num_bg_nodes_
private

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