LLVM API Documentation

PBQP::GraphBase< NodeEntry, EdgeEntry > Class Template Reference

Base for concrete graph classes. Provides a basic set of graph operations which are useful for PBQP solvers. More...

#include <GraphBase.h>

Inheritance diagram for PBQP::GraphBase< NodeEntry, EdgeEntry >:
[legend]
Collaboration diagram for PBQP::GraphBase< NodeEntry, EdgeEntry >:
[legend]

List of all members.

Public Types

typedef NodeList::iterator NodeIterator
 Iterates over the nodes of a graph.
typedef NodeList::const_iterator ConstNodeIterator
 Iterates over the nodes of a const graph.
typedef EdgeList::iterator EdgeIterator
 Iterates over the edges of a graph.
typedef EdgeList::const_iterator ConstEdgeIterator
 Iterates over the edges of a const graph.
typedef NodeBaseTraits
< ThisGraphT >
::AdjEdgeIterator 
AdjEdgeIterator
 Iterates over the edges attached to a node.
typedef NodeBaseTraits
< ThisGraphT >
::ConstAdjEdgeIterator 
ConstAdjEdgeIterator
 Iterates over the edges attached to a node in a const graph.

Public Member Functions

unsigned getNumNodes () const
 Returns the number of nodes in this graph.
unsigned getNumEdges () const
 Returns the number of edges in this graph.
Vector & getNodeCosts (const NodeIterator &nodeItr)
 Return the cost vector for the given node.
const Vector & getNodeCosts (const ConstNodeIterator &nodeItr) const
 Return the cost vector for the give node.
unsigned getNodeDegree (const NodeIterator &nodeItr) const
 Return the degree of the given node.
void assignNodeIDs ()
 Assigns sequential IDs to the nodes, starting at 0, which remain valid until the next addition or removal of a node.
void assignNodeIDs (const std::vector< NodeIterator > &nodeOrdering)
 Assigns sequential IDs to the nodes using the ordering of the given vector.
bool areNodeIDsValid () const
 Returns true if valid node IDs are assigned, false otherwise.
unsigned getNodeID (const ConstNodeIterator &nodeItr) const
 Return the numeric ID of the given node.
NodeIterator getNodeItr (unsigned nodeID)
 Returns the iterator associated with the given node ID.
ConstNodeIterator getNodeItr (unsigned nodeID) const
 Returns the iterator associated with the given node ID.
void removeNode (const NodeIterator &nodeItr)
 Removes the given node (and all attached edges) from the graph.
NodeIterator nodesBegin ()
ConstNodeIterator nodesBegin () const
NodeIterator nodesEnd ()
ConstNodeIterator nodesEnd () const
AdjEdgeIterator adjEdgesBegin (const NodeIterator &nodeItr)
ConstAdjEdgeIterator adjEdgesBegin (const ConstNodeIterator &nodeItr) const
AdjEdgeIterator adjEdgesEnd (const NodeIterator &nodeItr)
ConstAdjEdgeIterator adjEdgesEnd (const ConstNodeIterator &nodeItr) const
EdgeIterator findEdge (const NodeIterator &node1Itr, const NodeIterator &node2Itr)
ConstEdgeIterator findEdge (const ConstNodeIterator &node1Itr, const ConstNodeIterator &node2Itr) const
Matrix & getEdgeCosts (const EdgeIterator &edgeItr)
const Matrix & getEdgeCosts (const ConstEdgeIterator &edgeItr) const
NodeIterator getEdgeNode1Itr (const EdgeIterator &edgeItr)
ConstNodeIterator getEdgeNode1Itr (const ConstEdgeIterator &edgeItr) const
NodeIterator getEdgeNode2Itr (const EdgeIterator &edgeItr)
ConstNodeIterator getEdgeNode2Itr (const ConstEdgeIterator &edgeItr) const
NodeIterator getEdgeOtherNode (const EdgeIterator &edgeItr, const NodeIterator &nodeItr)
ConstNodeIterator getEdgeOtherNode (const ConstEdgeIterator &edgeItr, const ConstNodeIterator &nodeItr) const
void removeEdge (const EdgeIterator &edgeItr)
EdgeIterator edgesBegin ()
ConstEdgeIterator edgesBegin () const
EdgeIterator edgesEnd ()
ConstEdgeIterator edgesEnd () const
void clear ()
template<typename OStream>
void printDot (OStream &os) const
template<typename OStream>
void printDot (OStream &os)
template<typename OStream>
void dumpTo (OStream &os) const
template<typename OStream>
void dumpTo (OStream &os)

Protected Member Functions

 GraphBase ()
