.. _cpp-compare: ********************************************************** compare.hpp ********************************************************** Full path: ``graph_canon/compare.hpp`` .. default-domain:: cpp .. default-role:: cpp:expr .. cpp:namespace:: graph_canon .. function:: template \ bool ordered_graph_equal( \ const ordered_graph &g_left, \ const ordered_graph &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` and `edge_equal`, can be used to compare labels. If the two graphs are not equal the reason is indicated by calling a corresponding member function on `visitor`. See `graph_compare_null_visitor` for the list of member functions that must exist. .. function:: template \ bool ordered_graph_less( \ const ordered_graph &g_left, \ const ordered_graph &g_right, \ VertexLess vertex_less, EdgeLess edge_less, \ VertexEqual vertex_equal, EdgeEqual edge_equal) Compare two ordered graphs and return `true` when `g_left` is considered smaller than `g_right`. For labelled graphs the binary predicates `vertex_less`, `edge_less`, `vertex_equal`, and `edge_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`. .. function:: void at_num_vertices() const Called when the two graphs have different number of vertices. .. function:: template \ void at_vertex_compare(VertexL, VertexR) const Called when the user-defined vertex predicate returns `false` for two vertices with the same index. .. function:: template \ void at_out_degree(VertexL, VertexR) const Called when two verices with the same index have different out-degrees. .. function:: template \ void at_out_edge(EdgeL, EdgeR) const Called when two edges :math:`(u_l, v_l)`, :math:`(u_r, v_r)` from the two graphs, with :math:`u_l` and :math:`u_r` have the same index, the edges are in the same position in their respective out-edge lists, but :math:`v_l` and :math:`v_r` have different index. .. function:: template \ void at_edge_compare(EdgeL, EdgeR) const Called when two edges :math:`(u_l, v_l)`, :math:`(u_r, v_r)` from the two graphs, with :math:`u_l` and :math:`u_r` have the same index, the edges are in the same position in their respective out-edge lists, :math:`v_l` and :math:`v_r` have the same index, but the user-defined predicate returns `false`.