//============================================================================ // Name : reverse_mutator.cpp // Author : al.zatv zatv@bk.ru // Version : // Copyright : Your copyright notice // Description : Hello World in C++, Ansi-style //============================================================================ // taken from: //======================================================================= // Copyright 1997, 1998, 1999, 2000 University of Notre Dame. // Authors: Andrew Lumsdaine, Lie-Quan Lee, Jeremy G. Siek // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) //======================================================================= #include #include #include #include "reverse_graph_mutable.hpp" #include #include #include #include "reverse_graph_mutable.hpp" void test_in_work() { using namespace std; using namespace boost; adjacency_list G; auto rG=make_reverse_graph(G); auto vd0=add_vertex(rG); auto vd1=add_vertex(rG); auto vd2=add_vertex(rG); auto vd3=add_vertex(rG); add_edge(vd3,vd2,rG); add_edge(vd0,vd1,rG); add_edge(vd0,vd2,rG); add_edge(vd1,vd3,rG); add_edge(vd0,vd3,rG); auto vdX=add_vertex(rG); adjacency_list::edge_descriptor ede; std::tie(ede,ignore)=add_edge(vd0,vdX,rG); remove_edge(ede,rG); remove_vertex(vdX,rG); auto allE=edges(rG); remove_edge(allE.first,rG); { ofstream fout("del-test.dot"); write_graphviz(fout,G); } system("dotty del-test.dot"); return; } /* **************************************** *main **************************************** */ int main(int,char*[]) { test_in_work(); using namespace boost; { typedef adjacency_list, property > normGraph; typedef reverse_graph Graph; typedef graph_traits::vertex_descriptor Vertex; typedef graph_traits::edge_descriptor Edge; function_requires< VertexListGraphConcept >(); function_requires< EdgeListGraphConcept >(); function_requires< IncidenceGraphConcept >(); function_requires< AdjacencyGraphConcept >(); function_requires< BidirectionalGraphConcept >(); //TODO: function_requires< MutableBidirectionalGraphConcept >(); function_requires< MutableEdgeListGraphConcept >(); function_requires< VertexMutablePropertyGraphConcept >(); function_requires< EdgeMutablePropertyGraphConcept >(); function_requires< ReadablePropertyGraphConcept >(); function_requires< LvaluePropertyGraphConcept >(); function_requires< LvaluePropertyGraphConcept >(); } // Checking adjacency_list with EdgeList=setS { typedef adjacency_list, property > fwdGraph; typedef reverse_graph Graph; typedef graph_traits::vertex_descriptor Vertex; typedef graph_traits::edge_descriptor Edge; function_requires< VertexListGraphConcept >(); function_requires< EdgeListGraphConcept >(); function_requires< IncidenceGraphConcept >(); function_requires< AdjacencyGraphConcept >(); function_requires< BidirectionalGraphConcept >(); //TODO: function_requires< MutableBidirectionalGraphConcept >(); function_requires< MutableEdgeListGraphConcept >(); function_requires< VertexMutablePropertyGraphConcept >(); function_requires< EdgeMutablePropertyGraphConcept >(); function_requires< ReadablePropertyGraphConcept >(); function_requires< LvaluePropertyGraphConcept >(); function_requires< LvaluePropertyGraphConcept >(); } { typedef adjacency_list fwdGraph; typedef reverse_graph Graph; typedef graph_traits::vertex_descriptor Vertex; typedef graph_traits::edge_descriptor Edge; function_requires< VertexListGraphConcept >(); function_requires< EdgeListGraphConcept >(); function_requires< IncidenceGraphConcept >(); function_requires< AdjacencyGraphConcept >(); function_requires< BidirectionalGraphConcept >(); //TODO: function_requires< MutableBidirectionalGraphConcept >(); function_requires< MutableEdgeListGraphConcept >(); function_requires< ReadablePropertyGraphConcept >(); } // Checking EdgeList=setS with no properties { typedef adjacency_list fwdGraph; typedef reverse_graph Graph; typedef graph_traits::vertex_descriptor Vertex; typedef graph_traits::edge_descriptor Edge; function_requires< VertexListGraphConcept >(); function_requires< EdgeListGraphConcept >(); function_requires< IncidenceGraphConcept >(); function_requires< AdjacencyGraphConcept >(); function_requires< BidirectionalGraphConcept >(); //TODO: function_requires< MutableBidirectionalGraphConcept >(); function_requires< MutableEdgeListGraphConcept >(); function_requires< ReadablePropertyGraphConcept >(); } return 0; }