NodeEntry & getNodeEntry (const NodeIterator &nodeItr)
const NodeEntry & getNodeEntry (const ConstNodeIterator &nodeItr) const
EdgeEntry & getEdgeEntry (const EdgeIterator &edgeItr)
const EdgeEntry & getEdgeEntry (const ConstEdgeIterator &edgeItr) const
NodeIterator addConstructedNode (const NodeEntry &nodeEntry)
EdgeIterator addConstructedEdge (const EdgeEntry &edgeEntry)


Detailed Description

template<typename NodeEntry, typename EdgeEntry>
class PBQP::GraphBase< NodeEntry, EdgeEntry >

Base for concrete graph classes. Provides a basic set of graph operations which are useful for PBQP solvers.

Definition at line 40 of file GraphBase.h.


Member Typedef Documentation

template<typename NodeEntry, typename EdgeEntry>
typedef NodeList::iterator PBQP::GraphBase< NodeEntry, EdgeEntry >::NodeIterator

Iterates over the nodes of a graph.

Reimplemented in PBQP::AnnotatedGraph< NodeData, EdgeData >.

Definition at line 60 of file GraphBase.h.

template<typename NodeEntry, typename EdgeEntry>
typedef NodeList::const_iterator PBQP::GraphBase< NodeEntry, EdgeEntry >::ConstNodeIterator

Iterates over the nodes of a const graph.

Reimplemented in PBQP::AnnotatedGraph< NodeData, EdgeData >.

Definition at line 62 of file GraphBase.h.

template<typename NodeEntry, typename EdgeEntry>
typedef EdgeList::iterator PBQP::GraphBase< NodeEntry, EdgeEntry >::EdgeIterator

Iterates over the edges of a graph.

Reimplemented in PBQP::AnnotatedGraph< NodeData, EdgeData >.

Definition at line 64 of file GraphBase.h.

template<typename NodeEntry, typename EdgeEntry>
typedef EdgeList::const_iterator PBQP::GraphBase< NodeEntry, EdgeEntry >::ConstEdgeIterator

Iterates over the edges of a const graph.

Reimplemented in PBQP::AnnotatedGraph< NodeData, EdgeData >.

Definition at line 66 of file GraphBase.h.

template<typename NodeEntry, typename EdgeEntry>
typedef NodeBaseTraits<ThisGraphT>::AdjEdgeIterator PBQP::GraphBase< NodeEntry, EdgeEntry >::AdjEdgeIterator

Iterates over the edges attached to a node.

Definition at line 70 of file GraphBase.h.

template<typename NodeEntry, typename EdgeEntry>
typedef NodeBaseTraits<ThisGraphT>::ConstAdjEdgeIterator PBQP::GraphBase< NodeEntry, EdgeEntry >::ConstAdjEdgeIterator

Iterates over the edges attached to a node in a const graph.

Definition at line 74 of file GraphBase.h.


Constructor & Destructor Documentation

template<typename NodeEntry, typename EdgeEntry>
PBQP::GraphBase< NodeEntry, EdgeEntry >::GraphBase (  )  [inline, protected]

Definition at line 102 of file GraphBase.h.


Member Function Documentation

template<typename NodeEntry, typename EdgeEntry>
NodeEntry& PBQP::GraphBase< NodeEntry, EdgeEntry >::getNodeEntry ( const NodeIterator &  nodeItr  )  [inline, protected]

template<typename NodeEntry, typename EdgeEntry>
const NodeEntry& PBQP::GraphBase< NodeEntry, EdgeEntry >::getNodeEntry ( const ConstNodeIterator &  nodeItr  )  const [inline, protected]

Definition at line 105 of file GraphBase.h.

template<typename NodeEntry, typename EdgeEntry>
EdgeEntry& PBQP::GraphBase< NodeEntry, EdgeEntry >::getEdgeEntry ( const EdgeIterator &  edgeItr  )  [inline, protected]

template<typename NodeEntry, typename EdgeEntry>
const EdgeEntry& PBQP::GraphBase< NodeEntry, EdgeEntry >::getEdgeEntry ( const ConstEdgeIterator &  edgeItr  )  const [inline, protected]

Definition at line 110 of file GraphBase.h.

template<typename NodeEntry, typename EdgeEntry>
NodeIterator PBQP::GraphBase< NodeEntry, EdgeEntry >::addConstructedNode ( const NodeEntry &  nodeEntry  )  [inline, protected]

template<typename NodeEntry, typename EdgeEntry>
EdgeIterator PBQP::GraphBase< NodeEntry, EdgeEntry >::addConstructedEdge ( const EdgeEntry &  edgeEntry  )  [inline, protected]

template<typename NodeEntry, typename EdgeEntry>
unsigned PBQP::GraphBase< NodeEntry, EdgeEntry >::getNumNodes (  )  const [inline]

template<typename NodeEntry, typename EdgeEntry>
unsigned PBQP::GraphBase< NodeEntry, EdgeEntry >::getNumEdges (  )  const [inline]

