/usr/include/boost/graph
NameSizeModeActions
detail/-0755rm
distributed/-0755rm
parallel/-0755rm
planar_detail/-0755rm
property_maps/-0755rm
accounting.hpp8760644editdlrm
adjacency_iterator.hpp28990644editdlrm
adjacency_list.hpp136920644editdlrm
adjacency_list_io.hpp118490644editdlrm
adjacency_matrix.hpp457430644editdlrm
adj_list_serialize.hpp45230644editdlrm
astar_search.hpp267360644editdlrm
bandwidth.hpp29920644editdlrm
bc_clustering.hpp59370644editdlrm
bellman_ford_shortest_paths.hpp82290644editdlrm
betweenness_centrality.hpp262900644editdlrm
biconnected_components.hpp167010644editdlrm
bipartite.hpp134920644editdlrm
boyer_myrvold_planar_test.hpp98490644editdlrm
boykov_kolmogorov_max_flow.hpp473420644editdlrm
breadth_first_search.hpp147510644editdlrm
bron_kerbosch_all_cliques.hpp117360644editdlrm
buffer_concepts.hpp24290644editdlrm
chrobak_payne_drawing.hpp86410644editdlrm
circle_layout.hpp19240644editdlrm
closeness_centrality.hpp60570644editdlrm
clustering_coefficient.hpp57260644editdlrm
compressed_sparse_row_graph.hpp698870644editdlrm
connected_components.hpp41340644editdlrm
copy.hpp212250644editdlrm
core_numbers.hpp136630644editdlrm
create_condensation_graph.hpp31590644editdlrm
cuthill_mckee_ordering.hpp59920644editdlrm
cycle_canceling.hpp66450644editdlrm
dag_shortest_paths.hpp60640644editdlrm
degree_centrality.hpp42360644editdlrm
depth_first_search.hpp154300644editdlrm
dijkstra_shortest_paths.hpp236870644editdlrm
dijkstra_shortest_paths_no_color_map.hpp96200644editdlrm
dimacs.hpp104480644editdlrm
directed_graph.hpp242140644editdlrm
dll_import_export.hpp8920644editdlrm
dominator_tree.hpp175530644editdlrm
eccentricity.hpp46110644editdlrm
edge_coloring.hpp68090644editdlrm
edge_connectivity.hpp67960644editdlrm
edge_list.hpp99480644editdlrm
edmonds_karp_max_flow.hpp101770644editdlrm
edmunds_karp_max_flow.hpp9820644editdlrm
erdos_renyi_generator.hpp72570644editdlrm
exception.hpp14660644editdlrm
exterior_property.hpp42890644editdlrm
filtered_graph.hpp200980644editdlrm
find_flow_cost.hpp18590644editdlrm
floyd_warshall_shortest.hpp85100644editdlrm
fruchterman_reingold.hpp173250644editdlrm
geodesic_distance.hpp80150644editdlrm
graphml.hpp134600644editdlrm
graphviz.hpp335030644editdlrm
graph_archetypes.hpp110080644editdlrm
graph_as_tree.hpp45320644editdlrm
graph_concepts.hpp197850644editdlrm
graph_mutability_traits.hpp49950644editdlrm
graph_selectors.hpp12740644editdlrm
graph_stats.hpp43940644editdlrm
graph_traits.hpp130650644editdlrm
graph_utility.hpp161820644editdlrm
grid_graph.hpp338300644editdlrm
gursoy_atun_layout.hpp132480644editdlrm
hawick_circuits.hpp145930644editdlrm
howard_cycle_ratio.hpp231070644editdlrm
incremental_components.hpp82240644editdlrm
isomorphism.hpp263080644editdlrm
is_kuratowski_subgraph.hpp102600644editdlrm
is_straight_line_drawing.hpp72300644editdlrm
iteration_macros.hpp116590644editdlrm
iteration_macros_undef.hpp6730644editdlrm
johnson_all_pairs_shortest.hpp76460644editdlrm
kamada_kawai_spring_layout.hpp280480644editdlrm
king_ordering.hpp121010644editdlrm
kruskal_min_spanning_tree.hpp57430644editdlrm
labeled_graph.hpp309140644editdlrm
leda_graph.hpp287890644editdlrm
lookup_edge.hpp18940644editdlrm
loop_erased_random_walk.hpp44360644editdlrm
make_biconnected_planar.hpp35130644editdlrm
make_connected.hpp26450644editdlrm
make_maximal_planar.hpp75780644editdlrm
matrix_as_graph.hpp72270644editdlrm
maximum_adjacency_search.hpp151250644editdlrm
maximum_weighted_matching.hpp497220644editdlrm
max_cardinality_matching.hpp310000644editdlrm
mcgregor_common_subgraphs.hpp434700644editdlrm
mesh_graph_generator.hpp56160644editdlrm
metis.hpp109820644editdlrm
metric_tsp_approx.hpp108090644editdlrm
minimum_degree_ordering.hpp270870644editdlrm
named_function_params.hpp396390644editdlrm
named_graph.hpp206140644editdlrm
neighbor_bfs.hpp117630644editdlrm
numeric_values.hpp18140644editdlrm
one_bit_color_map.hpp32770644editdlrm
overloading.hpp15840644editdlrm
page_rank.hpp61640644editdlrm
planar_canonical_ordering.hpp72030644editdlrm
planar_face_traversal.hpp60200644editdlrm
plod_generator.hpp77080644editdlrm
point_traits.hpp7820644editdlrm
prim_minimum_spanning_tree.hpp29600644editdlrm
profile.hpp13270644editdlrm
properties.hpp124170644editdlrm
property_iter_range.hpp43450644editdlrm
push_relabel_max_flow.hpp347370644editdlrm
random.hpp96720644editdlrm
random_layout.hpp9880644editdlrm
random_spanning_tree.hpp57750644editdlrm
read_dimacs.hpp120800644editdlrm
relax.hpp44000644editdlrm
reverse_graph.hpp224020644editdlrm
rmat_graph_generator.hpp192910644editdlrm
r_c_shortest_paths.hpp306730644editdlrm
sequential_vertex_coloring.hpp45620644editdlrm
simple_point.hpp6280644editdlrm
sloan_ordering.hpp155400644editdlrm
smallest_last_ordering.hpp54580644editdlrm
small_world_generator.hpp36700644editdlrm
ssca_graph_generator.hpp65640644editdlrm
stanford_graph.hpp201260644editdlrm
stoer_wagner_min_cut.hpp124150644editdlrm
strong_components.hpp130090644editdlrm
st_connected.hpp28520644editdlrm
subgraph.hpp399960644editdlrm
successive_shortest_path_nonnegative_weights.hpp104130644editdlrm
tiernan_all_cycles.hpp125470644editdlrm
topological_sort.hpp26110644editdlrm
topology.hpp203890644editdlrm
transitive_closure.hpp142600644editdlrm
transitive_reduction.hpp53260644editdlrm
transpose_graph.hpp11980644editdlrm
tree_traits.hpp13380644editdlrm
two_bit_color_map.hpp35100644editdlrm
two_graphs_common_spanning_trees.hpp349960644editdlrm
undirected_dfs.hpp106720644editdlrm
undirected_graph.hpp252760644editdlrm
use_mpi.hpp4370644editdlrm
vector_as_graph.hpp104740644editdlrm
vertex_and_edge_range.hpp55280644editdlrm
vf2_sub_graph_iso.hpp485850644editdlrm
visitors.hpp113180644editdlrm
wavefront.hpp39320644editdlrm
write_dimacs.hpp28890644editdlrm
Edit: /usr/include/boost/graph/vector_as_graph.hpp (10474B)
//======================================================================= // Copyright 1997, 1998, 1999, 2000 University of Notre Dame. // Copyright 2006 The Trustees of Indiana University. // Copyright (C) 2001 Vladimir Prus // Authors: Andrew Lumsdaine, Lie-Quan Lee, Jeremy G. Siek, Douglas Gregor // // 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) //======================================================================= // The mutating functions (add_edge, etc.) were added by Vladimir Prus. #ifndef BOOST_VECTOR_AS_GRAPH_HPP #define BOOST_VECTOR_AS_GRAPH_HPP #include #include #include #include #include #include #include #include #include #include #include /* This module implements the VertexListGraph concept using a std::vector as the "back-bone" of the graph (the vector *is* the graph object). The edge-lists type of the graph is templated, so the user can choose any STL container, so long as the value_type of the container is convertible to the size_type of the vector. For now any graph properties must be stored seperately. This module requires the C++ compiler to support partial specialization for the graph_traits class, so this is not portable to VC++. */ namespace boost { namespace detail { template < class EdgeList > struct val_out_edge_ret; template < class EdgeList > struct val_out_edge_iter; template < class EdgeList > struct val_edge; } } namespace boost { struct vector_as_graph_traversal_tag : public vertex_list_graph_tag, public adjacency_graph_tag, public incidence_graph_tag { }; template < class EdgeList > struct graph_traits< std::vector< EdgeList > > { typedef typename EdgeList::value_type V; typedef V vertex_descriptor; typedef typename detail::val_edge< EdgeList >::type edge_descriptor; typedef typename EdgeList::const_iterator adjacency_iterator; typedef typename detail::val_out_edge_iter< EdgeList >::type out_edge_iterator; typedef void in_edge_iterator; typedef void edge_iterator; typedef counting_iterator< V > vertex_iterator; typedef directed_tag directed_category; typedef allow_parallel_edge_tag edge_parallel_category; typedef vector_as_graph_traversal_tag traversal_category; typedef typename std::vector< EdgeList >::size_type vertices_size_type; typedef void edges_size_type; typedef typename EdgeList::size_type degree_size_type; static V null_vertex() { return V(-1); } }; template < class EdgeList > struct edge_property_type< std::vector< EdgeList > > { typedef void type; }; template < class EdgeList > struct vertex_property_type< std::vector< EdgeList > > { typedef void type; }; template < class EdgeList > struct graph_property_type< std::vector< EdgeList > > { typedef void type; }; } namespace boost { namespace detail { // "val" is short for Vector Adjacency List template < class EdgeList > struct val_edge { typedef typename EdgeList::value_type V; typedef std::pair< V, V > type; }; // need rewrite this using boost::iterator_adaptor template < class V, class Iter > class val_out_edge_iterator { typedef val_out_edge_iterator self; typedef std::pair< V, V > Edge; public: typedef std::input_iterator_tag iterator_category; typedef std::pair< V, V > value_type; typedef std::ptrdiff_t difference_type; typedef std::pair< V, V >* pointer; typedef const std::pair< V, V > reference; val_out_edge_iterator() {} val_out_edge_iterator(V s, Iter i) : _source(s), _iter(i) {} Edge operator*() const { return Edge(_source, *_iter); } self& operator++() { ++_iter; return *this; } self operator++(int) { self t = *this; ++_iter; return t; } bool operator==(const self& x) const { return _iter == x._iter; } bool operator!=(const self& x) const { return _iter != x._iter; } protected: V _source; Iter _iter; }; template < class EdgeList > struct val_out_edge_iter { typedef typename EdgeList::value_type V; typedef typename EdgeList::const_iterator Iter; typedef val_out_edge_iterator< V, Iter > type; }; template < class EdgeList > struct val_out_edge_ret { typedef typename val_out_edge_iter< EdgeList >::type IncIter; typedef std::pair< IncIter, IncIter > type; }; } // namesapce detail template < class EdgeList, class Alloc > typename detail::val_out_edge_ret< EdgeList >::type out_edges( typename EdgeList::value_type v, const std::vector< EdgeList, Alloc >& g) { typedef typename detail::val_out_edge_iter< EdgeList >::type Iter; typedef typename detail::val_out_edge_ret< EdgeList >::type return_type; return return_type(Iter(v, g[v].begin()), Iter(v, g[v].end())); } template < class EdgeList, class Alloc > typename EdgeList::size_type out_degree( typename EdgeList::value_type v, const std::vector< EdgeList, Alloc >& g) { return g[v].size(); } template < class EdgeList, class Alloc > std::pair< typename EdgeList::const_iterator, typename EdgeList::const_iterator > adjacent_vertices( typename EdgeList::value_type v, const std::vector< EdgeList, Alloc >& g) { return std::make_pair(g[v].begin(), g[v].end()); } // source() and target() already provided for pairs in graph_traits.hpp template < class EdgeList, class Alloc > std::pair< boost::counting_iterator< typename EdgeList::value_type >, boost::counting_iterator< typename EdgeList::value_type > > vertices(const std::vector< EdgeList, Alloc >& v) { typedef boost::counting_iterator< typename EdgeList::value_type > Iter; return std::make_pair(Iter(0), Iter(v.size())); } template < class EdgeList, class Alloc > typename std::vector< EdgeList, Alloc >::size_type num_vertices( const std::vector< EdgeList, Alloc >& v) { return v.size(); } template < class EdgeList, class Allocator > typename std::pair< typename detail::val_edge< EdgeList >::type, bool > add_edge(typename EdgeList::value_type u, typename EdgeList::value_type v, std::vector< EdgeList, Allocator >& g) { typedef typename detail::val_edge< EdgeList >::type edge_type; g[u].insert(g[u].end(), v); return std::make_pair(edge_type(u, v), true); } template < class EdgeList, class Allocator > typename std::pair< typename detail::val_edge< EdgeList >::type, bool > edge( typename EdgeList::value_type u, typename EdgeList::value_type v, std::vector< EdgeList, Allocator >& g) { typedef typename detail::val_edge< EdgeList >::type edge_type; typename EdgeList::iterator i = g[u].begin(), end = g[u].end(); for (; i != end; ++i) if (*i == v) return std::make_pair(edge_type(u, v), true); return std::make_pair(edge_type(), false); } template < class EdgeList, class Allocator > void remove_edge(typename EdgeList::value_type u, typename EdgeList::value_type v, std::vector< EdgeList, Allocator >& g) { typename EdgeList::iterator i = std::remove(g[u].begin(), g[u].end(), v); if (i != g[u].end()) g[u].erase(i, g[u].end()); } template < class EdgeList, class Allocator > void remove_edge(typename detail::val_edge< EdgeList >::type e, std::vector< EdgeList, Allocator >& g) { typename EdgeList::value_type u, v; u = e.first; v = e.second; // FIXME: edge type does not fully specify the edge to be deleted typename EdgeList::iterator i = std::remove(g[u].begin(), g[u].end(), v); if (i != g[u].end()) g[u].erase(i, g[u].end()); } template < class EdgeList, class Allocator, class Predicate > void remove_edge_if(Predicate p, std::vector< EdgeList, Allocator >& g) { for (std::size_t u = 0; u < g.size(); ++u) { // Oops! gcc gets internal compiler error on compose_....... typedef typename EdgeList::iterator iterator; iterator b = g[u].begin(), e = g[u].end(); if (!g[u].empty()) { for (; b != e;) { if (p(std::make_pair(u, *b))) { --e; if (b == e) break; else iter_swap(b, e); } else { ++b; } } } if (e != g[u].end()) g[u].erase(e, g[u].end()); } } template < class EdgeList, class Allocator > typename EdgeList::value_type add_vertex(std::vector< EdgeList, Allocator >& g) { g.resize(g.size() + 1); return g.size() - 1; } template < class EdgeList, class Allocator > void clear_vertex( typename EdgeList::value_type u, std::vector< EdgeList, Allocator >& g) { g[u].clear(); for (std::size_t i = 0; i < g.size(); ++i) remove_edge(i, u, g); } template < class EdgeList, class Allocator > void remove_vertex( typename EdgeList::value_type u, std::vector< EdgeList, Allocator >& g) { typedef typename EdgeList::iterator iterator; clear_vertex(u, g); g.erase(g.begin() + u); for (std::size_t i = 0; i < g.size(); ++i) for (iterator it = g[i].begin(); it != g[i].end(); ++it) // after clear_vertex *it is never equal to u if (*it > u) --*it; } template < typename EdgeList, typename Allocator > struct property_map< std::vector< EdgeList, Allocator >, vertex_index_t > { typedef identity_property_map type; typedef type const_type; }; template < typename EdgeList, typename Allocator > identity_property_map get( vertex_index_t, const std::vector< EdgeList, Allocator >&) { return identity_property_map(); } template < typename EdgeList, typename Allocator > identity_property_map get(vertex_index_t, std::vector< EdgeList, Allocator >&) { return identity_property_map(); } } // namespace boost #endif // BOOST_VECTOR_AS_GRAPH_HPP