5.3. compare.hpp¶
Full path: graph_canon/compare.hpp
-
template<typename
GraphL
, typenameIndexMapL
, boolWithInEdgesL
, typenameGraphR
, typenameIndexMapR
, boolWithInEdgesR
, typenameVertexEqual
, typenameEdgeEqual
, typenameVisitor
>
boolordered_graph_equal
(const ordered_graph<GraphL, IndexMapL, WithInEdgesL> &g_left, const ordered_graph<GraphR, IndexMapR, WithInEdgesR> &g_right, VertexEqual vertex_equal, EdgeEqual edge_equal, Visitor &&visitor)¶ Compare two ordered graphs for equality. For labelled graphs the two binary predicates
vertex_equal
andedge_equal
, can be used to compare labels. If the two graphs are not equal the reason is indicated by calling a corresponding member function onvisitor
. Seegraph_compare_null_visitor
for the list of member functions that must exist.
-
template<typename
GraphL
, typenameIndexMapL
, boolWithInEdgesL
, typenameGraphR
, typenameIndexMapR
, boolWithInEdgesR
, typenameVertexLess
, typenameEdgeLess
, typenameVertexEqual
, typenameEdgeEqual
>
boolordered_graph_less
(const ordered_graph<GraphL, IndexMapL, WithInEdgesL> &g_left, const ordered_graph<GraphR, IndexMapR, WithInEdgesR> &g_right, VertexLess vertex_less, EdgeLess edge_less, VertexEqual vertex_equal, EdgeEqual edge_equal)¶ Compare two ordered graphs and return
true
wheng_left
is considered smaller thang_right
. For labelled graphs the binary predicatesvertex_less
,edge_less
,vertex_equal
, andedge_equal
, can be used to compare labels. The_equal
and_less
versions must be consistent with each other.
-
class
graph_compare_null_visitor
¶ A visitor class that can be used for
ordered_graph_equal
.-
void
at_num_vertices
() const¶ Called when the two graphs have different number of vertices.
-
template<typename
VertexL
, typenameVertexR
>
voidat_vertex_compare
(VertexL, VertexR) const¶ Called when the user-defined vertex predicate returns
false
for two vertices with the same index.
-
template<typename
VertexL
, typenameVertexR
>
voidat_out_degree
(VertexL, VertexR) const¶ Called when two verices with the same index have different out-degrees.
-
template<typename
EdgeL
, typenameEdgeR
>
voidat_out_edge
(EdgeL, EdgeR) const¶ Called when two edges \((u_l, v_l)\), \((u_r, v_r)\) from the two graphs, with \(u_l\) and \(u_r\) have the same index, the edges are in the same position in their respective out-edge lists, but \(v_l\) and \(v_r\) have different index.
-
template<typename
EdgeL
, typenameEdgeR
>
voidat_edge_compare
(EdgeL, EdgeR) const¶ Called when two edges \((u_l, v_l)\), \((u_r, v_r)\) from the two graphs, with \(u_l\) and \(u_r\) have the same index, the edges are in the same position in their respective out-edge lists, \(v_l\) and \(v_r\) have the same index, but the user-defined predicate returns
false
.
-
void