Returns the number of edges in this graph.

Definition at line 163 of file GraphBase.h.

template<typename NodeEntry, typename EdgeEntry>
Vector& PBQP::GraphBase< NodeEntry, EdgeEntry >::getNodeCosts ( const NodeIterator &  nodeItr  )  [inline]

template<typename NodeEntry, typename EdgeEntry>
const Vector& PBQP::GraphBase< NodeEntry, EdgeEntry >::getNodeCosts ( const ConstNodeIterator &  nodeItr  )  const [inline]

Return the cost vector for the give node.

Definition at line 171 of file GraphBase.h.

template<typename NodeEntry, typename EdgeEntry>
unsigned PBQP::GraphBase< NodeEntry, EdgeEntry >::getNodeDegree ( const NodeIterator &  nodeItr  )  const [inline]

Return the degree of the given node.

Definition at line 176 of file GraphBase.h.

template<typename NodeEntry, typename EdgeEntry>
void PBQP::GraphBase< NodeEntry, EdgeEntry >::assignNodeIDs (  )  [inline]

template<typename NodeEntry, typename EdgeEntry>
void PBQP::GraphBase< NodeEntry, EdgeEntry >::assignNodeIDs ( const std::vector< NodeIterator > &  nodeOrdering  )  [inline]

Assigns sequential IDs to the nodes using the ordering of the given vector.

Definition at line 195 of file GraphBase.h.

template<typename NodeEntry, typename EdgeEntry>
bool PBQP::GraphBase< NodeEntry, EdgeEntry >::areNodeIDsValid (  )  const [inline]

template<typename NodeEntry, typename EdgeEntry>
unsigned PBQP::GraphBase< NodeEntry, EdgeEntry >::getNodeID ( const ConstNodeIterator &  nodeItr  )  const [inline]

template<typename NodeEntry, typename EdgeEntry>
NodeIterator PBQP::GraphBase< NodeEntry, EdgeEntry >::getNodeItr ( unsigned  nodeID  )  [inline]

Returns the iterator associated with the given node ID.

Definition at line 219 of file GraphBase.h.

Referenced by PBQP::ExhaustiveSolverImpl::solve().

template<typename NodeEntry, typename EdgeEntry>
ConstNodeIterator PBQP::GraphBase< NodeEntry, EdgeEntry >::getNodeItr ( unsigned  nodeID  )  const [inline]

Returns the iterator associated with the given node ID.

Definition at line 225 of file GraphBase.h.

template<typename NodeEntry, typename EdgeEntry>
void PBQP::GraphBase< NodeEntry, EdgeEntry >::removeNode ( const NodeIterator &  nodeItr  )  [inline]

Removes the given node (and all attached edges) from the graph.

Definition at line 231 of file GraphBase.h.

template<typename NodeEntry, typename EdgeEntry>
NodeIterator PBQP::GraphBase< NodeEntry, EdgeEntry >::nodesBegin (  )  [inline]

template<typename NodeEntry, typename EdgeEntry>
ConstNodeIterator PBQP::GraphBase< NodeEntry, EdgeEntry >::nodesBegin (  )  const [inline]

Definition at line 261 of file GraphBase.h.

template<typename NodeEntry, typename EdgeEntry>
NodeIterator PBQP::GraphBase< NodeEntry, EdgeEntry >::nodesEnd (  )  [inline]

template<typename NodeEntry, typename EdgeEntry>
ConstNodeIterator PBQP::GraphBase< NodeEntry, EdgeEntry >::nodesEnd (  )  const [inline]

Definition at line 263 of file GraphBase.h.

template<typename NodeEntry, typename EdgeEntry>
AdjEdgeIterator PBQP::GraphBase< NodeEntry, EdgeEntry >::adjEdgesBegin ( const NodeIterator &  nodeItr  )  [inline]

template<typename NodeEntry, typename EdgeEntry>
ConstAdjEdgeIterator PBQP::GraphBase< NodeEntry, EdgeEntry >::adjEdgesBegin ( const ConstNodeIterator &  nodeItr  )  const [inline]

Definition at line 269 of file GraphBase.h.

template<typename NodeEntry, typename EdgeEntry>
AdjEdgeIterator PBQP::GraphBase< NodeEntry, EdgeEntry >::adjEdgesEnd ( const NodeIterator &  nodeItr  )  [inline]

template<typename NodeEntry, typename EdgeEntry>
ConstAdjEdgeIterator PBQP::GraphBase< NodeEntry, EdgeEntry >::adjEdgesEnd ( const ConstNodeIterator &  nodeItr  )  const [inline]

Definition at line 277 of file GraphBase.h.

