Camargue
Public Member Functions | Public Attributes | List of all members
CMR::Graph::AdjList Struct Reference

Representation of a graph as an adjacency list. More...

#include <graph.hpp>

Public Member Functions

 AdjList (int ncount, const std::vector< Edge > &ref_elist)
 An AdjList with ncount nodes for all the edges in ref_elist.
 
template<typename EndPt_type >
 AdjList (int ncount, const std::vector< EndPt_type > &elist)
 An AdjList for a vector of structs derived from EndPt. More...
 
 AdjList (int ncount, const std::vector< Edge > &ref_elist, const std::vector< double > &ref_elist_caps, const std::vector< int > &keep_indices)
 A support graph type AdjList.
 
 AdjList (AdjList &&AL) noexcept
 
AdjListoperator= (AdjList &&AL) noexcept
 
bool connected (std::vector< int > &island, int start_node)
 Is the graph connected.
 
void dfs (int start_node, std::vector< int > &island)
 Performs a depth-first beginning with start_node.
 
const AdjObjfind_edge (int end0, int end1) const
 Get a pointer to the AdjObj with end points end0 and end1. More...
 
AdjObjfind_edge (int end0, int end1)
 
void add_edge (int end0, int end1, int index, double val)
 Add the edge with end points end0 end1 to the AdjList. More...
 

Public Attributes

int node_count
 
int edge_count
 
std::vector< Nodenodelist
 

Detailed Description

Representation of a graph as an adjacency list.

Constructor & Destructor Documentation

template<typename EndPt_type >
CMR::Graph::AdjList::AdjList ( int  ncount,
const std::vector< EndPt_type > &  elist 
)

An AdjList for a vector of structs derived from EndPt.

Template Parameters
EndPt_typethe edge representation being used. Should be derived from CMR::EndPt.

Member Function Documentation

void CMR::Graph::AdjList::add_edge ( int  end0,
int  end1,
int  index,
double  val 
)

Add the edge with end points end0 end1 to the AdjList.

The edge is added iff it is not already present.

Parameters
[in]indexthe index, relative to some CoreGraph reference Edge set, of the edge to be added.
[in]valthe value which shall become the val field of the added AdjObj.
const AdjObj* CMR::Graph::AdjList::find_edge ( int  end0,
int  end1 
) const
inline

Get a pointer to the AdjObj with end points end0 and end1.

Returns
nullptr if not found, else a pointer to the AdjObj.

The documentation for this struct was generated from the following files: