diff --git a/doc/compressed_sparse_row.html b/doc/compressed_sparse_row.html index 5086ac68..97d9fff7 100644 --- a/doc/compressed_sparse_row.html +++ b/doc/compressed_sparse_row.html @@ -49,17 +49,6 @@ function address(host, user) { applications or for very large graphs that you do not need to change.
-There are two interfaces to the compressed sparse row graph. The - old interface requires that all out edges from a single vertex are - sorted by target, and does not support construction of the graph from - unsorted arrays of sources and targets. The new interface has these - new constructors, but does not support incremental construction of the - graph or the edge_range() and edge() functions. The - old interface is the default, but will be removed in a later version of - Boost. To select the new interface, add #define - BOOST_GRAPH_USE_NEW_CSR_INTERFACE before including - <boost/graph/compressed_sparse_row_graph.hpp>.
-The CSR format stores vertices and edges in separate arrays, with the indices into these arrays corresponding to the identifier for the vertex or edge, respectively. The edge array is sorted by @@ -79,8 +68,8 @@ function address(host, user) { the template parameters. The Directed template parameter controls whether one edge direction (the default) or both directions are stored. A directed CSR graph has - Directed = directedS and a bidirectional CSR graph (only - supported with the new interface and with a limited set of constructors) + Directed = directedS and a bidirectional CSR graph (with + a limited set of constructors) has Directed = bidirectionalS.
@@ -498,7 +455,6 @@ void add_edges_sorted(BidirectionalIterator edge_begin to edge_end. This constructor uses extra memory to save the edge information before adding it to the graph, avoiding the requirement for the iterator to have multi-pass capability. - (This function is only provided by the new interface.)
[edge_begin,
edge_end) do not need to be sorted. Multiple passes will be made
over the edge range.
- (This function is only provided by the new interface.)
@@ -555,7 +510,6 @@ void add_edges_sorted(BidirectionalIterator of the graph, where m is distance from edge_begin to edge_end. Multiple passes will be made over the edge and property ranges. - (This function is only provided by the new interface.)
[edge_begin,
edge_end) must be sorted so that all edges originating
from vertex i preceed any edges originating from all
- vertices j where j > i. (The version of this
- constructor without the edges_are_sorted tag is deprecated and
- only provided by the old interface.)
+ vertices j where j > i.
@@ -624,9 +576,7 @@ void add_edges_sorted(BidirectionalIterator EdgeProperty. The iterator range [ep_iter, ep_ter + m) will be used to initialize the properties on the edges of the graph, where m is distance from - edge_begin to edge_end. (The version of this - constructor without the edges_are_sorted tag is deprecated and - only provided by the old interface.) + edge_begin to edge_end.
prop, if provided, is used to initialize the
graph property.
- (This function is only provided by the new interface.)
prop, if provided, is used to
initialize the graph property.
- (This function is only provided by the new interface.)
- std::pair<out_edge_iterator, out_edge_iterator> - edge_range(vertex_descriptor u, vertex_descriptor v, const compressed_sparse_row_graph&); -- -
- Returns all edges from u to v. Requires time - logarithmic in the number of edges outgoing from u. - (This function is only provided by the old interface.) -
- -
std::pair<edge_descriptor, bool>
edge(vertex_descriptor u, vertex_descriptor v, const compressed_sparse_row_graph&);
@@ -799,9 +733,8 @@ void add_edges_sorted(BidirectionalIterator
second value in the pair will be false. If multiple
edges exist from u to v, the first edge will
be returned; use edge_range
- to retrieve all edges. This function requires time logarithmic in the
- number of edges outgoing from u for the old interface, and
- linear time for the new interface.
+ to retrieve all edges. This function requires linear time in the
+ number of edges outgoing from u.
@@ -898,47 +831,6 @@ void set_property(const compressed_sparse_row_graph& g, GraphPropertyTag,
Incremental construction functions
-
-vertex_descriptor add_vertex(compressed_sparse_row_graph& g)
-
-
-
- Add a new vertex to the end of the graph g, and return a
- descriptor for that vertex. The new vertex will be greater than any of
- the previous vertices in g.
- (This function is only provided by the old interface.)
-
-
-
-
-
-vertex_descriptor add_vertices(vertices_size_type count, compressed_sparse_row_graph& g)
-
-
-
- Add count new vertices to the end of the graph g, and
- return a descriptor for the smallest new vertex. The new vertices will
- be greater than any of the previous vertices in g.
- (This function is only provided by the old interface.)
-
-
-
-
-
-edge_descriptor add_edge(vertex_descriptor src, vertex_descriptor tgt, compressed_sparse_row_graph& g)
-
-
-
- Add a new edge from src to tgt in the graph g,
- and return a descriptor for it. There must not be an edge in g
- whose source vertex is greater than src. If the vertex
- src has out edges before this operation is called, there must be
- none whose target is larger than tgt.
- (This function is only provided by the old interface.)
-
-
-
-
template<typename InputIterator>
void add_edges(InputIterator first, InputIterator last, compressed_sparse_row_graph& g)
@@ -951,7 +843,6 @@ void add_edges(InputIterator first, InputIterator last, compressed_sparse_row_gr
whose value_type is an std::pair of integer
values. These integer values are the source and target vertices of the
new edges. The edges do not need to be sorted.
- (This function is only provided by the new interface.)
@@ -972,7 +863,6 @@ void add_edges(InputIterator first, InputIterator last, EPIter ep_first, EPIter
of EPIter must be the edge property type of the graph. The
integer values produced by the InputIterator are the source and
target vertices of the new edges. The edges do not need to be sorted.
- (This function is only provided by the new interface.)
@@ -990,7 +880,6 @@ void add_edges_sorted(BidirectionalIterator first, BidirectionalIterator last, c
values. These integer values are the source and target vertices of the
new edges. The edges must be sorted in increasing order by source vertex
index.
- (This function is only provided by the new interface.)
@@ -1013,7 +902,6 @@ void add_edges_sorted(BidirectionalIterator first, BidirectionalIterator last, E
property type of the graph.
The edges must be sorted in increasing order by source vertex
index.
- (This function is only provided by the new interface.)
diff --git a/include/boost/graph/compressed_sparse_row_graph.hpp b/include/boost/graph/compressed_sparse_row_graph.hpp
index e12d4a34..7b62b3b2 100644
--- a/include/boost/graph/compressed_sparse_row_graph.hpp
+++ b/include/boost/graph/compressed_sparse_row_graph.hpp
@@ -47,26 +47,6 @@
# error You will need a compiler that conforms better to the C++ standard.
#endif
-#ifndef BOOST_GRAPH_USE_NEW_CSR_INTERFACE
-#if BOOST_VERSION >= 103800
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
-#pragma message ("Using deprecated BGL compressed sparse row graph interface --")
-#pragma message ("please see the documentation for the new interface and then")
-#pragma message ("#define BOOST_GRAPH_USE_NEW_CSR_INTERFACE before including")
-#pragma message ("")
-#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
-#endif
-#warning "Using deprecated BGL compressed sparse row graph interface --"
-#warning "please see the documentation for the new interface and then"
-#warning "#define BOOST_GRAPH_USE_NEW_CSR_INTERFACE before including"
-#warning ""
-#endif
-#endif // BOOST_GRAPH_USE_NEW_CSR_INTERFACE
-
-#ifndef BOOST_GRAPH_USE_NEW_CSR_INTERFACE
-#define BOOST_GRAPH_USE_OLD_CSR_INTERFACE
-#endif
-
namespace boost {
// A tag type indicating that the graph in question is a compressed
@@ -78,7 +58,6 @@ struct csr_graph_tag;
// vertex.
enum edges_are_sorted_t {edges_are_sorted};
-#ifdef BOOST_GRAPH_USE_NEW_CSR_INTERFACE
// A type (edges_are_sorted_global_t) and a value (edges_are_sorted_global)
// used to indicate that the edge list passed into the CSR graph is already
// sorted by source vertex.
@@ -131,8 +110,6 @@ enum construct_inplace_from_sources_and_targets_global_t {construct_inplace_from
// distributed CSR constructors.
enum edges_are_unsorted_global_t {edges_are_unsorted_global};
-#endif // BOOST_GRAPH_USE_NEW_CSR_INTERFACE
-
/****************************************************************************
* Local helper macros to reduce typing and clutter later on. *
****************************************************************************/
@@ -155,7 +132,6 @@ enum edges_are_unsorted_global_t {edges_are_unsorted_global};
compressed_sparse_row_graph
-#ifdef BOOST_GRAPH_USE_NEW_CSR_INTERFACE
namespace detail {
template
struct default_construct_iterator: public boost::iterator_facade, T, boost::random_access_traversal_tag, const T&> {
@@ -188,7 +164,6 @@ namespace detail {
}
};
}
-#endif // BOOST_GRAPH_USE_NEW_CSR_INTERFACE
/** Compressed sparse row graph.
*
@@ -280,7 +255,6 @@ class compressed_sparse_row_graph
compressed_sparse_row_graph(edges_are_unsorted_multi_pass_t,
@@ -336,38 +310,6 @@ class compressed_sparse_row_graph
- compressed_sparse_row_graph(InputIterator edge_begin, InputIterator edge_end,
- vertices_size_type numverts,
- edges_size_type numedges = 0,
- const GraphProperty& prop = GraphProperty())
- : m_property(prop)
- {
- m_forward.assign_from_sorted_edges(edge_begin, edge_end, identity_property_map(), keep_all(), numverts, numedges);
- inherited_vertex_properties::resize(numverts);
- }
-
- // From number of vertices and sorted list of edges (deprecated
- // interface)
- template
- compressed_sparse_row_graph(InputIterator edge_begin, InputIterator edge_end,
- EdgePropertyIterator ep_iter,
- vertices_size_type numverts,
- edges_size_type numedges = 0,
- const GraphProperty& prop = GraphProperty())
- : m_property(prop)
- {
- m_forward.assign_from_sorted_edges(edge_begin, edge_end, ep_iter, identity_property_map(), keep_all(), numverts, numedges);
- inherited_vertex_properties::resize(numverts);
- }
-
-#endif // BOOST_GRAPH_USE_OLD_CSR_INTERFACE
// From number of vertices and sorted list of edges (new interface)
template
@@ -396,7 +338,6 @@ class compressed_sparse_row_graph
compressed_sparse_row_graph(edges_are_sorted_global_t,
@@ -565,8 +506,6 @@ class compressed_sparse_row_graph
@@ -644,7 +583,6 @@ class compressed_sparse_row_graphadd_edges_internal(first, last, ep_iter, ep_iter_end, identity_property_map());
}
-#endif // BOOST_GRAPH_USE_NEW_CSR_INTERFACE
using inherited_vertex_properties::operator[];
@@ -784,8 +721,6 @@ class compressed_sparse_row_graph
@@ -1194,44 +1128,6 @@ add_vertices(typename BOOST_DIR_CSR_GRAPH_TYPE::vertices_size_type count, BOOST_
return old_num_verts_plus_one - 1;
}
-#ifdef BOOST_GRAPH_USE_OLD_CSR_INTERFACE
-// This function requires that (src, tgt) be lexicographically at least as
-// large as the largest edge in the graph so far
-template
-inline typename BOOST_DIR_CSR_GRAPH_TYPE::edge_descriptor
-add_edge(Vertex src, Vertex tgt, BOOST_DIR_CSR_GRAPH_TYPE& g) {
- assert ((g.m_last_source == 0 || src >= g.m_last_source - 1) &&
- src < num_vertices(g));
- EdgeIndex num_edges_orig = g.m_forward.m_column.size();
- for (; g.m_last_source <= src; ++g.m_last_source)
- g.m_forward.m_rowstart[g.m_last_source] = num_edges_orig;
- g.m_forward.m_rowstart[src + 1] = num_edges_orig + 1;
- g.m_forward.m_column.push_back(tgt);
- typedef typename BOOST_DIR_CSR_GRAPH_TYPE::edge_push_back_type push_back_type;
- g.edge_properties().push_back(push_back_type());
- return typename BOOST_DIR_CSR_GRAPH_TYPE::edge_descriptor(src, num_edges_orig);
-}
-
-// This function requires that src be at least as large as the largest source
-// in the graph so far
-template
-inline typename BOOST_DIR_CSR_GRAPH_TYPE::edge_descriptor
-add_edge(Vertex src, Vertex tgt,
- typename BOOST_DIR_CSR_GRAPH_TYPE::edge_bundled const& p,
- BOOST_DIR_CSR_GRAPH_TYPE& g) {
- assert ((g.m_last_source == 0 || src >= g.m_last_source - 1) &&
- src < num_vertices(g));
- EdgeIndex num_edges_orig = g.m_forward.m_column.size();
- for (; g.m_last_source <= src; ++g.m_last_source)
- g.m_forward.m_rowstart[g.m_last_source] = num_edges_orig;
- g.m_forward.m_rowstart[src + 1] = num_edges_orig + 1;
- g.m_forward.m_column.push_back(tgt);
- g.edge_properties().push_back(p);
- return typename BOOST_DIR_CSR_GRAPH_TYPE::edge_descriptor(src, num_edges_orig);
-}
-#endif // BOOST_GRAPH_USE_OLD_CSR_INTERFACE
-
-#ifdef BOOST_GRAPH_USE_NEW_CSR_INTERFACE
// Add edges from a sorted (smallest sources first) range of pairs and edge
// properties
template
@@ -1349,29 +1244,6 @@ target(typename BOOST_CSR_GRAPH_TYPE::edge_descriptor e,
return g.m_forward.m_column[e.idx];
}
-#ifdef BOOST_GRAPH_USE_NEW_CSR_INTERFACE
-namespace detail {
- template
- inline EdgeIndex get_actual_row_start
- (const BOOST_CSR_GRAPH_TYPE& /*g*/,
- EdgeIndex /*rowstart_i_minus_1*/, EdgeIndex rowstart_i)
- {
- return rowstart_i;
- }
-}
-#else
-namespace detail {
- template
- inline EdgeIndex get_actual_row_start
- (const BOOST_CSR_GRAPH_TYPE& /*g*/,
- EdgeIndex rowstart_i_minus_1, EdgeIndex rowstart_i)
- {
- // Special case to allow incremental construction
- return (std::max)(rowstart_i_minus_1, rowstart_i);
- }
-}
-#endif // BOOST_GRAPH_USE_NEW_CSR_INTERFACE
-
template
inline std::pair
@@ -1382,8 +1254,7 @@ out_edges(Vertex v, const BOOST_CSR_GRAPH_TYPE& g)
EdgeIndex v_row_start = g.m_forward.m_rowstart[v];
EdgeIndex next_row_start = g.m_forward.m_rowstart[v + 1];
return std::make_pair(it(ed(v, v_row_start)),
- it(ed(v, detail::get_actual_row_start
- (g, v_row_start, next_row_start))));
+ it(ed(v, next_row_start)));
}
template
@@ -1392,11 +1263,9 @@ out_degree(Vertex v, const BOOST_CSR_GRAPH_TYPE& g)
{
EdgeIndex v_row_start = g.m_forward.m_rowstart[v];
EdgeIndex next_row_start = g.m_forward.m_rowstart[v + 1];
- return detail::get_actual_row_start(g, v_row_start, next_row_start) - v_row_start;
+ return next_row_start - v_row_start;
}
-#ifdef BOOST_GRAPH_USE_NEW_CSR_INTERFACE
-
template
inline std::pair
@@ -1419,8 +1288,6 @@ in_degree(Vertex v, const BOOST_BIDIR_CSR_GRAPH_TYPE& g)
return next_row_start - v_row_start;
}
-#endif // BOOST_GRAPH_USE_NEW_CSR_INTERFACE
-
// From AdjacencyGraph
template
inline std::pair::vertex_descriptor i,
return i;
}
-#ifdef BOOST_GRAPH_USE_OLD_CSR_INTERFACE
-// These require that the out edges from a vertex are sorted, which is only
-// guaranteed by the old interface
-
-// Unlike for an adjacency_matrix, edge_range and edge take lg(out_degree(i))
-// time
-template
-inline std::pair
-edge_range(Vertex i, Vertex j, const BOOST_CSR_GRAPH_TYPE& g)
-{
- typedef typename std::vector::const_iterator adj_iter;
- typedef typename BOOST_CSR_GRAPH_TYPE::out_edge_iterator out_edge_iter;
- typedef typename BOOST_CSR_GRAPH_TYPE::edge_descriptor edge_desc;
- std::pair raw_adjacencies = adjacent_vertices(i, g);
- std::pair adjacencies =
- std::equal_range(raw_adjacencies.first, raw_adjacencies.second, j);
- EdgeIndex idx_begin = adjacencies.first - g.m_forward.m_column.begin();
- EdgeIndex idx_end = adjacencies.second - g.m_forward.m_column.begin();
- return std::make_pair(out_edge_iter(edge_desc(i, idx_begin)),
- out_edge_iter(edge_desc(i, idx_end)));
-}
-
-template
-inline std::pair
-edge(Vertex i, Vertex j, const BOOST_CSR_GRAPH_TYPE& g)
-{
- typedef typename BOOST_CSR_GRAPH_TYPE::out_edge_iterator out_edge_iter;
- std::pair range = edge_range(i, j, g);
- if (range.first == range.second)
- return std::make_pair(typename BOOST_CSR_GRAPH_TYPE::edge_descriptor(),
- false);
- else
- return std::make_pair(*range.first, true);
-}
-
-#else // !BOOST_GRAPH_USE_OLD_CSR_INTERFACE
// edge() can be provided in linear time for the new interface
template
@@ -1497,8 +1325,6 @@ edge(Vertex i, Vertex j, const BOOST_CSR_GRAPH_TYPE& g)
false);
}
-#endif // !BOOST_GRAPH_USE_OLD_CSR_INTERFACE
-
// Find an edge given its index in the graph
template
inline typename BOOST_CSR_GRAPH_TYPE::edge_descriptor
@@ -1508,14 +1334,7 @@ edge_from_index(EdgeIndex idx, const BOOST_CSR_GRAPH_TYPE& g)
assert (idx < num_edges(g));
row_start_iter src_plus_1 =
std::upper_bound(g.m_forward.m_rowstart.begin(),
-#ifdef BOOST_GRAPH_USE_OLD_CSR_INTERFACE
- // This handles the case where there are some vertices
- // with rowstart 0 after the last provided vertex; this
- // case does not happen with the new interface
- g.m_forward.m_rowstart.begin() + g.m_last_source + 1,
-#else // !BOOST_GRAPH_USE_OLD_CSR_INTERFACE
g.m_forward.m_rowstart.end(),
-#endif // BOOST_GRAPH_USE_OLD_CSR_INTERFACE
idx);
// Get last source whose rowstart is at most idx
// upper_bound returns this position plus 1
diff --git a/include/boost/graph/detail/compressed_sparse_row_struct.hpp b/include/boost/graph/detail/compressed_sparse_row_struct.hpp
index ba5326e3..6b4e3913 100644
--- a/include/boost/graph/detail/compressed_sparse_row_struct.hpp
+++ b/include/boost/graph/detail/compressed_sparse_row_struct.hpp
@@ -81,17 +81,9 @@ namespace detail {
std::vector m_rowstart;
std::vector m_column;
-#ifdef BOOST_GRAPH_USE_OLD_CSR_INTERFACE
- // This member is only needed to support add_edge(), which is not provided by
- // the new interface
- Vertex m_last_source; // Last source of added edge, plus one
-#endif // BOOST_GRAPH_USE_OLD_CSR_INTERFACE
compressed_sparse_row_structure(Vertex numverts = 0)
: m_rowstart(numverts + 1, EdgeIndex(0)), m_column()
-#ifdef BOOST_GRAPH_USE_OLD_CSR_INTERFACE
- , m_last_source(numverts)
-#endif
{}
// Rebuild graph from number of vertices and multi-pass unsorted list of
@@ -310,24 +302,12 @@ namespace detail {
for (Vertex i = 0; i != numverts; ++i) {
m_rowstart[i] = current_edge;
g_vertex v = ordered_verts_of_g[i];
-#ifdef BOOST_GRAPH_USE_OLD_CSR_INTERFACE
- // Out edges in a single vertex are only sorted for the old interface
- EdgeIndex num_edges_before_this_vertex = current_edge;
-#endif // BOOST_GRAPH_USE_OLD_CSR_INTERFACE
g_out_edge_iter ei, ei_end;
for (tie(ei, ei_end) = out_edges(v, g); ei != ei_end; ++ei) {
m_column[current_edge++] = get(vi, target(*ei, g));
}
-#ifdef BOOST_GRAPH_USE_OLD_CSR_INTERFACE
- // Out edges in a single vertex are only sorted for the old interface
- std::sort(m_column.begin() + num_edges_before_this_vertex,
- m_column.begin() + current_edge);
-#endif // BOOST_GRAPH_USE_OLD_CSR_INTERFACE
}
m_rowstart[numverts] = current_edge;
-#ifdef BOOST_GRAPH_USE_OLD_CSR_INTERFACE
- m_last_source = numverts;
-#endif // BOOST_GRAPH_USE_OLD_CSR_INTERFACE
}
// Add edges from a sorted (smallest sources first) range of pairs and edge
diff --git a/test/csr_graph_test.cpp b/test/csr_graph_test.cpp
index e3cc9a32..6e8f3fbf 100644
--- a/test/csr_graph_test.cpp
+++ b/test/csr_graph_test.cpp
@@ -13,9 +13,6 @@
# undef _GLIBCXX_DEBUG
#endif
-// Use new CSR interface
-#define BOOST_GRAPH_USE_NEW_CSR_INTERFACE
-
// Test for the compressed sparse row graph type
#include
#include
@@ -119,29 +116,15 @@ void assert_graphs_equal(const G1& g1, const VI1& vi1,
template
void check_consistency_one(const Structure& g) {
// Do a bunch of tests on the graph internal data
-#ifndef BOOST_GRAPH_USE_NEW_CSR_INTERFACE
- // Check that m_last_source is valid
- BOOST_CHECK(g.m_last_source <= g.m_rowstart.size() - 1);
-#endif // !BOOST_GRAPH_USE_NEW_CSR_INTERFACE
// Check that m_rowstart entries are valid, and that entries after
// m_last_source + 1 are all zero
BOOST_CHECK(g.m_rowstart[0] == 0);
for (size_t i = 0;
-#ifdef BOOST_GRAPH_USE_NEW_CSR_INTERFACE
i < g.m_rowstart.size() - 1;
-#else // !BOOST_GRAPH_USE_NEW_CSR_INTERFACE
- i < g.m_last_source;
-#endif // BOOST_GRAPH_USE_NEW_CSR_INTERFACE
++i) {
BOOST_CHECK(g.m_rowstart[i + 1] >= g.m_rowstart[i]);
BOOST_CHECK(g.m_rowstart[i + 1] <= g.m_rowstart.back());
}
-#ifndef BOOST_GRAPH_USE_NEW_CSR_INTERFACE
- for (size_t i = g.m_last_source + 1;
- i < g.m_rowstart.size(); ++i) {
- BOOST_CHECK(g.m_forward.m_rowstart[i] == 0);
- }
-#endif // !BOOST_GRAPH_USE_NEW_CSR_INTERFACE
// Check that m_column entries are within range
for (size_t i = 0; i < g.m_rowstart.back(); ++i) {
BOOST_CHECK(g.m_column[i] < g.m_rowstart.size() - 1);
@@ -217,7 +200,6 @@ void graph_test(const OrigGraph& g)
g3, boost::identity_property_map(),
boost::identity_property_map());
-#ifdef BOOST_GRAPH_USE_NEW_CSR_INTERFACE
// Check constructing a graph using in-place modification of vectors
{
std::vector sources(num_edges(g2));
@@ -287,32 +269,9 @@ void graph_test(const OrigGraph& g)
g3a, boost::identity_property_map(),
boost::identity_property_map());
}
-#endif // BOOST_GRAPH_USE_NEW_CSR_INTERFACE
CSRGraphT::edge_iterator ei, ei_end;
-#ifndef BOOST_GRAPH_USE_NEW_CSR_INTERFACE
- // Check constructing a graph using add_edge and add_vertices
- CSRGraphT g4;
- BOOST_CHECK(num_vertices(g4) == 0);
- std::size_t first_vert = add_vertices(num_vertices(g3), g4);
- BGL_FORALL_VERTICES(v, g4, CSRGraphT)
- g4[v].index = v;
-
- BOOST_CHECK(first_vert == 0);
- BOOST_CHECK(num_vertices(g4) == num_vertices(g3));
- int i;
- for (boost::tie(ei, ei_end) = edges(g3), i = 0; ei != ei_end; ++ei, ++i) {
- CSRGraphT::edge_descriptor e = add_edge(source(*ei, g3), target(*ei, g3), g4);
- BOOST_CHECK(source(e, g4) == source(*ei, g3));
- BOOST_CHECK(target(e, g4) == target(*ei, g3));
- if (i % 13 == 0) check_consistency(g4);
- }
- assert_graphs_equal(g3, boost::identity_property_map(),
- g4, boost::identity_property_map(),
- boost::identity_property_map());
-#endif // !BOOST_GRAPH_USE_NEW_CSR_INTERFACE
-
// Check edge_from_index (and implicitly the edge_index property map) for
// each edge in g2
std::size_t last_src = 0, last_tgt = 0;
@@ -456,29 +415,10 @@ int test_main(int argc, char* argv[])
// graph_test(1000, 0.1, seed);
graph_test(1000, 0.001, seed);
graph_test(1000, 0.0005, seed);
-#ifndef BOOST_GRAPH_USE_NEW_CSR_INTERFACE
- {
- std::cout << "Testing partially constructed CSR graph" << std::endl;
- CSRGraphT g;
- add_vertices(std::size_t(5), g);
- add_edge(std::size_t(1), std::size_t(2), g);
- check_consistency(g);
- add_edge(std::size_t(2), std::size_t(3), g);
- check_consistency(g);
- add_edge(std::size_t(2), std::size_t(4), g);
- check_consistency(g);
- CSRGraphT::edge_iterator ei, ei_end;
- for (boost::tie(ei, ei_end) = edges(g); ei != ei_end; ++ei) {
- BOOST_CHECK(edge_from_index(get(boost::edge_index, g, *ei), g) == *ei);
- }
- graph_test(g);
- }
-#endif // !BOOST_GRAPH_USE_NEW_CSR_INTERFACE
test_graph_properties();
test_vertex_and_edge_properties();
-#ifdef BOOST_GRAPH_USE_NEW_CSR_INTERFACE
{
std::cout << "Testing CSR graph built from unsorted edges" << std::endl;
std::pair unsorted_edges[] = {std::make_pair(5, 0), std::make_pair(3, 2), std::make_pair(4, 1), std::make_pair(4, 0), std::make_pair(0, 2), std::make_pair(5, 2)};
@@ -506,7 +446,6 @@ int test_main(int argc, char* argv[])
g3, boost::identity_property_map(),
boost::identity_property_map());
}
-#endif // BOOST_GRAPH_USE_NEW_CSR_INTERFACE
return 0;
}