template<typename NodeEntry, typename EdgeEntry>
EdgeIterator PBQP::GraphBase< NodeEntry, EdgeEntry >::findEdge ( const NodeIterator &  node1Itr,
const NodeIterator &  node2Itr 
) [inline]

template<typename NodeEntry, typename EdgeEntry>
ConstEdgeIterator PBQP::GraphBase< NodeEntry, EdgeEntry >::findEdge ( const ConstNodeIterator &  node1Itr,
const ConstNodeIterator &  node2Itr 
) const [inline]

Definition at line 296 of file GraphBase.h.

template<typename NodeEntry, typename EdgeEntry>
Matrix& PBQP::GraphBase< NodeEntry, EdgeEntry >::getEdgeCosts ( const EdgeIterator &  edgeItr  )  [inline]

template<typename NodeEntry, typename EdgeEntry>
const Matrix& PBQP::GraphBase< NodeEntry, EdgeEntry >::getEdgeCosts ( const ConstEdgeIterator &  edgeItr  )  const [inline]

Definition at line 315 of file GraphBase.h.

template<typename NodeEntry, typename EdgeEntry>
NodeIterator PBQP::GraphBase< NodeEntry, EdgeEntry >::getEdgeNode1Itr ( const EdgeIterator &  edgeItr  )  [inline]

template<typename NodeEntry, typename EdgeEntry>
ConstNodeIterator PBQP::GraphBase< NodeEntry, EdgeEntry >::getEdgeNode1Itr ( const ConstEdgeIterator &  edgeItr  )  const [inline]

Definition at line 323 of file GraphBase.h.

template<typename NodeEntry, typename EdgeEntry>
NodeIterator PBQP::GraphBase< NodeEntry, EdgeEntry >::getEdgeNode2Itr ( const EdgeIterator &  edgeItr  )  [inline]

template<typename NodeEntry, typename EdgeEntry>
ConstNodeIterator PBQP::GraphBase< NodeEntry, EdgeEntry >::getEdgeNode2Itr ( const ConstEdgeIterator &  edgeItr  )  const [inline]

Definition at line 331 of file GraphBase.h.

template<typename NodeEntry, typename EdgeEntry>
NodeIterator PBQP::GraphBase< NodeEntry, EdgeEntry >::getEdgeOtherNode ( const EdgeIterator &  edgeItr,
const NodeIterator &  nodeItr 
) [inline]

template<typename NodeEntry, typename EdgeEntry>
ConstNodeIterator PBQP::GraphBase< NodeEntry, EdgeEntry >::getEdgeOtherNode ( const ConstEdgeIterator &  edgeItr,
const ConstNodeIterator &  nodeItr 
) const [inline]

Definition at line 346 of file GraphBase.h.

template<typename NodeEntry, typename EdgeEntry>
void PBQP::GraphBase< NodeEntry, EdgeEntry >::removeEdge ( const EdgeIterator &  edgeItr  )  [inline]

template<typename NodeEntry, typename EdgeEntry>
EdgeIterator PBQP::GraphBase< NodeEntry, EdgeEntry >::edgesBegin (  )  [inline]

template<typename NodeEntry, typename EdgeEntry>
ConstEdgeIterator PBQP::GraphBase< NodeEntry, EdgeEntry >::edgesBegin (  )  const [inline]

Definition at line 379 of file GraphBase.h.

template<typename NodeEntry, typename EdgeEntry>
EdgeIterator PBQP::GraphBase< NodeEntry, EdgeEntry >::edgesEnd (  )  [inline]

template<typename NodeEntry, typename EdgeEntry>
ConstEdgeIterator PBQP::GraphBase< NodeEntry, EdgeEntry >::edgesEnd (  )  const [inline]

Definition at line 381 of file GraphBase.h.

template<typename NodeEntry, typename EdgeEntry>
void PBQP::GraphBase< NodeEntry, EdgeEntry >::clear (  )  [inline]

template<typename NodeEntry, typename EdgeEntry>
template<typename OStream>
void PBQP::GraphBase< NodeEntry, EdgeEntry >::printDot ( OStream &  os  )  const [inline]

template<typename NodeEntry, typename EdgeEntry>
template<typename OStream>
void PBQP::GraphBase< NodeEntry, EdgeEntry >::printDot ( OStream &  os  )  [inline]

Definition at line 428 of file GraphBase.h.

template<typename NodeEntry, typename EdgeEntry>
template<typename OStream>
void PBQP::GraphBase< NodeEntry, EdgeEntry >::dumpTo ( OStream &  os  )  const [inline]

template<typename NodeEntry, typename EdgeEntry>
template<typename OStream>
void PBQP::GraphBase< NodeEntry, EdgeEntry >::dumpTo ( OStream &  os  )  [inline]

Definition at line 460 of file GraphBase.h.


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