|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r61001 - in branches/release: . boost boost/algorithm/string boost/archive boost/bimap boost/config boost/detail boost/filesystem boost/functional/hash boost/fusion boost/graph boost/graph/detail boost/graph/distributed boost/integer boost/interprocess boost/intrusive boost/iostreams boost/math boost/numeric/ublas boost/pending boost/program_options boost/property_map boost/property_tree boost/python boost/regex boost/serialization boost/signals boost/signals2 boost/spirit boost/spirit/home boost/spirit/home/karma boost/spirit/home/support boost/statechart boost/system boost/thread boost/tr1 boost/type_traits boost/unordered boost/utility boost/uuid boost/variant boost/wave doc libs libs/array/doc libs/array/test libs/bimap libs/config libs/filesystem libs/functional/hash libs/fusion libs/graph/doc libs/graph/example libs/graph/src libs/graph/test libs/graph_parallel libs/graph_parallel/test libs/integer libs/interprocess libs/intrusive libs/iostreams libs/math libs/math/doc/sf_and_dist libs/mpl/doc/refmanual libs/mpl/doc/src/refmanual libs/numeric/ublas libs/numeric/ublas/doc libs/program_options libs/property_map/doc libs/property_map/test libs/property_tree libs/python libs/regex libs/regex/doc libs/serialization libs/signals libs/signals2 libs/spirit libs/spirit/classic/example libs/spirit/doc libs/spirit/example libs/spirit/phoenix libs/spirit/test libs/spirit/test/qi libs/statechart libs/static_assert libs/system libs/thread libs/thread/doc libs/timer libs/tr1 libs/type_traits libs/unordered libs/utility libs/uuid libs/wave more people status tools tools/bcp tools/boostbook tools/build/v2 tools/inspect tools/quickbook tools/regression tools/release tools/wave wiki
From: jewillco_at_[hidden]
Date: 2010-04-02 11:25:20
Author: jewillco
Date: 2010-04-02 11:25:11 EDT (Fri, 02 Apr 2010)
New Revision: 61001
URL: http://svn.boost.org/trac/boost/changeset/61001
Log:
Applied changes r58876, r59133, r59134, r59628, r60078, r60079, r60126, r60127, r60196, r60197, r60198, r60365, r60366, r60384, r60385, r60472, r60485, r60610, r60611, r60651, r60769, r60770, r60899, r60900, r60916, r60919, r60920, r60958, r60998, r60999, r61000 from trunk, except for changes to <boost/detail/algorithm.hpp> which are waiting for Boost.Range algorithms to be merged; added find_if to <boost/detail/algorithm.hpp>
Added:
branches/release/boost/graph/bipartite.hpp
- copied unchanged from r60485, /trunk/boost/graph/bipartite.hpp
branches/release/boost/graph/distributed/one_bit_color_map.hpp
- copied, changed from r60079, /trunk/boost/graph/distributed/one_bit_color_map.hpp
branches/release/boost/graph/one_bit_color_map.hpp
- copied, changed from r60079, /trunk/boost/graph/one_bit_color_map.hpp
branches/release/libs/graph/doc/find_odd_cycle.html
- copied unchanged from r60485, /trunk/libs/graph/doc/find_odd_cycle.html
branches/release/libs/graph/doc/is_bipartite.html
- copied unchanged from r60485, /trunk/libs/graph/doc/is_bipartite.html
branches/release/libs/graph/doc/property_put.html
- copied unchanged from r60196, /trunk/libs/graph/doc/property_put.html
branches/release/libs/graph/example/bipartite_example.cpp
- copied unchanged from r60485, /trunk/libs/graph/example/bipartite_example.cpp
branches/release/libs/graph/test/bipartite_test.cpp
- copied unchanged from r60485, /trunk/libs/graph/test/bipartite_test.cpp
Removed:
branches/release/libs/graph/src/read_graphviz_spirit.cpp
Properties modified:
branches/release/ (props changed)
branches/release/CMakeLists.txt (props changed)
branches/release/INSTALL (props changed)
branches/release/Jamroot (props changed)
branches/release/LICENSE_1_0.txt (props changed)
branches/release/boost/ (props changed)
branches/release/boost-build.jam (props changed)
branches/release/boost.css (props changed)
branches/release/boost.png (props changed)
branches/release/boost/algorithm/string/ (props changed)
branches/release/boost/archive/ (props changed)
branches/release/boost/array.hpp (props changed)
branches/release/boost/bimap/ (props changed)
branches/release/boost/config/ (props changed)
branches/release/boost/detail/ (props changed)
branches/release/boost/filesystem/ (props changed)
branches/release/boost/functional/hash/ (props changed)
branches/release/boost/fusion/ (props changed)
branches/release/boost/graph/ (props changed)
branches/release/boost/integer/ (props changed)
branches/release/boost/interprocess/ (props changed)
branches/release/boost/intrusive/ (props changed)
branches/release/boost/iostreams/ (props changed)
branches/release/boost/math/ (props changed)
branches/release/boost/numeric/ublas/ (props changed)
branches/release/boost/program_options/ (props changed)
branches/release/boost/property_tree/ (props changed)
branches/release/boost/python/ (props changed)
branches/release/boost/regex/ (props changed)
branches/release/boost/serialization/ (props changed)
branches/release/boost/signals/ (props changed)
branches/release/boost/signals2/ (props changed)
branches/release/boost/spirit/ (props changed)
branches/release/boost/spirit/home/ (props changed)
branches/release/boost/spirit/home/karma/ (props changed)
branches/release/boost/spirit/home/support/attributes.hpp (props changed)
branches/release/boost/statechart/ (props changed)
branches/release/boost/system/ (props changed)
branches/release/boost/thread/ (props changed)
branches/release/boost/thread.hpp (props changed)
branches/release/boost/tr1/ (props changed)
branches/release/boost/type_traits/ (props changed)
branches/release/boost/unordered/ (props changed)
branches/release/boost/utility/ (props changed)
branches/release/boost/utility/value_init.hpp (props changed)
branches/release/boost/uuid/ (props changed)
branches/release/boost/variant/ (props changed)
branches/release/boost/version.hpp (props changed)
branches/release/boost/wave/ (props changed)
branches/release/bootstrap.bat (props changed)
branches/release/bootstrap.sh (props changed)
branches/release/doc/ (props changed)
branches/release/index.htm (props changed)
branches/release/index.html (props changed)
branches/release/libs/ (props changed)
branches/release/libs/array/doc/array.xml (props changed)
branches/release/libs/array/test/array0.cpp (props changed)
branches/release/libs/bimap/ (props changed)
branches/release/libs/config/ (props changed)
branches/release/libs/filesystem/ (props changed)
branches/release/libs/functional/hash/ (props changed)
branches/release/libs/fusion/ (props changed)
branches/release/libs/graph/test/ (props changed)
branches/release/libs/graph_parallel/ (props changed)
branches/release/libs/integer/ (props changed)
branches/release/libs/interprocess/ (props changed)
branches/release/libs/intrusive/ (props changed)
branches/release/libs/iostreams/ (props changed)
branches/release/libs/libraries.htm (props changed)
branches/release/libs/maintainers.txt (props changed)
branches/release/libs/math/ (props changed)
branches/release/libs/math/doc/sf_and_dist/ (props changed)
branches/release/libs/mpl/doc/refmanual/broken-compiler-workarounds.html (props changed)
branches/release/libs/mpl/doc/refmanual/categorized-index-concepts.html (props changed)
branches/release/libs/mpl/doc/refmanual/cfg-no-preprocessed-headers.html (props changed)
branches/release/libs/mpl/doc/refmanual/composition-and-argument-binding.html (props changed)
branches/release/libs/mpl/doc/refmanual/data-types-concepts.html (props changed)
branches/release/libs/mpl/doc/refmanual/data-types-miscellaneous.html (props changed)
branches/release/libs/mpl/doc/refmanual/extensible-associative-sequence.html (props changed)
branches/release/libs/mpl/doc/refmanual/inserter-class.html (props changed)
branches/release/libs/mpl/doc/refmanual/tag-dispatched-metafunction.html (props changed)
branches/release/libs/mpl/doc/refmanual/trivial-metafunctions-summary.html (props changed)
branches/release/libs/mpl/doc/src/refmanual/Iterators-Iterator.rst (props changed)
branches/release/libs/numeric/ublas/ (props changed)
branches/release/libs/numeric/ublas/doc/ (props changed)
branches/release/libs/program_options/ (props changed)
branches/release/libs/property_tree/ (props changed)
branches/release/libs/python/ (props changed)
branches/release/libs/regex/ (props changed)
branches/release/libs/regex/doc/ (props changed)
branches/release/libs/serialization/ (props changed)
branches/release/libs/signals/ (props changed)
branches/release/libs/signals2/ (props changed)
branches/release/libs/spirit/ (props changed)
branches/release/libs/spirit/classic/example/ (props changed)
branches/release/libs/spirit/doc/ (props changed)
branches/release/libs/spirit/example/ (props changed)
branches/release/libs/spirit/phoenix/ (props changed)
branches/release/libs/spirit/test/ (props changed)
branches/release/libs/spirit/test/qi/optional.cpp (props changed)
branches/release/libs/statechart/ (props changed)
branches/release/libs/static_assert/ (props changed)
branches/release/libs/system/ (props changed)
branches/release/libs/thread/ (props changed)
branches/release/libs/thread/doc/ (props changed)
branches/release/libs/timer/ (props changed)
branches/release/libs/tr1/ (props changed)
branches/release/libs/type_traits/ (props changed)
branches/release/libs/unordered/ (props changed)
branches/release/libs/utility/ (props changed)
branches/release/libs/utility/swap.html (props changed)
branches/release/libs/utility/value_init.htm (props changed)
branches/release/libs/utility/value_init_test.cpp (props changed)
branches/release/libs/uuid/ (props changed)
branches/release/libs/wave/ (props changed)
branches/release/more/ (props changed)
branches/release/people/ (props changed)
branches/release/rst.css (props changed)
branches/release/status/ (props changed)
branches/release/status/Jamfile.v2 (props changed)
branches/release/tools/ (props changed)
branches/release/tools/bcp/ (props changed)
branches/release/tools/boostbook/ (props changed)
branches/release/tools/build/v2/ (props changed)
branches/release/tools/inspect/ (props changed)
branches/release/tools/quickbook/ (props changed)
branches/release/tools/regression/ (props changed)
branches/release/tools/release/ (props changed)
branches/release/tools/wave/ (props changed)
branches/release/wiki/ (props changed)
Text files modified:
branches/release/boost/detail/algorithm.hpp | 6 +
branches/release/boost/graph/adjacency_list.hpp | 13 +++
branches/release/boost/graph/astar_search.hpp | 9 +-
branches/release/boost/graph/compressed_sparse_row_graph.hpp | 130 +++++++++++++++++++++++++++++++--------
branches/release/boost/graph/detail/adjacency_list.hpp | 11 +-
branches/release/boost/graph/detail/array_binary_tree.hpp | 61 +++++++++---------
branches/release/boost/graph/detail/compressed_sparse_row_struct.hpp | 27 +++++++
branches/release/boost/graph/detail/indexed_properties.hpp | 53 ++++++++++++++-
branches/release/boost/graph/detail/read_graphviz_new.hpp | 18 +----
branches/release/boost/graph/detail/read_graphviz_spirit.hpp | 6
branches/release/boost/graph/distributed/one_bit_color_map.hpp | 8 +-
branches/release/boost/graph/distributed/two_bit_color_map.hpp | 8 +-
branches/release/boost/graph/filtered_graph.hpp | 1
branches/release/boost/graph/graph_test.hpp | 8 +
branches/release/boost/graph/graphml.hpp | 37 +++++++---
branches/release/boost/graph/graphviz.hpp | 64 ++++++++++++++-----
branches/release/boost/graph/gursoy_atun_layout.hpp | 3
branches/release/boost/graph/metric_tsp_approx.hpp | 4
branches/release/boost/graph/one_bit_color_map.hpp | 6 -
branches/release/boost/graph/topological_sort.hpp | 3
branches/release/boost/graph/two_bit_color_map.hpp | 22 ++++--
branches/release/boost/graph/visitors.hpp | 46 ++++++++++++++
branches/release/boost/pending/container_traits.hpp | 129 +++++++++++++++++++++++++++++++--------
branches/release/boost/pending/indirect_cmp.hpp | 2
branches/release/boost/pending/mutable_queue.hpp | 28 ++++----
branches/release/boost/property_map/dynamic_property_map.hpp | 42 +++++-------
branches/release/boost/property_map/property_map.hpp | 36 +++++++++++
branches/release/libs/graph/doc/AStarVisitor.html | 10 +-
branches/release/libs/graph/doc/BFSVisitor.html | 4
branches/release/libs/graph/doc/BellmanFordVisitor.html | 4
branches/release/libs/graph/doc/DFSVisitor.html | 2
branches/release/libs/graph/doc/EventVisitorList.html | 4
branches/release/libs/graph/doc/adjacency_list.html | 4
branches/release/libs/graph/doc/adjacency_matrix.html | 4
branches/release/libs/graph/doc/bc_clustering.html | 2
branches/release/libs/graph/doc/bellman_visitor.html | 4
branches/release/libs/graph/doc/bfs_visitor.html | 4
branches/release/libs/graph/doc/biconnected_components.html | 9 ++
branches/release/libs/graph/doc/compressed_sparse_row.html | 18 +++--
branches/release/libs/graph/doc/dfs_visitor.html | 4
branches/release/libs/graph/doc/dijkstra_visitor.html | 4
branches/release/libs/graph/doc/distance_recorder.html | 4
branches/release/libs/graph/doc/graph_theory_review.html | 4
branches/release/libs/graph/doc/history.html | 2
branches/release/libs/graph/doc/maximum_matching.html | 6
branches/release/libs/graph/doc/planar_canonical_ordering.html | 10 +++
branches/release/libs/graph/doc/planar_graphs.html | 2
branches/release/libs/graph/doc/predecessor_recorder.html | 12 +-
branches/release/libs/graph/doc/property_writer.html | 8 +-
branches/release/libs/graph/doc/random_layout.html | 2
branches/release/libs/graph/doc/table_of_contents.html | 3
branches/release/libs/graph/doc/time_stamper.html | 6
branches/release/libs/graph/doc/tsp_tour_len_visitor.html | 2
branches/release/libs/graph/doc/visitor_concepts.html | 2
branches/release/libs/graph/example/Jamfile.v2 | 1
branches/release/libs/graph/src/graphml.cpp | 14 +++-
branches/release/libs/graph/src/read_graphviz_new.cpp | 2
branches/release/libs/graph/test/Jamfile.v2 | 3
branches/release/libs/graph/test/csr_graph_test.cpp | 33 +++++++++
branches/release/libs/graph/test/graphviz_test.cpp | 2
branches/release/libs/graph/test/metric_tsp_approx.cpp | 4
branches/release/libs/graph_parallel/test/distributed_connected_components_test.cpp | 2
branches/release/libs/graph_parallel/test/distributed_csr_algorithm_test.cpp | 2
branches/release/libs/property_map/doc/dynamic_property_map.html | 95 ++++++++++++++--------------
branches/release/libs/property_map/doc/dynamic_property_map.rst | 12 +-
branches/release/libs/property_map/test/dynamic_properties_test.cpp | 6 +
66 files changed, 757 insertions(+), 340 deletions(-)
Modified: branches/release/boost/detail/algorithm.hpp
==============================================================================
--- branches/release/boost/detail/algorithm.hpp (original)
+++ branches/release/boost/detail/algorithm.hpp 2010-04-02 11:25:11 EDT (Fri, 02 Apr 2010)
@@ -140,6 +140,12 @@
std::stable_sort(begin(c), end(c), p);
}
+ template <typename Container, typename Predicate>
+ typename Container::const_iterator find_if(const Container& c, Predicate p)
+ {
+ return find_if(begin(c), end(c), p);
+ }
+
template <typename InputIterator, typename Predicate>
bool any_if(InputIterator first, InputIterator last, Predicate p)
{
Modified: branches/release/boost/graph/adjacency_list.hpp
==============================================================================
--- branches/release/boost/graph/adjacency_list.hpp (original)
+++ branches/release/boost/graph/adjacency_list.hpp 2010-04-02 11:25:11 EDT (Fri, 02 Apr 2010)
@@ -1,6 +1,7 @@
//=======================================================================
// Copyright 1997, 1998, 1999, 2000 University of Notre Dame.
-// Authors: Andrew Lumsdaine, Lie-Quan Lee, Jeremy G. Siek
+// Copyright 2010 Thomas Claveirole
+// Authors: Andrew Lumsdaine, Lie-Quan Lee, Jeremy G. Siek, Thomas Claveirole
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
@@ -254,6 +255,16 @@
typedef disallow_parallel_edge_tag type;
};
+ template <>
+ struct parallel_edge_traits<hash_multisetS> {
+ typedef allow_parallel_edge_tag type;
+ };
+
+ template <>
+ struct parallel_edge_traits<hash_multimapS> {
+ typedef allow_parallel_edge_tag type;
+ };
+
namespace detail {
template <class Directed> struct is_random_access {
enum { value = false};
Modified: branches/release/boost/graph/astar_search.hpp
==============================================================================
--- branches/release/boost/graph/astar_search.hpp (original)
+++ branches/release/boost/graph/astar_search.hpp 2010-04-02 11:25:11 EDT (Fri, 02 Apr 2010)
@@ -17,6 +17,7 @@
#include <functional>
#include <vector>
#include <boost/limits.hpp>
+#include <boost/throw_exception.hpp>
#include <boost/graph/named_function_params.hpp>
#include <boost/graph/relax.hpp>
#include <boost/graph/exception.hpp>
@@ -147,7 +148,7 @@
template <class Edge, class Graph>
void examine_edge(Edge e, Graph& g) {
if (m_compare(get(m_weight, e), m_zero))
- throw negative_edge();
+ BOOST_THROW_EXCEPTION(negative_edge());
m_vis.examine_edge(e, g);
}
template <class Edge, class Graph>
@@ -238,14 +239,14 @@
AStarHeuristic h, AStarVisitor vis,
PredecessorMap predecessor, CostMap cost,
DistanceMap distance, WeightMap weight,
- ColorMap color, VertexIndexMap /*index_map*/,
+ ColorMap color, VertexIndexMap index_map,
CompareFunction compare, CombineFunction combine,
CostInf /*inf*/, CostZero zero)
{
typedef typename graph_traits<VertexListGraph>::vertex_descriptor
Vertex;
- typedef boost::vector_property_map<std::size_t> IndexInHeapMap;
- IndexInHeapMap index_in_heap;
+ typedef boost::vector_property_map<std::size_t, VertexIndexMap> IndexInHeapMap;
+ IndexInHeapMap index_in_heap(index_map);
typedef d_ary_heap_indirect<Vertex, 4, IndexInHeapMap, CostMap, CompareFunction>
MutableQueue;
MutableQueue Q(cost, index_in_heap, compare);
Modified: branches/release/boost/graph/compressed_sparse_row_graph.hpp
==============================================================================
--- branches/release/boost/graph/compressed_sparse_row_graph.hpp (original)
+++ branches/release/boost/graph/compressed_sparse_row_graph.hpp 2010-04-02 11:25:11 EDT (Fri, 02 Apr 2010)
@@ -185,11 +185,11 @@
typename EdgeIndex>
class compressed_sparse_row_graph<directedS, VertexProperty, EdgeProperty, GraphProperty, Vertex, EdgeIndex>
: public detail::indexed_vertex_properties<BOOST_DIR_CSR_GRAPH_TYPE,
- VertexProperty, Vertex>
+ VertexProperty, Vertex, identity_property_map>
{
public:
typedef detail::indexed_vertex_properties<compressed_sparse_row_graph,
- VertexProperty, Vertex>
+ VertexProperty, Vertex, identity_property_map>
inherited_vertex_properties;
public:
@@ -728,11 +728,11 @@
typename EdgeIndex>
class compressed_sparse_row_graph<bidirectionalS, VertexProperty, EdgeProperty, GraphProperty, Vertex, EdgeIndex>
: public detail::indexed_vertex_properties<BOOST_BIDIR_CSR_GRAPH_TYPE,
- VertexProperty, Vertex>
+ VertexProperty, Vertex, identity_property_map>
{
public:
typedef detail::indexed_vertex_properties<compressed_sparse_row_graph,
- VertexProperty, Vertex>
+ VertexProperty, Vertex, identity_property_map>
inherited_vertex_properties;
public:
@@ -1394,24 +1394,6 @@
return get_property_value(g.m_property, Tag());
}
-// Add edge_index property map
-template<typename Index, typename Descriptor>
-struct csr_edge_index_map
-{
- typedef Index value_type;
- typedef Index reference;
- typedef Descriptor key_type;
- typedef readable_property_map_tag category;
-};
-
-template<typename Index, typename Descriptor>
-inline Index
-get(const csr_edge_index_map<Index, Descriptor>&,
- const typename csr_edge_index_map<Index, Descriptor>::key_type& key)
-{
- return key.idx;
-}
-
template<BOOST_CSR_GRAPH_TEMPLATE_PARMS>
struct property_map<BOOST_CSR_GRAPH_TYPE, vertex_index_t>
{
@@ -1422,17 +1404,25 @@
template<BOOST_CSR_GRAPH_TEMPLATE_PARMS>
struct property_map<BOOST_CSR_GRAPH_TYPE, edge_index_t>
{
-private:
- typedef typename graph_traits<BOOST_CSR_GRAPH_TYPE>::edge_descriptor
- edge_descriptor;
- typedef csr_edge_index_map<EdgeIndex, edge_descriptor> edge_index_type;
-
-public:
- typedef edge_index_type type;
+ typedef detail::csr_edge_index_map<Vertex, EdgeIndex> type;
typedef type const_type;
};
template<BOOST_CSR_GRAPH_TEMPLATE_PARMS>
+struct property_map<BOOST_CSR_GRAPH_TYPE, vertex_bundle_t>
+{
+ typedef typename BOOST_CSR_GRAPH_TYPE::inherited_vertex_properties::vertex_map_type type;
+ typedef typename BOOST_CSR_GRAPH_TYPE::inherited_vertex_properties::const_vertex_map_type const_type;
+};
+
+template<BOOST_CSR_GRAPH_TEMPLATE_PARMS>
+struct property_map<BOOST_CSR_GRAPH_TYPE, edge_bundle_t>
+{
+ typedef typename BOOST_CSR_GRAPH_TYPE::forward_type::inherited_edge_properties::edge_map_type type;
+ typedef typename BOOST_CSR_GRAPH_TYPE::forward_type::inherited_edge_properties::const_edge_map_type const_type;
+};
+
+template<BOOST_CSR_GRAPH_TEMPLATE_PARMS>
inline identity_property_map
get(vertex_index_t, const BOOST_CSR_GRAPH_TYPE&)
{
@@ -1464,6 +1454,88 @@
return e.idx;
}
+template<BOOST_CSR_GRAPH_TEMPLATE_PARMS>
+inline typename property_map<BOOST_CSR_GRAPH_TYPE, vertex_bundle_t>::type
+get(vertex_bundle_t, BOOST_CSR_GRAPH_TYPE& g)
+{
+ return g.get_vertex_bundle(get(vertex_index, g));
+}
+
+template<BOOST_CSR_GRAPH_TEMPLATE_PARMS>
+inline typename property_map<BOOST_CSR_GRAPH_TYPE, vertex_bundle_t>::const_type
+get(vertex_bundle_t, const BOOST_CSR_GRAPH_TYPE& g)
+{
+ return g.get_vertex_bundle(get(vertex_index, g));
+}
+
+template<BOOST_CSR_GRAPH_TEMPLATE_PARMS>
+inline VertexProperty&
+get(vertex_bundle_t,
+ BOOST_CSR_GRAPH_TYPE& g, Vertex v)
+{
+ return get(vertex_bundle, g)[v];
+}
+
+template<BOOST_CSR_GRAPH_TEMPLATE_PARMS>
+inline const VertexProperty&
+get(vertex_bundle_t,
+ const BOOST_CSR_GRAPH_TYPE& g, Vertex v)
+{
+ return get(vertex_bundle, g)[v];
+}
+
+template<BOOST_CSR_GRAPH_TEMPLATE_PARMS>
+inline void
+put(vertex_bundle_t,
+ BOOST_CSR_GRAPH_TYPE& g,
+ Vertex v,
+ const VertexProperty& val)
+{
+ put(get(vertex_bundle, g), v, val);
+}
+
+template<BOOST_CSR_GRAPH_TEMPLATE_PARMS>
+inline typename property_map<BOOST_CSR_GRAPH_TYPE, edge_bundle_t>::type
+get(edge_bundle_t, BOOST_CSR_GRAPH_TYPE& g)
+{
+ return g.m_forward.get_edge_bundle(get(edge_index, g));
+}
+
+template<BOOST_CSR_GRAPH_TEMPLATE_PARMS>
+inline typename property_map<BOOST_CSR_GRAPH_TYPE, edge_bundle_t>::const_type
+get(edge_bundle_t, const BOOST_CSR_GRAPH_TYPE& g)
+{
+ return g.m_forward.get_edge_bundle(get(edge_index, g));
+}
+
+template<BOOST_CSR_GRAPH_TEMPLATE_PARMS>
+inline EdgeProperty&
+get(edge_bundle_t,
+ BOOST_CSR_GRAPH_TYPE& g,
+ const typename BOOST_CSR_GRAPH_TYPE::edge_descriptor& e)
+{
+ return get(edge_bundle, g)[e];
+}
+
+template<BOOST_CSR_GRAPH_TEMPLATE_PARMS>
+inline const EdgeProperty&
+get(edge_bundle_t,
+ const BOOST_CSR_GRAPH_TYPE& g,
+ const typename BOOST_CSR_GRAPH_TYPE::edge_descriptor& e)
+{
+ return get(edge_bundle, g)[e];
+}
+
+template<BOOST_CSR_GRAPH_TEMPLATE_PARMS>
+inline void
+put(edge_bundle_t,
+ BOOST_CSR_GRAPH_TYPE& g,
+ const typename BOOST_CSR_GRAPH_TYPE::edge_descriptor& e,
+ const EdgeProperty& val)
+{
+ put(get(edge_bundle, g), e, val);
+}
+
template<BOOST_CSR_GRAPH_TEMPLATE_PARMS, typename T, typename Bundle>
inline
typename property_map<BOOST_CSR_GRAPH_TYPE, T Bundle::*>::type
Modified: branches/release/boost/graph/detail/adjacency_list.hpp
==============================================================================
--- branches/release/boost/graph/detail/adjacency_list.hpp (original)
+++ branches/release/boost/graph/detail/adjacency_list.hpp 2010-04-02 11:25:11 EDT (Fri, 02 Apr 2010)
@@ -1,7 +1,8 @@
// -*- c++ -*-
//=======================================================================
// Copyright 1997, 1998, 1999, 2000 University of Notre Dame.
-// Authors: Andrew Lumsdaine, Lie-Quan Lee, Jeremy G. Siek
+// Copyright 2010 Thomas Claveirole
+// Authors: Andrew Lumsdaine, Lie-Quan Lee, Jeremy G. Siek, Thomas Claveirole
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
@@ -1633,6 +1634,7 @@
const Graph& g = static_cast<const Graph&>(g_);
return g_.edge_dispatch(g, u, v, Cat());
}
+
template <class Config, class Base>
inline std::pair<typename Config::out_edge_iterator,
typename Config::out_edge_iterator>
@@ -1648,10 +1650,9 @@
typename Config::OutEdgeList& el = g.out_edge_list(u);
typename Config::OutEdgeList::iterator first, last;
typename Config::EdgeContainer fake_edge_container;
- tie(first, last) =
- std::equal_range(el.begin(), el.end(),
- StoredEdge(v, fake_edge_container.end(),
- &fake_edge_container));
+ tie(first, last) = graph_detail::
+ equal_range(el, StoredEdge(v, fake_edge_container.end(),
+ &fake_edge_container));
return std::make_pair(out_edge_iterator(first, u),
out_edge_iterator(last, u));
}
Modified: branches/release/boost/graph/detail/array_binary_tree.hpp
==============================================================================
--- branches/release/boost/graph/detail/array_binary_tree.hpp (original)
+++ branches/release/boost/graph/detail/array_binary_tree.hpp 2010-04-02 11:25:11 EDT (Fri, 02 Apr 2010)
@@ -8,18 +8,18 @@
// http://www.boost.org/LICENSE_1_0.txt)
//=======================================================================
//
-#ifndef ADSTL_ARRAY_BINARY_TREE_HPP
-#define ADSTL_ARRAY_BINARY_TREE_HPP
+#ifndef BOOST_ARRAY_BINARY_TREE_HPP
+#define BOOST_ARRAY_BINARY_TREE_HPP
#include <iterator>
#include <functional>
#include <boost/config.hpp>
-namespace adstl {
- /*
- Note: array_binary_tree is a completey balanced binary tree
- */
+namespace boost {
+/*
+ * Note: array_binary_tree is a completey balanced binary tree.
+ */
#if !defined BOOST_NO_STD_ITERATOR_TRAITS
template <class RandomAccessIterator, class ID>
#else
@@ -45,18 +45,18 @@
: boost::iterator<std::bidirectional_iterator_tag, ArrayBinaryTreeNode,
difference_type, array_binary_tree_node*, ArrayBinaryTreeNode&>
{ // replace with iterator_adaptor implementation -JGS
-
+
inline iterator() : i(0), n(0) { }
inline iterator(const iterator& x) : r(x.r), i(x.i), n(x.n), id(x.id) { }
inline iterator& operator=(const iterator& x) {
- r = x.r; i = x.i; n = x.n;
+ r = x.r; i = x.i; n = x.n;
/*egcs generate a warning*/
- id = x.id;
+ id = x.id;
return *this;
}
- inline iterator(rep_iterator rr,
- size_type ii,
- size_type nn,
+ inline iterator(rep_iterator rr,
+ size_type ii,
+ size_type nn,
const ID& _id) : r(rr), i(ii), n(nn), id(_id) { }
inline array_binary_tree_node operator*() {
return ArrayBinaryTreeNode(r, i, n, id); }
@@ -64,7 +64,7 @@
inline iterator operator++(int)
{ iterator t = *this; ++(*this); return t; }
inline bool operator==(const iterator& x) const { return i == x.i; }
- inline bool operator!=(const iterator& x) const
+ inline bool operator!=(const iterator& x) const
{ return !(*this == x); }
rep_iterator r;
size_type i;
@@ -75,13 +75,13 @@
inline children_type(const children_type& x)
: r(x.r), i(x.i), n(x.n), id(x.id) { }
inline children_type& operator=(const children_type& x) {
- r = x.r; i = x.i; n = x.n;
+ r = x.r; i = x.i; n = x.n;
/*egcs generate a warning*/
- id = x.id;
+ id = x.id;
return *this;
}
inline children_type(rep_iterator rr,
- size_type ii,
+ size_type ii,
size_type nn,
const ID& _id) : r(rr), i(ii), n(nn), id(_id) { }
inline iterator begin() { return iterator(r, 2 * i + 1, n, id); }
@@ -100,23 +100,23 @@
ID id;
};
inline array_binary_tree_node() : i(0), n(0) { }
- inline array_binary_tree_node(const array_binary_tree_node& x)
+ inline array_binary_tree_node(const array_binary_tree_node& x)
: r(x.r), i(x.i), n(x.n), id(x.id) { }
inline ArrayBinaryTreeNode& operator=(const ArrayBinaryTreeNode& x) {
r = x.r;
- i = x.i;
- n = x.n;
+ i = x.i;
+ n = x.n;
/*egcs generate a warning*/
- id = x.id;
+ id = x.id;
return *this;
}
- inline array_binary_tree_node(rep_iterator start,
- rep_iterator end,
+ inline array_binary_tree_node(rep_iterator start,
+ rep_iterator end,
rep_iterator pos, const ID& _id)
: r(start), i(pos - start), n(end - start), id(_id) { }
- inline array_binary_tree_node(rep_iterator rr,
- size_type ii,
- size_type nn, const ID& _id)
+ inline array_binary_tree_node(rep_iterator rr,
+ size_type ii,
+ size_type nn, const ID& _id)
: r(rr), i(ii), n(nn), id(_id) { }
inline value_type& value() { return *(r + i); }
inline const value_type& value() const { return *(r + i); }
@@ -147,8 +147,8 @@
value() = tmp;
i = x.i;
}
- inline const children_type children() const {
- return children_type(r, i, n);
+ inline const children_type children() const {
+ return children_type(r, i, n);
}
inline size_type index() const { return i; }
rep_iterator r;
@@ -157,7 +157,7 @@
ID id;
};
-template <class RandomAccessContainer,
+template <class RandomAccessContainer,
class Compare = std::less<typename RandomAccessContainer::value_type> >
struct compare_array_node {
typedef typename RandomAccessContainer::value_type value_type;
@@ -176,7 +176,6 @@
Compare comp;
};
+} // namespace boost
-} /* namespace adstl */
-
-#endif /* ADSTL_ARRAY_BINARY_TREE_H */
+#endif /* BOOST_ARRAY_BINARY_TREE_HPP */
Modified: branches/release/boost/graph/detail/compressed_sparse_row_struct.hpp
==============================================================================
--- branches/release/boost/graph/detail/compressed_sparse_row_struct.hpp (original)
+++ branches/release/boost/graph/detail/compressed_sparse_row_struct.hpp 2010-04-02 11:25:11 EDT (Fri, 02 Apr 2010)
@@ -54,6 +54,24 @@
template<typename Vertex, typename EdgeIndex>
class csr_edge_descriptor;
+ // Add edge_index property map
+ template<typename Vertex, typename EdgeIndex>
+ struct csr_edge_index_map
+ {
+ typedef EdgeIndex value_type;
+ typedef EdgeIndex reference;
+ typedef csr_edge_descriptor<Vertex, EdgeIndex> key_type;
+ typedef readable_property_map_tag category;
+ };
+
+ template<typename Vertex, typename EdgeIndex>
+ inline EdgeIndex
+ get(const csr_edge_index_map<Vertex, EdgeIndex>&,
+ const csr_edge_descriptor<Vertex, EdgeIndex>& key)
+ {
+ return key.idx;
+ }
+
/** Compressed sparse row graph internal structure.
*
* Vertex and EdgeIndex should be unsigned integral types and should
@@ -65,12 +83,14 @@
public detail::indexed_edge_properties<
compressed_sparse_row_structure<EdgeProperty, Vertex, EdgeIndex>,
EdgeProperty,
- csr_edge_descriptor<Vertex, EdgeIndex> > {
+ csr_edge_descriptor<Vertex, EdgeIndex>,
+ csr_edge_index_map<Vertex, EdgeIndex> > {
public:
typedef detail::indexed_edge_properties<
compressed_sparse_row_structure<EdgeProperty, Vertex, EdgeIndex>,
EdgeProperty,
- csr_edge_descriptor<Vertex, EdgeIndex> >
+ csr_edge_descriptor<Vertex, EdgeIndex>,
+ csr_edge_index_map<Vertex, EdgeIndex> >
inherited_edge_properties;
typedef Vertex vertices_size_type;
@@ -110,6 +130,7 @@
source_pred, boost::make_property_map_function(global_to_local));
m_column.resize(m_rowstart.back());
+ inherited_edge_properties::resize(m_rowstart.back());
boost::graph::detail::histogram_sort
(sources_begin, sources_end, m_rowstart.begin(), numlocalverts,
@@ -248,6 +269,7 @@
// Now targets is the correct vector (properly sorted by source) for
// m_column
m_column.swap(targets);
+ inherited_edge_properties::resize(m_rowstart.back());
}
// Replace graph with sources and targets and edge properties given, sorting
@@ -289,6 +311,7 @@
{
m_rowstart.resize(numverts + 1);
m_column.resize(numedges);
+ inherited_edge_properties::resize(numedges);
EdgeIndex current_edge = 0;
typedef typename boost::graph_traits<Graph>::vertex_descriptor g_vertex;
typedef typename boost::graph_traits<Graph>::edge_descriptor g_edge;
Modified: branches/release/boost/graph/detail/indexed_properties.hpp
==============================================================================
--- branches/release/boost/graph/detail/indexed_properties.hpp (original)
+++ branches/release/boost/graph/detail/indexed_properties.hpp 2010-04-02 11:25:11 EDT (Fri, 02 Apr 2010)
@@ -23,17 +23,24 @@
#include <boost/iterator/counting_iterator.hpp>
#include <boost/integer.hpp>
#include <boost/iterator/iterator_facade.hpp>
+#include <boost/property_map/property_map.hpp>
#include <boost/mpl/if.hpp>
namespace boost {
namespace detail {
-template<typename Derived, typename Property, typename Descriptor>
+template<typename Derived, typename Property, typename Descriptor, typename IndexMap>
class indexed_vertex_properties
{
public:
typedef no_property vertex_property_type;
typedef Property vertex_bundled;
+ typedef iterator_property_map<
+ typename std::vector<Property>::iterator,
+ IndexMap> vertex_map_type;
+ typedef iterator_property_map<
+ typename std::vector<Property>::const_iterator,
+ IndexMap> const_vertex_map_type;
// Directly access a vertex or edge bundle
Property& operator[](Descriptor v)
@@ -42,6 +49,14 @@
const Property& operator[](Descriptor v) const
{ return m_vertex_properties[get(vertex_index, derived(), v)]; }
+ vertex_map_type get_vertex_bundle(const IndexMap& index_map = IndexMap()) {
+ return vertex_map_type(m_vertex_properties.begin(), index_map);
+ }
+
+ const_vertex_map_type get_vertex_bundle(const IndexMap& index_map = IndexMap()) const {
+ return const_vertex_map_type(m_vertex_properties.begin(), index_map);
+ }
+
protected:
// Default-construct with no property values
indexed_vertex_properties() {}
@@ -90,17 +105,23 @@
std::vector<Property> m_vertex_properties;
};
-template<typename Derived, typename Descriptor>
-class indexed_vertex_properties<Derived, void, Descriptor>
+template<typename Derived, typename Descriptor, typename IndexMap>
+class indexed_vertex_properties<Derived, void, Descriptor, IndexMap>
{
struct secret {};
public:
typedef no_property vertex_property_type;
typedef void vertex_bundled;
+ typedef secret vertex_map_type;
+ typedef secret const_vertex_map_type;
secret operator[](secret) { return secret(); }
+ vertex_map_type get_vertex_bundle() const {
+ return vertex_map_type();
+ }
+
protected:
// All operations do nothing.
indexed_vertex_properties() { }
@@ -112,13 +133,19 @@
void reserve(std::size_t) { }
};
-template<typename Derived, typename Property, typename Descriptor>
+template<typename Derived, typename Property, typename Descriptor, typename IndexMap>
class indexed_edge_properties
{
public:
typedef no_property edge_property_type;
typedef Property edge_bundled;
typedef Property edge_push_back_type;
+ typedef iterator_property_map<
+ typename std::vector<Property>::iterator,
+ IndexMap> edge_map_type;
+ typedef iterator_property_map<
+ typename std::vector<Property>::const_iterator,
+ IndexMap> const_edge_map_type;
// Directly access a edge or edge bundle
Property& operator[](Descriptor v)
@@ -127,6 +154,14 @@
const Property& operator[](Descriptor v) const
{ return m_edge_properties[get(edge_index, derived(), v)]; }
+ edge_map_type get_edge_bundle(const IndexMap& index_map = IndexMap()) {
+ return edge_map_type(m_edge_properties.begin(), index_map);
+ }
+
+ const_edge_map_type get_edge_bundle(const IndexMap& index_map = IndexMap()) const {
+ return const_edge_map_type(m_edge_properties.begin(), index_map);
+ }
+
protected:
// Default-construct with no property values
indexed_edge_properties() {}
@@ -205,8 +240,8 @@
std::ptrdiff_t distance_to(const dummy_no_property_iterator) const {return 0;}
};
-template<typename Derived, typename Descriptor>
-class indexed_edge_properties<Derived, void, Descriptor>
+template<typename Derived, typename Descriptor, typename IndexMap>
+class indexed_edge_properties<Derived, void, Descriptor, IndexMap>
{
struct secret {};
@@ -214,10 +249,16 @@
typedef no_property edge_property_type;
typedef void edge_bundled;
typedef void* edge_push_back_type;
+ typedef secret edge_map_type;
+ typedef secret const_edge_map_type;
secret operator[](secret) { return secret(); }
void write_by_index(std::size_t idx, const no_property& prop) {}
+ edge_map_type get_edge_bundle(const IndexMap& = IndexMap()) const {
+ return edge_map_type();
+ }
+
protected:
// All operations do nothing.
indexed_edge_properties() { }
Modified: branches/release/boost/graph/detail/read_graphviz_new.hpp
==============================================================================
--- branches/release/boost/graph/detail/read_graphviz_new.hpp (original)
+++ branches/release/boost/graph/detail/read_graphviz_new.hpp 2010-04-02 11:25:11 EDT (Fri, 02 Apr 2010)
@@ -89,26 +89,18 @@
} // namespace read_graphviz_detail
-// This is also in boost/graph/graphviz.hpp
namespace detail {
namespace graph {
- BOOST_GRAPH_DECL bool read_graphviz(const std::string& str, boost::detail::graph::mutate_graph* mg);
+ BOOST_GRAPH_DECL bool read_graphviz_new(const std::string& str, boost::detail::graph::mutate_graph* mg);
} // end namespace graph
} // end namespace detail
template <typename MutableGraph>
-bool read_graphviz(const std::string& str,
- MutableGraph& graph, boost::dynamic_properties& dp,
- std::string const& node_id = "node_id") {
+bool read_graphviz_new(const std::string& str,
+ MutableGraph& graph, boost::dynamic_properties& dp,
+ std::string const& node_id = "node_id") {
boost::detail::graph::mutate_graph_impl<MutableGraph> mg(graph, dp, node_id);
- return detail::graph::read_graphviz(str, &mg);
-}
-
-template <typename InputIter, typename MutableGraph>
-bool read_graphviz(InputIter begin, InputIter end,
- MutableGraph& graph, boost::dynamic_properties& dp,
- std::string const& node_id = "node_id") {
- return read_graphviz(std::string(begin, end), graph, dp, node_id);
+ return detail::graph::read_graphviz_new(str, &mg);
}
} // namespace boost
Modified: branches/release/boost/graph/detail/read_graphviz_spirit.hpp
==============================================================================
--- branches/release/boost/graph/detail/read_graphviz_spirit.hpp (original)
+++ branches/release/boost/graph/detail/read_graphviz_spirit.hpp 2010-04-02 11:25:11 EDT (Fri, 02 Apr 2010)
@@ -581,9 +581,9 @@
} // namespace detail
template <typename MultiPassIterator, typename MutableGraph>
-bool read_graphviz(MultiPassIterator begin, MultiPassIterator end,
- MutableGraph& graph, dynamic_properties& dp,
- std::string const& node_id = "node_id") {
+bool read_graphviz_spirit(MultiPassIterator begin, MultiPassIterator end,
+ MutableGraph& graph, dynamic_properties& dp,
+ std::string const& node_id = "node_id") {
using namespace boost;
using namespace boost::spirit::classic;
Copied: branches/release/boost/graph/distributed/one_bit_color_map.hpp (from r60079, /trunk/boost/graph/distributed/one_bit_color_map.hpp)
==============================================================================
--- /trunk/boost/graph/distributed/one_bit_color_map.hpp (original)
+++ branches/release/boost/graph/distributed/one_bit_color_map.hpp 2010-04-02 11:25:11 EDT (Fri, 02 Apr 2010)
@@ -50,7 +50,7 @@
inline one_bit_color_type
get(one_bit_color_map<local_property_map<ProcessGroup,GlobalMap,StorageMap> >
const& pm,
- typename one_bit_color_map<GlobalMap>::key_type key)
+ typename property_traits<GlobalMap>::key_type key)
{
return get(pm.base(), key);
}
@@ -59,7 +59,7 @@
inline void
put(one_bit_color_map<local_property_map<ProcessGroup,GlobalMap,StorageMap> >
const& pm,
- typename one_bit_color_map<GlobalMap>::key_type key,
+ typename property_traits<GlobalMap>::key_type key,
one_bit_color_type value)
{
put(pm.base(), key, value);
@@ -95,7 +95,7 @@
get(one_bit_color_map<
parallel::distributed_property_map<
ProcessGroup, GlobalMap, one_bit_color_map<StorageMap> > > const& pm,
- typename one_bit_color_map<GlobalMap>::key_type key)
+ typename property_traits<GlobalMap>::key_type key)
{
return get(pm.base(), key);
}
@@ -105,7 +105,7 @@
put(one_bit_color_map<
parallel::distributed_property_map<
ProcessGroup, GlobalMap, one_bit_color_map<StorageMap> > > const& pm,
- typename one_bit_color_map<GlobalMap>::key_type key,
+ typename property_traits<GlobalMap>::key_type key,
one_bit_color_type value)
{
put(pm.base(), key, value);
Modified: branches/release/boost/graph/distributed/two_bit_color_map.hpp
==============================================================================
--- branches/release/boost/graph/distributed/two_bit_color_map.hpp (original)
+++ branches/release/boost/graph/distributed/two_bit_color_map.hpp 2010-04-02 11:25:11 EDT (Fri, 02 Apr 2010)
@@ -50,7 +50,7 @@
inline two_bit_color_type
get(two_bit_color_map<local_property_map<ProcessGroup,GlobalMap,StorageMap> >
const& pm,
- typename two_bit_color_map<GlobalMap>::key_type key)
+ typename property_traits<GlobalMap>::key_type key)
{
return get(pm.base(), key);
}
@@ -59,7 +59,7 @@
inline void
put(two_bit_color_map<local_property_map<ProcessGroup,GlobalMap,StorageMap> >
const& pm,
- typename two_bit_color_map<GlobalMap>::key_type key,
+ typename property_traits<GlobalMap>::key_type key,
two_bit_color_type value)
{
put(pm.base(), key, value);
@@ -95,7 +95,7 @@
get(two_bit_color_map<
parallel::distributed_property_map<
ProcessGroup, GlobalMap, two_bit_color_map<StorageMap> > > const& pm,
- typename two_bit_color_map<GlobalMap>::key_type key)
+ typename property_traits<GlobalMap>::key_type key)
{
return get(pm.base(), key);
}
@@ -105,7 +105,7 @@
put(two_bit_color_map<
parallel::distributed_property_map<
ProcessGroup, GlobalMap, two_bit_color_map<StorageMap> > > const& pm,
- typename two_bit_color_map<GlobalMap>::key_type key,
+ typename property_traits<GlobalMap>::key_type key,
two_bit_color_type value)
{
put(pm.base(), key, value);
Modified: branches/release/boost/graph/filtered_graph.hpp
==============================================================================
--- branches/release/boost/graph/filtered_graph.hpp (original)
+++ branches/release/boost/graph/filtered_graph.hpp 2010-04-02 11:25:11 EDT (Fri, 02 Apr 2010)
@@ -13,6 +13,7 @@
#include <boost/graph/graph_traits.hpp>
#include <boost/graph/properties.hpp>
#include <boost/graph/adjacency_iterator.hpp>
+#include <boost/graph/detail/set_adaptor.hpp>
#include <boost/iterator/filter_iterator.hpp>
namespace boost {
Modified: branches/release/boost/graph/graph_test.hpp
==============================================================================
--- branches/release/boost/graph/graph_test.hpp (original)
+++ branches/release/boost/graph/graph_test.hpp 2010-04-02 11:25:11 EDT (Fri, 02 Apr 2010)
@@ -17,6 +17,8 @@
#include <boost/graph/isomorphism.hpp>
#include <boost/graph/copy.hpp>
#include <boost/graph/graph_utility.hpp> // for connects
+#include <boost/range.hpp>
+#include <boost/detail/algorithm.hpp>
// UNDER CONSTRUCTION
@@ -171,7 +173,7 @@
BOOST_CHECK(m == num_edges(g));
for (; p.first != p.second; ++p.first) {
edge_t e = *p.first;
- BOOST_CHECK(any_if(edge_set, connects(source(e, g), target(e, g), g)));
+ BOOST_CHECK(find_if(edge_set, connects(source(e, g), target(e, g), g)) != end(edge_set));
BOOST_CHECK(container_contains(vertex_set, source(e, g)) == true);
BOOST_CHECK(container_contains(vertex_set, target(e, g)) == true);
}
@@ -196,8 +198,8 @@
for (k = vertex_set.begin(); k != vertex_set.end(); ++k) {
p = edge(*j, *k, g);
if (p.second == true)
- BOOST_CHECK(any_if(edge_set,
- connects(source(p.first, g), target(p.first, g), g)) == true);
+ BOOST_CHECK(find_if(edge_set,
+ connects(source(p.first, g), target(p.first, g), g)) != end(edge_set));
}
}
Modified: branches/release/boost/graph/graphml.hpp
==============================================================================
--- branches/release/boost/graph/graphml.hpp (original)
+++ branches/release/boost/graph/graphml.hpp 2010-04-02 11:25:11 EDT (Fri, 02 Apr 2010)
@@ -24,6 +24,7 @@
#include <boost/mpl/find.hpp>
#include <boost/mpl/for_each.hpp>
#include <boost/property_tree/detail/xml_parser_utils.hpp>
+#include <boost/throw_exception.hpp>
#include <exception>
#include <sstream>
@@ -101,12 +102,16 @@
}
catch (bad_lexical_cast)
{
- throw parse_error("invalid value \"" + value + "\" for key " +
- name + " of type " + value_type);
+ BOOST_THROW_EXCEPTION(
+ parse_error("invalid value \"" + value + "\" for key " +
+ name + " of type " + value_type));
}
if (!type_found)
- throw parse_error("unrecognized type \"" + value_type +
- "\" for key " + name);
+ {
+ BOOST_THROW_EXCEPTION(
+ parse_error("unrecognized type \"" + value_type +
+ "\" for key " + name));
+ }
}
@@ -122,12 +127,16 @@
}
catch (bad_lexical_cast)
{
- throw parse_error("invalid value \"" + value + "\" for key " +
- name + " of type " + value_type);
+ BOOST_THROW_EXCEPTION(
+ parse_error("invalid value \"" + value + "\" for key " +
+ name + " of type " + value_type));
}
if (!type_found)
- throw parse_error("unrecognized type \"" + value_type +
- "\" for key " + name);
+ {
+ BOOST_THROW_EXCEPTION(
+ parse_error("unrecognized type \"" + value_type +
+ "\" for key " + name));
+ }
}
@@ -143,12 +152,16 @@
}
catch (bad_lexical_cast)
{
- throw parse_error("invalid value \"" + value + "\" for key " +
- name + " of type " + value_type);
+ BOOST_THROW_EXCEPTION(
+ parse_error("invalid value \"" + value + "\" for key " +
+ name + " of type " + value_type));
}
if (!type_found)
- throw parse_error("unrecognized type \"" + value_type +
- "\" for key " + name);
+ {
+ BOOST_THROW_EXCEPTION(
+ parse_error("unrecognized type \"" + value_type +
+ "\" for key " + name));
+ }
}
template <typename Key, typename ValueVector>
Modified: branches/release/boost/graph/graphviz.hpp
==============================================================================
--- branches/release/boost/graph/graphviz.hpp (original)
+++ branches/release/boost/graph/graphviz.hpp 2010-04-02 11:25:11 EDT (Fri, 02 Apr 2010)
@@ -25,6 +25,7 @@
#include <boost/property_map/dynamic_property_map.hpp>
#include <boost/graph/overloading.hpp>
#include <boost/graph/dll_import_export.hpp>
+#include <boost/spirit/include/classic_multi_pass.hpp>
namespace boost {
@@ -771,10 +772,51 @@
std::map<edge_t, bgl_edge_t> bgl_edges;
};
-BOOST_GRAPH_DECL
-bool read_graphviz(std::istream& in, mutate_graph& graph);
+} } } // end namespace boost::detail::graph
-} } // end namespace detail::graph
+#ifdef BOOST_GRAPH_USE_SPIRIT_PARSER
+# ifndef BOOST_GRAPH_READ_GRAPHVIZ_ITERATORS
+# define BOOST_GRAPH_READ_GRAPHVIZ_ITERATORS
+# endif
+# include <boost/graph/detail/read_graphviz_spirit.hpp>
+#else // New default parser
+# include <boost/graph/detail/read_graphviz_new.hpp>
+#endif // BOOST_GRAPH_USE_SPIRIT_PARSER
+
+namespace boost {
+
+// Parse the passed string as a GraphViz dot file.
+template <typename MutableGraph>
+bool read_graphviz(const std::string& data,
+ MutableGraph& graph,
+ dynamic_properties& dp,
+ std::string const& node_id = "node_id") {
+#ifdef BOOST_GRAPH_USE_SPIRIT_PARSER
+ return read_graphviz_spirit(data.begin(), data.end(), graph, dp, node_id);
+#else // Non-Spirit parser
+ return read_graphviz_new(data,graph,dp,node_id);
+#endif
+}
+
+// Parse the passed iterator range as a GraphViz dot file.
+template <typename InputIterator, typename MutableGraph>
+bool read_graphviz(InputIterator user_first,
+ InputIterator user_last,
+ MutableGraph& graph,
+ dynamic_properties& dp,
+ std::string const& node_id = "node_id") {
+#ifdef BOOST_GRAPH_USE_SPIRIT_PARSER
+ typedef InputIterator is_t;
+ typedef boost::spirit::classic::multi_pass<is_t> iterator_t;
+
+ iterator_t first(boost::spirit::classic::make_multi_pass(user_first));
+ iterator_t last(boost::spirit::classic::make_multi_pass(user_last));
+
+ return read_graphviz_spirit(first, last, graph, dp, node_id);
+#else // Non-Spirit parser
+ return read_graphviz_new(std::string(user_first, user_last), graph, dp, node_id);
+#endif
+}
// Parse the passed stream as a GraphViz dot file.
template <typename MutableGraph>
@@ -782,25 +824,13 @@
dynamic_properties& dp,
std::string const& node_id = "node_id")
{
- std::string data;
+ typedef std::istream_iterator<char> is_t;
in >> std::noskipws;
- std::copy(std::istream_iterator<char>(in),
- std::istream_iterator<char>(),
- std::back_inserter(data));
- return read_graphviz(data,graph,dp,node_id);
+ return read_graphviz(is_t(in), is_t(), graph, dp, node_id);
}
} // namespace boost
-#ifdef BOOST_GRAPH_USE_SPIRIT_PARSER
-# ifndef BOOST_GRAPH_READ_GRAPHVIZ_ITERATORS
-# define BOOST_GRAPH_READ_GRAPHVIZ_ITERATORS
-# endif
-# include <boost/graph/detail/read_graphviz_spirit.hpp>
-#else // New default parser
-# include <boost/graph/detail/read_graphviz_new.hpp>
-#endif // BOOST_GRAPH_USE_SPIRIT_PARSER
-
#ifdef BOOST_GRAPH_USE_MPI
# include <boost/graph/distributed/graphviz.hpp>
#endif
Modified: branches/release/boost/graph/gursoy_atun_layout.hpp
==============================================================================
--- branches/release/boost/graph/gursoy_atun_layout.hpp (original)
+++ branches/release/boost/graph/gursoy_atun_layout.hpp 2010-04-02 11:25:11 EDT (Fri, 02 Apr 2010)
@@ -16,6 +16,7 @@
// http://springerlink.metapress.com/link.asp?id=pcu07ew5rhexp9yt
#include <boost/config/no_tr1/cmath.hpp>
+#include <boost/throw_exception.hpp>
#include <vector>
#include <exception>
#include <algorithm>
@@ -72,7 +73,7 @@
#endif
if (get(node_distance, v) > distance_limit)
- throw over_distance_limit();
+ BOOST_THROW_EXCEPTION(over_distance_limit());
Point old_position = get(position_map, v);
double distance = get(node_distance, v);
double fraction =
Modified: branches/release/boost/graph/metric_tsp_approx.hpp
==============================================================================
--- branches/release/boost/graph/metric_tsp_approx.hpp (original)
+++ branches/release/boost/graph/metric_tsp_approx.hpp 2010-04-02 11:25:11 EDT (Fri, 02 Apr 2010)
@@ -35,7 +35,7 @@
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/prim_minimum_spanning_tree.hpp>
#include <boost/graph/lookup_edge.hpp>
-
+#include <boost/throw_exception.hpp>
namespace boost
{
@@ -287,7 +287,7 @@
bool found;
tie(e, found) = lookup_edge(previous_, v, g);
if(!found) {
- throw not_complete();
+ BOOST_THROW_EXCEPTION(not_complete());
}
tourlen_ += wmap_[e];
Copied: branches/release/boost/graph/one_bit_color_map.hpp (from r60079, /trunk/boost/graph/one_bit_color_map.hpp)
==============================================================================
--- /trunk/boost/graph/one_bit_color_map.hpp (original)
+++ branches/release/boost/graph/one_bit_color_map.hpp 2010-04-02 11:25:11 EDT (Fri, 02 Apr 2010)
@@ -41,8 +41,6 @@
struct one_bit_color_map
{
BOOST_STATIC_CONSTANT(int, bits_per_char = std::numeric_limits<unsigned char>::digits);
- BOOST_STATIC_ASSERT(std::numeric_limits<unsigned char>::radix == 2);
- BOOST_STATIC_ASSERT(bits_per_char > 0);
std::size_t n;
IndexMap index;
shared_array<unsigned char> data;
@@ -63,7 +61,7 @@
template<typename IndexMap>
inline one_bit_color_type
get(const one_bit_color_map<IndexMap>& pm,
- typename one_bit_color_map<IndexMap>::key_type key)
+ typename property_traits<IndexMap>::key_type key)
{
BOOST_STATIC_CONSTANT(int, bits_per_char = one_bit_color_map<IndexMap>::bits_per_char);
typename property_traits<IndexMap>::value_type i = get(pm.index, key);
@@ -74,7 +72,7 @@
template<typename IndexMap>
inline void
put(const one_bit_color_map<IndexMap>& pm,
- typename one_bit_color_map<IndexMap>::key_type key,
+ typename property_traits<IndexMap>::key_type key,
one_bit_color_type value)
{
BOOST_STATIC_CONSTANT(int, bits_per_char = one_bit_color_map<IndexMap>::bits_per_char);
Modified: branches/release/boost/graph/topological_sort.hpp
==============================================================================
--- branches/release/boost/graph/topological_sort.hpp (original)
+++ branches/release/boost/graph/topological_sort.hpp 2010-04-02 11:25:11 EDT (Fri, 02 Apr 2010)
@@ -16,6 +16,7 @@
#include <boost/graph/depth_first_search.hpp>
#include <boost/graph/visitors.hpp>
#include <boost/graph/exception.hpp>
+#include <boost/throw_exception.hpp>
namespace boost {
@@ -37,7 +38,7 @@
: m_iter(_iter) { }
template <typename Edge, typename Graph>
- void back_edge(const Edge&, Graph&) { throw not_a_dag(); }
+ void back_edge(const Edge&, Graph&) { BOOST_THROW_EXCEPTION(not_a_dag()); }
template <typename Vertex, typename Graph>
void finish_vertex(const Vertex& u, Graph&) { *m_iter++ = u; }
Modified: branches/release/boost/graph/two_bit_color_map.hpp
==============================================================================
--- branches/release/boost/graph/two_bit_color_map.hpp (original)
+++ branches/release/boost/graph/two_bit_color_map.hpp 2010-04-02 11:25:11 EDT (Fri, 02 Apr 2010)
@@ -16,7 +16,9 @@
#include <boost/property_map/property_map.hpp>
#include <boost/graph/properties.hpp>
#include <boost/shared_array.hpp>
+#include <boost/config.hpp>
#include <algorithm>
+#include <limits>
namespace boost {
@@ -44,40 +46,46 @@
IndexMap index;
shared_array<unsigned char> data;
+ BOOST_STATIC_CONSTANT(int, bits_per_char = std::numeric_limits<unsigned char>::digits);
+ BOOST_STATIC_CONSTANT(int, elements_per_char = bits_per_char / 2);
typedef typename property_traits<IndexMap>::key_type key_type;
typedef two_bit_color_type value_type;
typedef void reference;
typedef read_write_property_map_tag category;
explicit two_bit_color_map(std::size_t n, const IndexMap& index = IndexMap())
- : n(n), index(index), data(new unsigned char[(n + 3) / 4])
+ : n(n), index(index), data(new unsigned char[(n + elements_per_char - 1) / elements_per_char])
{
// Fill to white
- std::fill(data.get(), data.get() + (n + 3) / 4, 0);
+ std::fill(data.get(), data.get() + (n + elements_per_char - 1) / elements_per_char, 0);
}
};
template<typename IndexMap>
inline two_bit_color_type
get(const two_bit_color_map<IndexMap>& pm,
- typename two_bit_color_map<IndexMap>::key_type key)
+ typename property_traits<IndexMap>::key_type key)
{
+ BOOST_STATIC_CONSTANT(int, elements_per_char = two_bit_color_map<IndexMap>::elements_per_char);
typename property_traits<IndexMap>::value_type i = get(pm.index, key);
assert ((std::size_t)i < pm.n);
- return two_bit_color_type((pm.data.get()[i / 4] >> ((i % 4) * 2)) & 3);
+ std::size_t byte_num = i / elements_per_char;
+ std::size_t bit_position = ((i % elements_per_char) * 2);
+ return two_bit_color_type((pm.data.get()[byte_num] >> bit_position) & 3);
}
template<typename IndexMap>
inline void
put(const two_bit_color_map<IndexMap>& pm,
- typename two_bit_color_map<IndexMap>::key_type key,
+ typename property_traits<IndexMap>::key_type key,
two_bit_color_type value)
{
+ BOOST_STATIC_CONSTANT(int, elements_per_char = two_bit_color_map<IndexMap>::elements_per_char);
typename property_traits<IndexMap>::value_type i = get(pm.index, key);
assert ((std::size_t)i < pm.n);
assert (value >= 0 && value < 4);
- std::size_t byte_num = i / 4;
- std::size_t bit_position = ((i % 4) * 2);
+ std::size_t byte_num = i / elements_per_char;
+ std::size_t bit_position = ((i % elements_per_char) * 2);
pm.data.get()[byte_num] =
(unsigned char)
((pm.data.get()[byte_num] & ~(3 << bit_position))
Modified: branches/release/boost/graph/visitors.hpp
==============================================================================
--- branches/release/boost/graph/visitors.hpp (original)
+++ branches/release/boost/graph/visitors.hpp 2010-04-02 11:25:11 EDT (Fri, 02 Apr 2010)
@@ -251,6 +251,52 @@
return property_writer<PA, OutputIterator, Tag>(pa, out);
}
+ //========================================================================
+ // property_put
+
+ /**
+ * Functor which just sets a given value to a vertex or edge in a property map.
+ */
+
+ template <typename PropertyMap, typename EventTag>
+ struct property_put
+ {
+ typedef EventTag event_filter;
+
+ property_put (PropertyMap property_map,
+ typename property_traits <PropertyMap>::value_type value) :
+ property_map_ (property_map), value_ (value)
+ {}
+
+ template <typename VertexOrEdge, typename Graph>
+ void operator() (VertexOrEdge v, const Graph& g)
+ {
+ put (property_map_, v, value_);
+ }
+
+ private:
+ PropertyMap property_map_;
+ typename property_traits <PropertyMap>::value_type value_;
+ };
+
+ /**
+ * Creates a property_put functor which just sets a given value to a vertex or edge.
+ *
+ * @param property_map Given writeable property map
+ * @param value Fixed value of the map
+ * @param tag Event Filter
+ * @return The functor.
+ */
+
+ template <typename PropertyMap, typename EventTag>
+ inline property_put <PropertyMap, EventTag>
+ put_property (PropertyMap property_map,
+ typename property_traits <PropertyMap>::value_type value,
+ EventTag tag)
+ {
+ return property_put <PropertyMap, EventTag> (property_map, value);
+ }
+
#define BOOST_GRAPH_EVENT_STUB(Event,Kind) \
typedef ::boost::Event Event##_type; \
template<typename Visitor> \
Modified: branches/release/boost/pending/container_traits.hpp
==============================================================================
--- branches/release/boost/pending/container_traits.hpp (original)
+++ branches/release/boost/pending/container_traits.hpp 2010-04-02 11:25:11 EDT (Fri, 02 Apr 2010)
@@ -1,4 +1,6 @@
// (C) Copyright Jeremy Siek 2004
+// (C) Copyright Thomas Claveirole 2010
+// (C) Copyright Ignacy Gawedzki 2010
// 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)
@@ -17,19 +19,8 @@
#include <list>
#include <map>
#include <set>
-
-#if !defined BOOST_NO_HASH
-# ifdef BOOST_HASH_SET_HEADER
-# include BOOST_HASH_SET_HEADER
-# else
-# include <hash_set>
-# endif
-# ifdef BOOST_HASH_MAP_HEADER
-# include BOOST_HASH_MAP_HEADER
-# else
-# include <hash_map>
-# endif
-#endif
+#include <boost/unordered_set.hpp>
+#include <boost/unordered_map.hpp>
#if !defined BOOST_NO_SLIST
# ifdef BOOST_SLIST_HEADER
@@ -273,34 +264,87 @@
// hash_set, hash_map
+ struct unordered_set_tag :
+ virtual public simple_associative_container_tag,
+ virtual public unique_associative_container_tag
+ { };
+
+ struct unordered_multiset_tag :
+ virtual public simple_associative_container_tag,
+ virtual public multiple_associative_container_tag
+ { };
+
+
+ struct unordered_map_tag :
+ virtual public pair_associative_container_tag,
+ virtual public unique_associative_container_tag
+ { };
+
+ struct unordered_multimap_tag :
+ virtual public pair_associative_container_tag,
+ virtual public multiple_associative_container_tag
+ { };
+
+
#ifndef BOOST_NO_HASH
#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
template <class Key, class Eq, class Hash, class Alloc>
- struct container_traits< BOOST_STD_EXTENSION_NAMESPACE::hash_set<Key,Eq,Hash,Alloc> > {
- typedef set_tag category;
- typedef stable_tag iterator_stability; // is this right?
+ struct container_traits< boost::unordered_set<Key,Eq,Hash,Alloc> > {
+ typedef unordered_set_tag category;
+ typedef unstable_tag iterator_stability;
};
template <class Key, class T, class Eq, class Hash, class Alloc>
- struct container_traits< BOOST_STD_EXTENSION_NAMESPACE::hash_map<Key,T,Eq,Hash,Alloc> > {
- typedef map_tag category;
- typedef stable_tag iterator_stability; // is this right?
+ struct container_traits< boost::unordered_map<Key,T,Eq,Hash,Alloc> > {
+ typedef unordered_map_tag category;
+ typedef unstable_tag iterator_stability;
+ };
+ template <class Key, class Eq, class Hash, class Alloc>
+ struct container_traits< boost::unordered_multiset<Key,Eq,Hash,Alloc> > {
+ typedef unordered_multiset_tag category;
+ typedef unstable_tag iterator_stability;
+ };
+ template <class Key, class T, class Eq, class Hash, class Alloc>
+ struct container_traits< boost::unordered_multimap<Key,T,Eq,Hash,Alloc> > {
+ typedef unordered_multimap_tag category;
+ typedef unstable_tag iterator_stability;
};
#endif
template <class Key, class Eq, class Hash, class Alloc>
- set_tag container_category(const BOOST_STD_EXTENSION_NAMESPACE::hash_set<Key,Eq,Hash,Alloc>&)
- { return set_tag(); }
+ unordered_set_tag
+ container_category(const boost::unordered_set<Key,Eq,Hash,Alloc>&)
+ { return unordered_set_tag(); }
template <class Key, class T, class Eq, class Hash, class Alloc>
- map_tag container_category(const BOOST_STD_EXTENSION_NAMESPACE::hash_map<Key,T,Eq,Hash,Alloc>&)
- { return map_tag(); }
+ unordered_map_tag
+ container_category(const boost::unordered_map<Key,T,Eq,Hash,Alloc>&)
+ { return unordered_map_tag(); }
template <class Key, class Eq, class Hash, class Alloc>
- stable_tag iterator_stability(const BOOST_STD_EXTENSION_NAMESPACE::hash_set<Key,Eq,Hash,Alloc>&)
- { return stable_tag(); }
+ unstable_tag iterator_stability(const boost::unordered_set<Key,Eq,Hash,Alloc>&)
+ { return unstable_tag(); }
template <class Key, class T, class Eq, class Hash, class Alloc>
- stable_tag iterator_stability(const BOOST_STD_EXTENSION_NAMESPACE::hash_map<Key,T,Eq,Hash,Alloc>&)
- { return stable_tag(); }
+ unstable_tag iterator_stability(const boost::unordered_map<Key,T,Eq,Hash,Alloc>&)
+ { return unstable_tag(); }
+ template <class Key, class Eq, class Hash, class Alloc>
+ unordered_multiset_tag
+ container_category(const boost::unordered_multiset<Key,Eq,Hash,Alloc>&)
+ { return unordered_multiset_tag(); }
+
+ template <class Key, class T, class Eq, class Hash, class Alloc>
+ unordered_multimap_tag
+ container_category(const boost::unordered_multimap<Key,T,Eq,Hash,Alloc>&)
+ { return unordered_multimap_tag(); }
+
+ template <class Key, class Eq, class Hash, class Alloc>
+ unstable_tag
+ iterator_stability(const boost::unordered_multiset<Key,Eq,Hash,Alloc>&)
+ { return unstable_tag(); }
+
+ template <class Key, class T, class Eq, class Hash, class Alloc>
+ unstable_tag
+ iterator_stability(const boost::unordered_multimap<Key,T,Eq,Hash,Alloc>&)
+ { return unstable_tag(); }
#endif
@@ -414,6 +458,37 @@
return push_dispatch(c, v, container_category(c));
}
+ // Equal range
+ template <class Container,
+ class LessThanComparable>
+ std::pair<typename Container::iterator, typename Container::iterator>
+ equal_range_dispatch(Container& c,
+ const LessThanComparable& value,
+ container_tag)
+ {
+ // c must be sorted for std::equal_range to behave properly.
+ return std::equal_range(c.begin(), c.end(), value);
+ }
+
+ template <class AssociativeContainer, class LessThanComparable>
+ std::pair<typename AssociativeContainer::iterator,
+ typename AssociativeContainer::iterator>
+ equal_range_dispatch(AssociativeContainer& c,
+ const LessThanComparable& value,
+ associative_container_tag)
+ {
+ return c.equal_range(value);
+ }
+
+ template <class Container, class LessThanComparable>
+ std::pair<typename Container::iterator, typename Container::iterator>
+ equal_range(Container& c,
+ const LessThanComparable& value)
+ {
+ return equal_range_dispatch(c, value,
+ graph_detail::container_category(c));
+ }
+
}} // namespace boost::graph_detail
#if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
Modified: branches/release/boost/pending/indirect_cmp.hpp
==============================================================================
--- branches/release/boost/pending/indirect_cmp.hpp (original)
+++ branches/release/boost/pending/indirect_cmp.hpp 2010-04-02 11:25:11 EDT (Fri, 02 Apr 2010)
@@ -65,7 +65,7 @@
inline indirect_pmap(const ReadablePropertyMap& df)
: d(df) { }
- inline bool operator()(const K& u) const {
+ inline T operator()(const K& u) const {
return get(d, u);
}
protected:
Modified: branches/release/boost/pending/mutable_queue.hpp
==============================================================================
--- branches/release/boost/pending/mutable_queue.hpp (original)
+++ branches/release/boost/pending/mutable_queue.hpp 2010-04-02 11:25:11 EDT (Fri, 02 Apr 2010)
@@ -23,20 +23,20 @@
namespace boost {
// The mutable queue whose elements are indexed
- //
+ //
// This adaptor provides a special kind of priority queue that has
// and update operation. This allows the ordering of the items to
// change. After the ordering criteria for item x changes, one must
// call the Q.update(x)
- //
+ //
// In order to efficiently find x in the queue, a functor must be
// provided to map value_type to a unique ID, which the
// mutable_queue will then use to map to the location of the
// item. The ID's generated must be between 0 and N, where N is the
// value passed to the constructor of mutable_queue
- template <class IndexedType,
- class RandomAccessContainer = std::vector<IndexedType>,
+ template <class IndexedType,
+ class RandomAccessContainer = std::vector<IndexedType>,
class Comp = std::less<typename RandomAccessContainer::value_type>,
class ID = identity_property_map >
class mutable_queue {
@@ -46,23 +46,23 @@
protected:
typedef typename RandomAccessContainer::iterator iterator;
#if !defined BOOST_NO_STD_ITERATOR_TRAITS
- typedef adstl::array_binary_tree_node<iterator, ID> Node;
+ typedef array_binary_tree_node<iterator, ID> Node;
#else
- typedef adstl::array_binary_tree_node<iterator, value_type, ID> Node;
+ typedef array_binary_tree_node<iterator, value_type, ID> Node;
#endif
- typedef adstl::compare_array_node<RandomAccessContainer,Comp> Compare;
+ typedef compare_array_node<RandomAccessContainer,Comp> Compare;
typedef std::vector<size_type> IndexArray;
public:
typedef Compare value_compare;
typedef ID id_generator;
- mutable_queue(size_type n, const Comp& x, const ID& _id)
+ mutable_queue(size_type n, const Comp& x, const ID& _id)
: index_array(n), comp(x), id(_id) {
- c.reserve(n);
+ c.reserve(n);
}
template <class ForwardIterator>
- mutable_queue(ForwardIterator first, ForwardIterator last,
- const Comp& x, const ID& _id)
+ mutable_queue(ForwardIterator first, ForwardIterator last,
+ const Comp& x, const ID& _id)
: index_array(std::distance(first, last)), comp(x), id(_id)
{
while( first != last ) {
@@ -72,7 +72,7 @@
}
bool empty() const { return c.empty(); }
-
+
void pop() {
value_type tmp = c.back();
c.back() = c.front();
@@ -86,7 +86,7 @@
c.pop_back();
Node node(c.begin(), c.end(), c.begin(), id);
- down_heap(node, comp, index_array);
+ down_heap(node, comp, index_array);
}
void push(const IndexedType& x) {
c.push_back(x);
@@ -120,7 +120,7 @@
bool test() {
return std::is_heap(c.begin(), c.end(), Comp());
}
-#endif
+#endif
protected:
IndexArray index_array;
Modified: branches/release/boost/property_map/dynamic_property_map.hpp
==============================================================================
--- branches/release/boost/property_map/dynamic_property_map.hpp (original)
+++ branches/release/boost/property_map/dynamic_property_map.hpp 2010-04-02 11:25:11 EDT (Fri, 02 Apr 2010)
@@ -18,6 +18,7 @@
#include <boost/config.hpp>
+#include <boost/throw_exception.hpp>
#include <boost/property_map/property_map.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/any.hpp>
@@ -29,6 +30,7 @@
#include <sstream>
#include <map>
#include <boost/type.hpp>
+#include <boost/smart_ptr.hpp>
namespace boost {
@@ -165,7 +167,7 @@
void do_put(const any&, const any&, mpl::bool_<false>)
{
- throw dynamic_const_put_error();
+ BOOST_THROW_EXCEPTION(dynamic_const_put_error());
}
public:
@@ -223,9 +225,9 @@
//
struct dynamic_properties
{
- typedef std::multimap<std::string, dynamic_property_map*>
+ typedef std::multimap<std::string, boost::shared_ptr<dynamic_property_map> >
property_maps_type;
- typedef boost::function3<std::auto_ptr<dynamic_property_map>,
+ typedef boost::function3<boost::shared_ptr<dynamic_property_map>,
const std::string&,
const boost::any&,
const boost::any&> generate_fn_type;
@@ -237,24 +239,16 @@
dynamic_properties() : generate_fn() { }
dynamic_properties(const generate_fn_type& g) : generate_fn(g) {}
- ~dynamic_properties()
- {
- for (property_maps_type::iterator i = property_maps.begin();
- i != property_maps.end(); ++i) {
- delete i->second;
- }
- }
+ ~dynamic_properties() {}
template<typename PropertyMap>
dynamic_properties&
property(const std::string& name, PropertyMap property_map)
{
// Tbd: exception safety
- std::auto_ptr<dynamic_property_map> pm(
+ boost::shared_ptr<dynamic_property_map> pm(
new detail::dynamic_property_map_adaptor<PropertyMap>(property_map));
- property_maps_type::iterator i =
- property_maps.insert(property_maps_type::value_type(name, (dynamic_property_map*)0));
- i->second = pm.release();
+ property_maps.insert(property_maps_type::value_type(name, pm));
return *this;
}
@@ -271,17 +265,17 @@
{ return property_maps.lower_bound(name); }
void
- insert(const std::string& name, std::auto_ptr<dynamic_property_map> pm)
+ insert(const std::string& name, boost::shared_ptr<dynamic_property_map> pm)
{
- property_maps.insert(property_maps_type::value_type(name, pm.release()));
+ property_maps.insert(property_maps_type::value_type(name, pm));
}
template<typename Key, typename Value>
- std::auto_ptr<dynamic_property_map>
+ boost::shared_ptr<dynamic_property_map>
generate(const std::string& name, const Key& key, const Value& value)
{
if(!generate_fn) {
- throw property_not_found(name);
+ BOOST_THROW_EXCEPTION(property_not_found(name));
} else {
return generate_fn(name,key,value);
}
@@ -305,7 +299,7 @@
}
}
- std::auto_ptr<dynamic_property_map> new_map = dp.generate(name, key, value);
+ boost::shared_ptr<dynamic_property_map> new_map = dp.generate(name, key, value);
if (new_map.get()) {
new_map->put(key, value);
dp.insert(name, new_map);
@@ -326,7 +320,7 @@
return any_cast<Value>(i->second->get(key));
}
- throw dynamic_get_failure(name);
+ BOOST_THROW_EXCEPTION(dynamic_get_failure(name));
}
#endif
@@ -340,7 +334,7 @@
return any_cast<Value>(i->second->get(key));
}
- throw dynamic_get_failure(name);
+ BOOST_THROW_EXCEPTION(dynamic_get_failure(name));
}
template<typename Key>
@@ -353,16 +347,16 @@
return i->second->get_string(key);
}
- throw dynamic_get_failure(name);
+ BOOST_THROW_EXCEPTION(dynamic_get_failure(name));
}
// The easy way to ignore properties.
inline
-std::auto_ptr<boost::dynamic_property_map>
+boost::shared_ptr<boost::dynamic_property_map>
ignore_other_properties(const std::string&,
const boost::any&,
const boost::any&) {
- return std::auto_ptr<boost::dynamic_property_map>(0);
+ return boost::shared_ptr<boost::dynamic_property_map>();
}
} // namespace boost
Modified: branches/release/boost/property_map/property_map.hpp
==============================================================================
--- branches/release/boost/property_map/property_map.hpp (original)
+++ branches/release/boost/property_map/property_map.hpp 2010-04-02 11:25:11 EDT (Fri, 02 Apr 2010)
@@ -19,6 +19,8 @@
#include <boost/concept_archetype.hpp>
#include <boost/mpl/assert.hpp>
#include <boost/mpl/or.hpp>
+#include <boost/mpl/and.hpp>
+#include <boost/mpl/has_xxx.hpp>
#include <boost/type_traits/is_same.hpp>
namespace boost {
@@ -26,6 +28,39 @@
//=========================================================================
// property_traits class
+ BOOST_MPL_HAS_XXX_TRAIT_DEF(key_type)
+ BOOST_MPL_HAS_XXX_TRAIT_DEF(value_type)
+ BOOST_MPL_HAS_XXX_TRAIT_DEF(reference)
+ BOOST_MPL_HAS_XXX_TRAIT_DEF(category)
+
+ template<class PA>
+ struct is_property_map :
+ boost::mpl::and_<
+ has_key_type<PA>,
+ has_value_type<PA>,
+ has_reference<PA>,
+ has_category<PA>
+ >
+ {};
+
+ template <typename PA>
+ struct default_property_traits {
+ typedef typename PA::key_type key_type;
+ typedef typename PA::value_type value_type;
+ typedef typename PA::reference reference;
+ typedef typename PA::category category;
+ };
+
+ struct null_property_traits {};
+
+ template <typename PA>
+ struct property_traits :
+ boost::mpl::if_<is_property_map<PA>,
+ default_property_traits<PA>,
+ null_property_traits>::type
+ {};
+
+#if 0
template <typename PA>
struct property_traits {
typedef typename PA::key_type key_type;
@@ -33,6 +68,7 @@
typedef typename PA::reference reference;
typedef typename PA::category category;
};
+#endif
//=========================================================================
// property_traits category tags
Modified: branches/release/libs/graph/doc/AStarVisitor.html
==============================================================================
--- branches/release/libs/graph/doc/AStarVisitor.html (original)
+++ branches/release/libs/graph/doc/AStarVisitor.html 2010-04-02 11:25:11 EDT (Fri, 02 Apr 2010)
@@ -118,7 +118,7 @@
<td><tt>vis.examine_vertex(u, g)</tt></td>
<td><tt>void</tt></td>
<td>
-This is invoked on a vertex as it is popped from the queue (i.e. it
+This is invoked on a vertex as it is popped from the queue (i.e., it
has the lowest cost on the OPEN list). This happens immediately before
<tt>examine_edge()</tt> is invoked on each of the out-edges of vertex
<tt>u</tt>.
@@ -160,7 +160,7 @@
<td><tt>vis.edge_not_relaxed(e, g)</tt></td>
<td><tt>void</tt></td>
<td>
-Upon examination, if an edge is not relaxed (see above), then this
+Upon examination, if an edge is not relaxed (see above) then this
method is invoked.
</td>
</tr>
@@ -171,7 +171,7 @@
<td><tt>void</tt></td>
<td>
This is invoked when a vertex that is on the CLOSED list is
-``rediscovered'' via a more efficient path, and is re-added to the
+``rediscovered'' via a more efficient path and is re-added to the
OPEN list.
</td>
</tr>
@@ -181,8 +181,8 @@
<td><tt>vis.finish_vertex(u, g)</tt></td>
<td><tt>void</tt></td>
<td>
-This is invoked on a vertex when it is added to the CLOSED list, which
-happens after all of its out edges have been examined.
+This is invoked on a vertex when it is added to the CLOSED list. This
+happens after all of its out-edges have been examined.
</td>
</tr>
Modified: branches/release/libs/graph/doc/BFSVisitor.html
==============================================================================
--- branches/release/libs/graph/doc/BFSVisitor.html (original)
+++ branches/release/libs/graph/doc/BFSVisitor.html 2010-04-02 11:25:11 EDT (Fri, 02 Apr 2010)
@@ -140,7 +140,7 @@
<td><tt>vis.gray_target(e, g)</tt></td>
<td><tt>void</tt></td>
<td>
-This is invoked on the subset of non-tree edges who's target vertex is
+This is invoked on the subset of non-tree edges whose target vertex is
colored gray at the time of examination. The color gray indicates
that the vertex is currently in the queue.
</td>
@@ -151,7 +151,7 @@
<td><tt>vis.black_target(e, g)</tt></td>
<td><tt>void</tt></td>
<td>
-This is invoked on the subset of non-tree edges who's target vertex is
+This is invoked on the subset of non-tree edges whose target vertex is
colored black at the time of examination. The color black indicates
that the vertex has been removed from the queue.
</td>
Modified: branches/release/libs/graph/doc/BellmanFordVisitor.html
==============================================================================
--- branches/release/libs/graph/doc/BellmanFordVisitor.html (original)
+++ branches/release/libs/graph/doc/BellmanFordVisitor.html 2010-04-02 11:25:11 EDT (Fri, 02 Apr 2010)
@@ -116,8 +116,8 @@
<td><tt>vis.edge_minimized(e, g)</tt></td>
<td><tt>void</tt></td>
<td>
-After the <tt>num_vertices(g)</tt> iterations through the edge set
-of the graph is complete, one last iteration is made to test whether
+After <tt>num_vertices(g)</tt> iterations through the edge set
+of the graph are completed, one last iteration is made to test whether
each edge was minimized. If the edge is minimized then this function
is invoked.
</td>
Modified: branches/release/libs/graph/doc/DFSVisitor.html
==============================================================================
--- branches/release/libs/graph/doc/DFSVisitor.html (original)
+++ branches/release/libs/graph/doc/DFSVisitor.html 2010-04-02 11:25:11 EDT (Fri, 02 Apr 2010)
@@ -157,7 +157,7 @@
This is invoked on vertex <tt>u</tt> after <tt>finish_vertex</tt> has
been called for all the vertices in the DFS-tree rooted at vertex
<tt>u</tt>. If vertex <tt>u</tt> is a leaf in the DFS-tree, then
-the <tt>finish_vertex</tt> function is call on <tt>u</tt> after
+the <tt>finish_vertex</tt> function is called on <tt>u</tt> after
all the out-edges of <tt>u</tt> have been examined.
</td>
</tr>
Modified: branches/release/libs/graph/doc/EventVisitorList.html
==============================================================================
--- branches/release/libs/graph/doc/EventVisitorList.html (original)
+++ branches/release/libs/graph/doc/EventVisitorList.html 2010-04-02 11:25:11 EDT (Fri, 02 Apr 2010)
@@ -19,7 +19,7 @@
An EventVisitorList is either an <a
href="./EventVisitor.html">EventVisitor</a>, or a list of
-EventVisitor's combined using <tt>std::pair</tt>. Each graph algorithm
+EventVisitors combined using <tt>std::pair</tt>. Each graph algorithm
defines visitor adaptors that convert an EventVisitorList into the
particular kind of visitor needed by the algorithm.
@@ -91,7 +91,7 @@
color.begin());
</pre>
-For creating a list of more than two event visitors, nest calls to
+For creating a list of more than two event visitors, you can nest calls to
<tt>std::make_pair</tt> in the following way:
<pre>
Modified: branches/release/libs/graph/doc/adjacency_list.html
==============================================================================
--- branches/release/libs/graph/doc/adjacency_list.html (original)
+++ branches/release/libs/graph/doc/adjacency_list.html 2010-04-02 11:25:11 EDT (Fri, 02 Apr 2010)
@@ -37,7 +37,7 @@
representation of a directed graph.
<P></P>
-<DIV ALIGN="center"><A NAME="fig:adj-list-graph"></A><A NAME="1509"></A>
+<DIV ALIGN="center"><A NAME="fig:adj-list-graph"></A>
<TABLE>
<CAPTION ALIGN="BOTTOM"><STRONG>Figure 1:</STRONG> Adjacency List Representation of a Directed Graph.</CAPTION>
<TR><TD><IMG SRC="./figs/adj-matrix-graph2.gif" width="386" height="284"></TD>
@@ -67,7 +67,7 @@
representation of an undirected graph.
<P></P>
-<DIV ALIGN="center"><A NAME="fig:undir-adj-list-graph"></A><A NAME="1509"></A>
+<DIV ALIGN="center"><A NAME="fig:undir-adj-list-graph"></A>
<TABLE>
<CAPTION ALIGN="BOTTOM"><STRONG>Figure 2:</STRONG> Adjacency List Representation of an Undirected Graph.</CAPTION>
<TR><TD><IMG SRC="./figs/undir-adj-matrix-graph2.gif" width="260" height="240"></TD>
Modified: branches/release/libs/graph/doc/adjacency_matrix.html
==============================================================================
--- branches/release/libs/graph/doc/adjacency_matrix.html (original)
+++ branches/release/libs/graph/doc/adjacency_matrix.html 2010-04-02 11:25:11 EDT (Fri, 02 Apr 2010)
@@ -32,7 +32,7 @@
representation of a graph.
<P></P>
-<DIV ALIGN="center"><A NAME="fig:adj-matrix-graph"></A><A NAME="1509"></A>
+<DIV ALIGN="center"><A NAME="fig:adj-matrix-graph"></A>
<TABLE>
<CAPTION ALIGN="BOTTOM"><STRONG>Figure 1:</STRONG> Adjacency Matrix Representation of a Directed Graph.</CAPTION>
<TR><TD><IMG SRC="./figs/adj-matrix-graph3.gif" width="386" height="284"></TD>
@@ -72,7 +72,7 @@
matrix representation of an undirected graph.
<P></P>
-<DIV ALIGN="center"><A NAME="fig:undir-adj-matrix-graph"></A><A NAME="1509"></A>
+<DIV ALIGN="center"><A NAME="fig:undir-adj-matrix-graph"></A>
<TABLE>
<CAPTION ALIGN="BOTTOM"><STRONG>Figure 1:</STRONG> Adjacency Matrix Representation of an Undirected Graph.</CAPTION>
<TR><TD><IMG SRC="./figs/undir-adj-matrix-graph3.gif" width="260" height="240"></TD>
Modified: branches/release/libs/graph/doc/bc_clustering.html
==============================================================================
--- branches/release/libs/graph/doc/bc_clustering.html (original)
+++ branches/release/libs/graph/doc/bc_clustering.html 2010-04-02 11:25:11 EDT (Fri, 02 Apr 2010)
@@ -61,7 +61,7 @@
<h2>Description</h2>
<p>This algorithm implements graph clustering based on edge
betweenness centrality. It is an iterative algorithm, where in each
-step it compute the edge betweenness centrality (via <a href=
+step it computes the edge betweenness centrality (via <a href=
"betweenness_centrality.html">brandes_betweenness_centrality</a>) and
removes the edge with the maximum betweenness centrality. The
<tt class="computeroutput">done</tt> function object determines
Modified: branches/release/libs/graph/doc/bellman_visitor.html
==============================================================================
--- branches/release/libs/graph/doc/bellman_visitor.html (original)
+++ branches/release/libs/graph/doc/bellman_visitor.html 2010-04-02 11:25:11 EDT (Fri, 02 Apr 2010)
@@ -22,7 +22,7 @@
</H1>
This class is an adapter that converts a list of <a
-href="./EventVisitor.html">EventVisitor</a>'s (constructed using
+href="./EventVisitor.html">EventVisitor</a>s (constructed using
<tt>std::pair</tt>) into a <a
href="./BellmanFordVisitor.html">BellmanFordVisitor</a>.
@@ -63,7 +63,7 @@
This class implements all of the member functions required by <a
href="./BellmanFordVisitor.html">BellmanFordVisitor</a>. In each function the
appropriate event is dispatched to the <a
-href="./EventVisitor.html">EventVisitor</a>'s in the EventVisitorList.
+href="./EventVisitor.html">EventVisitor</a> in the EventVisitorList.
<h3>Non-Member Functions</h3>
Modified: branches/release/libs/graph/doc/bfs_visitor.html
==============================================================================
--- branches/release/libs/graph/doc/bfs_visitor.html (original)
+++ branches/release/libs/graph/doc/bfs_visitor.html 2010-04-02 11:25:11 EDT (Fri, 02 Apr 2010)
@@ -22,7 +22,7 @@
</H1>
This class is an adapter that converts a list of <a
-href="./EventVisitor.html">EventVisitor</a>'s (constructed using
+href="./EventVisitor.html">EventVisitor</a>s (constructed using
<tt>std::pair</tt>) into a BFSVisitor.
@@ -80,7 +80,7 @@
This class implements all of the member functions required by <a
href="./BFSVisitor.html">BFSVisitor</a>. In each function the
appropriate event is dispatched to the <a
-href="./EventVisitor.html">EventVisitor</a>'s in the EventVisitorList.
+href="./EventVisitor.html">EventVisitor</a> in the EventVisitorList.
<h3>Non-Member Functions</h3>
Modified: branches/release/libs/graph/doc/biconnected_components.html
==============================================================================
--- branches/release/libs/graph/doc/biconnected_components.html (original)
+++ branches/release/libs/graph/doc/biconnected_components.html 2010-04-02 11:25:11 EDT (Fri, 02 Apr 2010)
@@ -239,6 +239,15 @@
contains an example of calculating the biconnected components and
articulation points of an undirected graph.
+<h3>Notes</h3>
+
+<p><a name="1">[1]</a>
+ Since the visitor parameter is passed by value, if your visitor
+ contains state then any changes to the state during the algorithm
+ will be made to a copy of the visitor object, not the visitor object
+ passed in. Therefore you may want the visitor to hold this state by
+ pointer or reference.
+
<br>
<HR>
<TABLE>
Modified: branches/release/libs/graph/doc/compressed_sparse_row.html
==============================================================================
--- branches/release/libs/graph/doc/compressed_sparse_row.html (original)
+++ branches/release/libs/graph/doc/compressed_sparse_row.html 2010-04-02 11:25:11 EDT (Fri, 02 Apr 2010)
@@ -224,7 +224,7 @@
edges_size_type num_edges(const compressed_sparse_row_graph&);
<i>// Vertex access</i>
-vertex_descriptor vertex(vertices_size_type i, const compressed_sparse_row_graph&);
+vertex_descriptor vertex(vertices_size_type i, const compressed_sparse_row_graph&);
<i>// Edge access</i>
std::pair<edge_descriptor, bool>
@@ -460,7 +460,7 @@
<hr></hr>
- <pre><a name="edge-const"></a>
+ <pre><a name="edge-multi-const"></a>
template<typename MultiPassInputIterator>
compressed_sparse_row_graph(edges_are_unsorted_multi_pass_t,
MultiPassInputIterator edge_begin, MultiPassInputIterator edge_end,
@@ -489,7 +489,7 @@
<hr></hr>
- <pre><a name="edge-prop-const"></a>
+ <pre><a name="edge-multi-prop-const"></a>
template<typename MultiPassInputIterator, typename EdgePropertyIterator>
compressed_sparse_row_graph(edges_are_unsorted_multi_pass_t,
MultiPassInputIterator edge_begin, MultiPassInputIterator edge_end,
@@ -624,7 +624,7 @@
<hr></hr>
- <pre><a name="#graph-const"></a>
+ <pre><a name="graph-const"></a>
template<typename Graph, typename VertexIndexMap>
compressed_sparse_row_graph(const Graph& g, const VertexIndexMap& vi,
vertices_size_type numverts,
@@ -713,7 +713,7 @@
<a name="vertex-access"></a><h3>Vertex access</h3>
- <pre><a name="vertex"></a>
+ <pre><a name="vertex-lookup"></a>
vertex_descriptor vertex(vertices_size_type i, const compressed_sparse_row_graph&);
</pre>
<p class="indent">
@@ -723,6 +723,8 @@
<hr></hr>
+ <a name="edge-access"></a><h3>Edge access</h3>
+
<pre><a name="edge"></a>
std::pair<edge_descriptor, bool>
edge(vertex_descriptor u, vertex_descriptor v, const compressed_sparse_row_graph&);
@@ -733,8 +735,10 @@
descriptor for that edge and <tt>true</tt>; otherwise, the
second value in the pair will be <tt>false</tt>. If multiple
edges exist from <tt>u</tt> to <tt>v</tt>, the first edge will
- be returned; use edge_range
- to retrieve all edges. This function requires linear time in the
+ be returned; use out_edges and a
+ conditional statement
+ to retrieve all edges to a given target. This function requires linear
+ time in the
number of edges outgoing from <tt>u</tt>.
</p>
Modified: branches/release/libs/graph/doc/dfs_visitor.html
==============================================================================
--- branches/release/libs/graph/doc/dfs_visitor.html (original)
+++ branches/release/libs/graph/doc/dfs_visitor.html 2010-04-02 11:25:11 EDT (Fri, 02 Apr 2010)
@@ -22,7 +22,7 @@
</H1>
This class is an adapter that converts a list of <a
-href="./EventVisitor.html">EventVisitor</a>'s (constructed using
+href="./EventVisitor.html">EventVisitor</a>s (constructed using
<tt>std::pair</tt>) into a DFSVisitor.
@@ -63,7 +63,7 @@
This class implements all of the member functions required by <a
href="./DFSVisitor.html">DFSVisitor</a>. In each function the
appropriate event is dispatched to the <a
-href="./EventVisitor.html">EventVisitor</a>'s in the EventVisitorList.
+href="./EventVisitor.html">EventVisitor</a> in the EventVisitorList.
<h3>Non-Member Functions</h3>
Modified: branches/release/libs/graph/doc/dijkstra_visitor.html
==============================================================================
--- branches/release/libs/graph/doc/dijkstra_visitor.html (original)
+++ branches/release/libs/graph/doc/dijkstra_visitor.html 2010-04-02 11:25:11 EDT (Fri, 02 Apr 2010)
@@ -22,7 +22,7 @@
</H1>
This class is an adapter that converts a list of <a
-href="./EventVisitor.html">EventVisitor</a>'s (constructed using
+href="./EventVisitor.html">EventVisitor</a>s (constructed using
<tt>std::pair</tt>) into a <a
href="./DijkstraVisitor.html">DijkstraVisitor</a>.
@@ -77,7 +77,7 @@
This class implements all of the member functions required by <a
href="./DijkstraVisitor.html">DijkstraVisitor</a>. In each
function the appropriate event is dispatched to the <a
-href="./EventVisitor.html">EventVisitor</a>'s in the EventVisitorList.
+href="./EventVisitor.html">EventVisitor</a> in the EventVisitorList.
<h3>Non-Member Functions</h3>
Modified: branches/release/libs/graph/doc/distance_recorder.html
==============================================================================
--- branches/release/libs/graph/doc/distance_recorder.html (original)
+++ branches/release/libs/graph/doc/distance_recorder.html 2010-04-02 11:25:11 EDT (Fri, 02 Apr 2010)
@@ -27,7 +27,7 @@
source vertex during a graph search. When applied to edge <i>e =
(u,v)</i>, the distance of <i>v</i> is recorded to be one more than
the distance of <i>u</i>. The distance recorder is typically used with
-the <tt>on_tree_edge</tt> or <tt>on_relax_edge</tt> events, and
+the <tt>on_tree_edge</tt> or <tt>on_relax_edge</tt> events and
cannot be used with vertex events.
<p>
@@ -64,7 +64,7 @@
<TR><TD><TT>DistanceMap</TT></TD>
<TD>
A <a
-href="../../property_map/doc/WritablePropertyMap.html">WritablePropertyMap</a>,
+href="../../property_map/doc/WritablePropertyMap.html">WritablePropertyMap</a>
where the key type and the value type are the vertex descriptor type
of the graph.
</TD>
Modified: branches/release/libs/graph/doc/graph_theory_review.html
==============================================================================
--- branches/release/libs/graph/doc/graph_theory_review.html (original)
+++ branches/release/libs/graph/doc/graph_theory_review.html 2010-04-02 11:25:11 EDT (Fri, 02 Apr 2010)
@@ -90,7 +90,7 @@
<P>
<P></P>
-<DIV ALIGN="center"><A NAME="fig:directed-graph"></A><A NAME="1509"></A>
+<DIV ALIGN="center"><A NAME="fig:directed-graph"></A>
<TABLE>
<CAPTION ALIGN="BOTTOM"><STRONG>Figure 1:</STRONG>
Example of a directed graph.</CAPTION>
@@ -558,7 +558,7 @@
vertex.
<P></P>
-<DIV ALIGN="center"><A NAME="fig:max-flow"></A><A NAME="1509"></A>
+<DIV ALIGN="center"><A NAME="fig:max-flow"></A>
<TABLE>
<CAPTION ALIGN="BOTTOM"><STRONG>Figure 8:</STRONG> A Maximum Flow
Network.<br> Edges are labeled with the flow and capacity
Modified: branches/release/libs/graph/doc/history.html
==============================================================================
--- branches/release/libs/graph/doc/history.html (original)
+++ branches/release/libs/graph/doc/history.html 2010-04-02 11:25:11 EDT (Fri, 02 Apr 2010)
@@ -76,7 +76,7 @@
<h2>Changes by version</h2>
<a name="by-version">
<ul>
- <a name="1.35.0"></a><li>Version 1.35.0<br><b>New algorithms and components</b>
+ <a name="1.36.0"></a><li>Version 1.36.0<br><b>New algorithms and components</b>
<ul>
<li>r_c_shortest_paths, resource-constrained shortest paths, from Michael Drexl.</li>
</ul>
Modified: branches/release/libs/graph/doc/maximum_matching.html
==============================================================================
--- branches/release/libs/graph/doc/maximum_matching.html (original)
+++ branches/release/libs/graph/doc/maximum_matching.html 2010-04-02 11:25:11 EDT (Fri, 02 Apr 2010)
@@ -27,7 +27,7 @@
bool checked_edmonds_maximum_cardinality_matching(const Graph& g, MateMap mate, VertexIndexMap vm);
</pre>
<p>
-<a name="sec:articulation_points">A <i>matching</i> is a subset of the edges
+<a name="sec:matching">A <i>matching</i> is a subset of the edges
of a graph such that no two edges share a common vertex.
Two different matchings in the same graph are illustrated below (edges in the
matching are colored blue.) The matching on the left is a <i>maximal matching</i>,
@@ -38,9 +38,9 @@
</a></p><p></p><center>
<table border="0">
<tr>
-<td><a name="sec:articulation_points"><img src="figs/maximal-match.png"></a></td>
+<td><a name="fig:maximal_matching"><img src="figs/maximal-match.png"></a></td>
<td width="150"></td>
-<td><a name="sec:articulation_points"><img src="figs/maximum-match.png"></a></td>
+<td><a name="fig:maximum_matching"><img src="figs/maximum-match.png"></a></td>
</tr>
</table>
</center>
Modified: branches/release/libs/graph/doc/planar_canonical_ordering.html
==============================================================================
--- branches/release/libs/graph/doc/planar_canonical_ordering.html (original)
+++ branches/release/libs/graph/doc/planar_canonical_ordering.html 2010-04-02 11:25:11 EDT (Fri, 02 Apr 2010)
@@ -82,6 +82,16 @@
<blockquote>
An undirected graph. The graph type must be a model of
<a href="VertexAndEdgeListGraph.html">VertexAndEdgeListGraph</a>.
+The graph must:
+<ul>
+<li>Be maximal planar.</li>
+<li>Have at least two vertices.</li>
+<li>Have the edge <i>{v<sub>0</sub>, v<sub>1</sub>}</i> on its outer face,
+where <i>v<sub>0</sub></i> is <tt>*vertices(g).first</tt> and
+<i>v<sub>1</sub></i> is the first element of
+<tt>adjacent_vertices(</tt><i>v<sub>0</sub></i><tt>, g)</tt> distinct from
+<i>v<sub>0</sub></i>.</li>
+</ul>
</blockquote>
IN: <tt>PlanarEmbedding</tt>
Modified: branches/release/libs/graph/doc/planar_graphs.html
==============================================================================
--- branches/release/libs/graph/doc/planar_graphs.html (original)
+++ branches/release/libs/graph/doc/planar_graphs.html 2010-04-02 11:25:11 EDT (Fri, 02 Apr 2010)
@@ -88,7 +88,7 @@
the (unbounded) region outside the triangle. The unbounded region outside the
graph's embedding is called the <i>outer face</i>. Every embedding yields
one outer face and zero or more inner faces. A famous result called
-<a name="EulersFormula">Euler's formula</a> states that for any
+Euler's formula states that for any
planar graph with <i>n</i> vertices, <i>e</i> edges, <i>f</i> faces, and
<i>c</i> connected components,
<a name="EulersFormula">
Modified: branches/release/libs/graph/doc/predecessor_recorder.html
==============================================================================
--- branches/release/libs/graph/doc/predecessor_recorder.html (original)
+++ branches/release/libs/graph/doc/predecessor_recorder.html 2010-04-02 11:25:11 EDT (Fri, 02 Apr 2010)
@@ -27,7 +27,7 @@
recording the predecessors is an efficient way to encode the search
tree that was traversed during the search. The predecessor recorder is
typically used with the <tt>on_tree_edge</tt> or
-<tt>on_relax_edge</tt> events, and cannot be used with vertex events.
+<tt>on_relax_edge</tt> events and cannot be used with vertex events.
<p>
<tt>predecessor_recorder</tt> can be used with graph algorithms by
@@ -40,12 +40,12 @@
<p>
Algorithms such as Dijkstra's and breadth-first search will not assign
a predecessor to the source vertex (which is the root of the search
-tree). Often times it is useful to initialize the source vertex's
+tree). It is often useful to initialize the source vertex's
predecessor to itself, thereby identifying the root vertex as the only
vertex which is its own parent. When using an algorithm like
-depth-first search that creates a forest (multiple search trees), it
-is useful to intialize the predecessor of every vertex to itself, so
-that all the root nodes can be distinguished.
+depth-first search that creates a forest (multiple search trees) it
+is useful to intialize the predecessor of every vertex to itself. This
+way all the root nodes can be distinguished.
<h3>Example</h3>
@@ -74,7 +74,7 @@
<TR><TD><TT>PredecessorMap</TT></TD>
<TD>
A <a
-href="../../property_map/doc/WritablePropertyMap.html">WritablePropertyMap</a>,
+href="../../property_map/doc/WritablePropertyMap.html">WritablePropertyMap</a>
where the key type and the value type are the vertex descriptor type
of the graph.
</TD>
Modified: branches/release/libs/graph/doc/property_writer.html
==============================================================================
--- branches/release/libs/graph/doc/property_writer.html (original)
+++ branches/release/libs/graph/doc/property_writer.html 2010-04-02 11:25:11 EDT (Fri, 02 Apr 2010)
@@ -27,7 +27,7 @@
<p>
<tt>property_writer</tt> can be used with graph algorithms by
-wrapping it with the algorithm specific adaptor, such as <a
+wrapping it with the algorithm-specific adaptor, such as <a
href="./bfs_visitor.html"><tt>bfs_visitor</tt></a> and <a
href="./dfs_visitor.html"><tt>dfs_visitor</tt></a>. Also, this event
visitor can be combined with other event visitors using
@@ -74,9 +74,9 @@
<TR><TD><TT>PropertyMap</TT></TD>
<TD>
A <a
-href="../../property_map/doc/ReadablePropertyMap.html">ReadablePropertyMap</a>,
+href="../../property_map/doc/ReadablePropertyMap.html">ReadablePropertyMap</a>
where the <tt>key_type</tt> is the vertex descriptor type or edge
-descriptor of the graph (depending on the kind of event tag), and
+descriptor of the graph (depending on the kind of event tag) and
the <tt>value_type</tt> of the property is convertible
to the <tt>value_type</tt> of the <tt>OutputIterator</tt>.
</TD>
@@ -145,7 +145,7 @@
void operator()(X x, const Graph& g);
</tt></td>
<td>
-This writs the property value for <tt>x</tt> to the output iterator.<br>
+This writes the property value for <tt>x</tt> to the output iterator.<br>
<tt>*out++ = get(pa, x);</tt>
</td>
</tr>
Modified: branches/release/libs/graph/doc/random_layout.html
==============================================================================
--- branches/release/libs/graph/doc/random_layout.html (original)
+++ branches/release/libs/graph/doc/random_layout.html 2010-04-02 11:25:11 EDT (Fri, 02 Apr 2010)
@@ -82,7 +82,7 @@
<blockquote>
A random number generator that will be used to place vertices. The
type <tt>RandomNumberGenerator</tt> must model the <a
-href="../../random/random-concepts.html#number_generator">NumberGenerator</a>
+href="../../random/doc/html/boost_random/reference.html#boost_random.reference.concepts.number_generator">NumberGenerator</a>
concept.
</blockquote>
Modified: branches/release/libs/graph/doc/table_of_contents.html
==============================================================================
--- branches/release/libs/graph/doc/table_of_contents.html (original)
+++ branches/release/libs/graph/doc/table_of_contents.html 2010-04-02 11:25:11 EDT (Fri, 02 Apr 2010)
@@ -93,6 +93,7 @@
<LI>distance_recorder
<LI>time_stamper
<LI>property_writer
+ <LI>property_put
<li>tsp_tour_visitor</li>
<li>tsp_tour_len_visitor</li>
</OL>
@@ -264,6 +265,8 @@
<ol>
<li>metric_tsp_approx</li>
<LI>sequential_vertex_coloring
+ <LI>is_bipartite (including two-coloring of bipartite graphs)
+ <LI>find_odd_cycle
</ol>
</li>
Modified: branches/release/libs/graph/doc/time_stamper.html
==============================================================================
--- branches/release/libs/graph/doc/time_stamper.html (original)
+++ branches/release/libs/graph/doc/time_stamper.html 2010-04-02 11:25:11 EDT (Fri, 02 Apr 2010)
@@ -74,9 +74,9 @@
<TR><TD><TT>TimeMap</TT></TD>
<TD>
A <a
-href="../../property_map/doc/WritablePropertyMap.html">WritablePropertyMap</a>,
+href="../../property_map/doc/WritablePropertyMap.html">WritablePropertyMap</a>
where the <tt>key_type</tt> is the vertex descriptor type or edge
-descriptor of the graph (depending on the kind of event tag), and
+descriptor of the graph (depending on the kind of event tag) and
where the <tt>TimeT</tt> type is convertible to the
<tt>value_type</tt> of the time property map.
</TD>
@@ -85,7 +85,7 @@
<TR><TD><TT>TimeT</TT></TD>
<TD>
-The type for the time counter, which should be convertible to the
+The type for the time counter which should be convertible to the
<tt>value_type</tt> of the time property map
</TD>
<TD> </TD>
Modified: branches/release/libs/graph/doc/tsp_tour_len_visitor.html
==============================================================================
--- branches/release/libs/graph/doc/tsp_tour_len_visitor.html (original)
+++ branches/release/libs/graph/doc/tsp_tour_len_visitor.html 2010-04-02 11:25:11 EDT (Fri, 02 Apr 2010)
@@ -102,7 +102,7 @@
tsp_tour_len_visitor<OutputIterator><br>
make_tsp_tour_len_visitor(Graph const& g, OutIter iter, Length& l, WeightMap map)
</tt></td><td>
-Returns a tour_len_visitor that records the TSP tour in the OutputIterator parameter and the tour's length in the Length parameter.
+Returns a tour_len_visitor that records the TSP tour in the OutputIterator parameter and the length of the tour in the Length parameter.
</td></tr>
</table>
Modified: branches/release/libs/graph/doc/visitor_concepts.html
==============================================================================
--- branches/release/libs/graph/doc/visitor_concepts.html (original)
+++ branches/release/libs/graph/doc/visitor_concepts.html 2010-04-02 11:25:11 EDT (Fri, 02 Apr 2010)
@@ -40,6 +40,8 @@
<li> Bellman Ford Visitor
<li> A* Visitor
<li> Event Visitor
+ <li> Planar Face Visitor
+ <li> TSP Tour Visitor
</ul>
Modified: branches/release/libs/graph/example/Jamfile.v2
==============================================================================
--- branches/release/libs/graph/example/Jamfile.v2 (original)
+++ branches/release/libs/graph/example/Jamfile.v2 2010-04-02 11:25:11 EDT (Fri, 02 Apr 2010)
@@ -20,3 +20,4 @@
exe bron_kerbosch_clique_number : bron_kerbosch_clique_number.cpp ;
exe mcgregor_subgraphs_example : mcgregor_subgraphs_example.cpp ;
exe grid_graph_example : grid_graph_example.cpp ;
+exe bipartite_example : bipartite_example.cpp ;
Modified: branches/release/libs/graph/src/graphml.cpp
==============================================================================
--- branches/release/libs/graph/src/graphml.cpp (original)
+++ branches/release/libs/graph/src/graphml.cpp 2010-04-02 11:25:11 EDT (Fri, 02 Apr 2010)
@@ -13,6 +13,7 @@
#define BOOST_GRAPH_SOURCE
#include <boost/foreach.hpp>
#include <boost/optional.hpp>
+#include <boost/throw_exception.hpp>
#include <boost/graph/graphml.hpp>
#include <boost/graph/dll_import_export.hpp>
#include <boost/property_tree/ptree.hpp>
@@ -62,7 +63,7 @@
else if (for_ == "port") kind = port_key;
else if (for_ == "endpoint") kind = endpoint_key;
else if (for_ == "all") kind = all_key;
- else throw parse_error("Attribute for is not valid: " + for_);
+ else {BOOST_THROW_EXCEPTION(parse_error("Attribute for is not valid: " + for_));}
m_keys[id] = kind;
m_key_name[id] = name;
m_key_type[id] = type;
@@ -97,7 +98,11 @@
std::string local_directed = edge.second.get(path("<xmlattr>/directed"), "");
bool is_directed = (local_directed == "" ? default_directed : local_directed == "true");
if (is_directed != m_g.is_directed()) {
- if (is_directed) throw directed_graph_error(); else throw undirected_graph_error();
+ if (is_directed) {
+ BOOST_THROW_EXCEPTION(directed_graph_error());
+ } else {
+ BOOST_THROW_EXCEPTION(undirected_graph_error());
+ }
}
size_t old_edges_size = m_edge.size();
handle_edge(source, target);
@@ -164,8 +169,9 @@
any edge;
bool added;
tie(edge, added) = m_g.do_add_edge(source, target);
- if (!added)
- throw bad_parallel_edge(u, v);
+ if (!added) {
+ BOOST_THROW_EXCEPTION(bad_parallel_edge(u, v));
+ }
size_t e = m_edge.size();
m_edge.push_back(edge);
Modified: branches/release/libs/graph/src/read_graphviz_new.cpp
==============================================================================
--- branches/release/libs/graph/src/read_graphviz_new.cpp (original)
+++ branches/release/libs/graph/src/read_graphviz_new.cpp 2010-04-02 11:25:11 EDT (Fri, 02 Apr 2010)
@@ -793,7 +793,7 @@
namespace detail {
namespace graph {
- BOOST_GRAPH_DECL bool read_graphviz(const std::string& str, boost::detail::graph::mutate_graph* mg) {
+ BOOST_GRAPH_DECL bool read_graphviz_new(const std::string& str, boost::detail::graph::mutate_graph* mg) {
read_graphviz_detail::parser_result parsed_file;
read_graphviz_detail::parse_graphviz_from_string(str, parsed_file, mg->is_directed());
read_graphviz_detail::translate_results_to_graph(parsed_file, mg);
Deleted: branches/release/libs/graph/src/read_graphviz_spirit.cpp
==============================================================================
--- branches/release/libs/graph/src/read_graphviz_spirit.cpp 2010-04-02 11:25:11 EDT (Fri, 02 Apr 2010)
+++ (empty file)
@@ -1,47 +0,0 @@
-// Copyright 2004-5 Trustees of Indiana University
-
-// Use, modification and distribution is subject to 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)
-
-//
-// read_graphviz_spirit.hpp -
-// Initialize a model of the BGL's MutableGraph concept and an associated
-// collection of property maps using a graph expressed in the GraphViz
-// DOT Language.
-//
-// Based on the grammar found at:
-// http://www.graphviz.org/cvs/doc/info/lang.html
-//
-// See documentation for this code at:
-// http://www.boost.org/libs/graph/doc/read-graphviz.html
-//
-
-// Authors: Ronald Garcia and Douglas Gregor
-//
-
-#define BOOST_GRAPH_SOURCE
-
-#ifndef BOOST_GRAPH_READ_GRAPHVIZ_ITERATORS
-# define BOOST_GRAPH_READ_GRAPHVIZ_ITERATORS
-#endif
-#include <boost/graph/graphviz.hpp>
-#include <iostream>
-
-namespace boost { namespace detail { namespace graph {
-
-#if 0
-BOOST_GRAPH_DECL
-bool read_graphviz(std::istream& in, mutate_graph& graph)
-{
- using namespace boost;
-
- typedef std::istream_iterator<char> is_t;
-
- std::string str((is_t(in)), is_t());
-
- return read_graphviz(str.begin(), str.end());
-}
-#endif
-
-} } } // end namespace boost::detail::graph
Modified: branches/release/libs/graph/test/Jamfile.v2
==============================================================================
--- branches/release/libs/graph/test/Jamfile.v2 (original)
+++ branches/release/libs/graph/test/Jamfile.v2 2010-04-02 11:25:11 EDT (Fri, 02 Apr 2010)
@@ -36,6 +36,7 @@
[ run bellman-test.cpp ]
[ run betweenness_centrality_test.cpp : 100 ]
[ run bidir_remove_edge.cpp ]
+ [ run bipartite_test.cpp ]
[ run csr_graph_test.cpp : : : : : <variant>release ]
[ run dag_longest_paths.cpp ]
[ run dfs.cpp ../../test/build//boost_test_exec_monitor ]
@@ -53,7 +54,7 @@
[ run graphviz_test.cpp
/boost/test//boost_test_exec_monitor/<link>static
../build//boost_graph
- ../../regex/build//boost_regex ]
+ ../../regex/build//boost_regex : --log_level=all ]
[ run metis_test.cpp : $(METIS_INPUT_FILE) ]
[ run gursoy_atun_layout_test.cpp ]
[ run layout_test.cpp : : : <test-info>always_show_run_output <toolset>intel:<debug-symbols>off ]
Modified: branches/release/libs/graph/test/csr_graph_test.cpp
==============================================================================
--- branches/release/libs/graph/test/csr_graph_test.cpp (original)
+++ branches/release/libs/graph/test/csr_graph_test.cpp 2010-04-02 11:25:11 EDT (Fri, 02 Apr 2010)
@@ -19,6 +19,7 @@
#include <boost/graph/erdos_renyi_generator.hpp>
#include <boost/graph/graph_utility.hpp>
#include <boost/random/linear_congruential.hpp>
+#include <boost/concept_check.hpp> // for ignore_unused_variable_warning
#include <cassert>
#include <iostream>
#include <vector>
@@ -43,10 +44,15 @@
int index;
};
-typedef boost::compressed_sparse_row_graph<boost::directedS, VertexData>
+struct EdgeData
+{
+ int index_e;
+};
+
+typedef boost::compressed_sparse_row_graph<boost::directedS, VertexData, EdgeData>
CSRGraphT;
-typedef boost::compressed_sparse_row_graph<boost::bidirectionalS, VertexData>
+typedef boost::compressed_sparse_row_graph<boost::bidirectionalS, VertexData, EdgeData>
BidirCSRGraphT;
template <class G1, class VI1, class G2, class VI2, class IsomorphismMap>
@@ -423,6 +429,27 @@
std::cout << "Testing CSR graph built from unsorted edges" << std::endl;
std::pair<int, int> 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)};
CSRGraphT g(boost::edges_are_unsorted, unsorted_edges, unsorted_edges + sizeof(unsorted_edges) / sizeof(*unsorted_edges), 6);
+
+ // Test vertex and edge bundle access
+ boost::ignore_unused_variable_warning(
+ (VertexData&)get(get(boost::vertex_bundle, g), vertex(0, g)));
+ boost::ignore_unused_variable_warning(
+ (const VertexData&)get(get(boost::vertex_bundle, (const CSRGraphT&)g), vertex(0, g)));
+ boost::ignore_unused_variable_warning(
+ (VertexData&)get(boost::vertex_bundle, g, vertex(0, g)));
+ boost::ignore_unused_variable_warning(
+ (const VertexData&)get(boost::vertex_bundle, (const CSRGraphT&)g, vertex(0, g)));
+ put(boost::vertex_bundle, g, vertex(0, g), VertexData());
+ boost::ignore_unused_variable_warning(
+ (EdgeData&)get(get(boost::edge_bundle, g), *edges(g).first));
+ boost::ignore_unused_variable_warning(
+ (const EdgeData&)get(get(boost::edge_bundle, (const CSRGraphT&)g), *edges(g).first));
+ boost::ignore_unused_variable_warning(
+ (EdgeData&)get(boost::edge_bundle, g, *edges(g).first));
+ boost::ignore_unused_variable_warning(
+ (const EdgeData&)get(boost::edge_bundle, (const CSRGraphT&)g, *edges(g).first));
+ put(boost::edge_bundle, g, *edges(g).first, EdgeData());
+
CSRGraphT g2(boost::edges_are_unsorted_multi_pass, unsorted_edges, unsorted_edges + sizeof(unsorted_edges) / sizeof(*unsorted_edges), 6);
graph_test(g);
graph_test(g2);
@@ -439,7 +466,7 @@
// Test building a graph using add_edges on unsorted lists
CSRGraphT g3(boost::edges_are_unsorted, unsorted_edges, unsorted_edges, 6); // Empty range
add_edges(unsorted_edges, unsorted_edges + 3, g3);
- boost::no_property edge_data[3];
+ EdgeData edge_data[3];
add_edges(unsorted_edges + 3, unsorted_edges + 6, edge_data, edge_data + 3, g3);
graph_test(g3);
assert_graphs_equal(g, boost::identity_property_map(),
Modified: branches/release/libs/graph/test/graphviz_test.cpp
==============================================================================
--- branches/release/libs/graph/test/graphviz_test.cpp (original)
+++ branches/release/libs/graph/test/graphviz_test.cpp 2010-04-02 11:25:11 EDT (Fri, 02 Apr 2010)
@@ -194,7 +194,7 @@
gs_t gs("graph { a nodE [mass = 7.7] c e [mass = 6.66] }");
try {
test_graph<directedS,vecS>(gs,3,masses,weight_map_t());
- BOOST_ERROR("Failed to throw boost::directed_graph_error.");
+ BOOST_ERROR("Failed to throw boost::undirected_graph_error.");
} catch (boost::undirected_graph_error&) {}
}
Modified: branches/release/libs/graph/test/metric_tsp_approx.cpp
==============================================================================
--- branches/release/libs/graph/test/metric_tsp_approx.cpp (original)
+++ branches/release/libs/graph/test/metric_tsp_approx.cpp 2010-04-02 11:25:11 EDT (Fri, 02 Apr 2010)
@@ -92,8 +92,8 @@
typedef vector< Vertex > Container;
mt19937 rng(time(0));
- uniform_int<> range(0.01, (numpts * 2));
- variate_generator<mt19937&, uniform_int<> >
+ uniform_real<> range(0.01, (numpts * 2));
+ variate_generator<mt19937&, uniform_real<> >
pnt_gen(rng, range);
PointSet points;
Modified: branches/release/libs/graph_parallel/test/distributed_connected_components_test.cpp
==============================================================================
--- branches/release/libs/graph_parallel/test/distributed_connected_components_test.cpp (original)
+++ branches/release/libs/graph_parallel/test/distributed_connected_components_test.cpp 2010-04-02 11:25:11 EDT (Fri, 02 Apr 2010)
@@ -98,7 +98,7 @@
// erdos_renyi_iterator<minstd_rand, Graph>(),
// n, pg, distrib);
- int m = n * n * _p/2;
+ int m = int(n * n * _p/2);
double a = 0.57, b = 0.19, c = 0.19, d = 0.05;
// Last boolean parameter makes R-MAT bidirectional
Modified: branches/release/libs/graph_parallel/test/distributed_csr_algorithm_test.cpp
==============================================================================
--- branches/release/libs/graph_parallel/test/distributed_csr_algorithm_test.cpp (original)
+++ branches/release/libs/graph_parallel/test/distributed_csr_algorithm_test.cpp 2010-04-02 11:25:11 EDT (Fri, 02 Apr 2010)
@@ -243,7 +243,7 @@
make_generator_iterator(gen, uniform_int<int>(0, C)),
n);
Digraph g2(SWIter(gen, n, k, prob), SWIter(), n);
- Digraph g3(RMATIter(gen, n, (n*n*prob), a, b, c, d), RMATIter(), n);
+ Digraph g3(RMATIter(gen, n, size_t(n*n*prob), a, b, c, d), RMATIter(), n);
// Test BFS
breadth_first_search(g, vertex(0, g), visitor(bfs_visitor<>()));
Modified: branches/release/libs/property_map/doc/dynamic_property_map.html
==============================================================================
--- branches/release/libs/property_map/doc/dynamic_property_map.html (original)
+++ branches/release/libs/property_map/doc/dynamic_property_map.html 2010-04-02 11:25:11 EDT (Fri, 02 Apr 2010)
@@ -1,24 +1,23 @@
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<!-- Copyright 2004-5 The Trustees of Indiana University.
-
- Use, modification and distribution is subject to 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)
--->
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<meta name="generator" content="Docutils 0.3.8: http://docutils.sourceforge.net/" />
+<meta name="generator" content="Docutils 0.6: http://docutils.sourceforge.net/" />
<title>Boost Dynamic Property Maps</title>
-<link rel="stylesheet" href="../../../boost.css" type="text/css" />
+<link rel="stylesheet" href="../../parameter/doc/html/rst.css" type="text/css" />
</head>
<body>
<div class="document" id="logo-dynamic-property-maps">
-<h1 class="title"><a class="reference" href="../../../index.htm"><img align="middle" alt="Boost" src="../../../boost.png" /></a> Dynamic Property Maps</h1>
+<h1 class="title"><a class="reference external" href="../../../index.htm"><img align="middle" alt="Boost" class="align-middle" src="../../../boost.png" /></a> Dynamic Property Maps</h1>
+
+<!-- Copyright 2004-5 The Trustees of Indiana University.
+
+Use, modification and distribution is subject to 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) -->
<div class="section" id="summary">
-<h1><a class="toc-backref" href="#id2" name="summary">Summary</a></h1>
+<h1><a class="toc-backref" href="#id2">Summary</a></h1>
<p>The dynamic property map interfaces provides access to a collection of
property maps through a dynamically-typed interface. An algorithm can
use it to manipulate property maps without knowing their key or
@@ -26,26 +25,26 @@
maps to interface more easily and completely with scripting languages
and other text-based representations of key-value data.</p>
<div class="contents topic" id="contents">
-<p class="topic-title first"><a name="contents">Contents</a></p>
+<p class="topic-title first">Contents</p>
<ul class="simple">
-<li><a class="reference" href="#summary" id="id2" name="id2">Summary</a></li>
-<li><a class="reference" href="#introduction" id="id3" name="id3">Introduction</a><ul>
-<li><a class="reference" href="#fred-s-info-revisited" id="id4" name="id4">"Fred's Info" Revisited</a></li>
+<li><a class="reference internal" href="#summary" id="id2">Summary</a></li>
+<li><a class="reference internal" href="#introduction" id="id3">Introduction</a><ul>
+<li><a class="reference internal" href="#fred-s-info-revisited" id="id4">"Fred's Info" Revisited</a></li>
</ul>
</li>
-<li><a class="reference" href="#reference" id="id5" name="id5">Reference</a><ul>
-<li><a class="reference" href="#member-functions" id="id6" name="id6">Member Functions</a></li>
-<li><a class="reference" href="#free-functions" id="id7" name="id7">Free functions</a></li>
-<li><a class="reference" href="#exceptions" id="id8" name="id8">Exceptions</a></li>
+<li><a class="reference internal" href="#reference" id="id5">Reference</a><ul>
+<li><a class="reference internal" href="#member-functions" id="id6">Member Functions</a></li>
+<li><a class="reference internal" href="#free-functions" id="id7">Free functions</a></li>
+<li><a class="reference internal" href="#exceptions" id="id8">Exceptions</a></li>
</ul>
</li>
</ul>
</div>
</div>
<div class="section" id="introduction">
-<h1><a class="toc-backref" href="#id3" name="introduction">Introduction</a></h1>
+<h1><a class="toc-backref" href="#id3">Introduction</a></h1>
<p>The Boost Property Map library specifies statically type-safe
-interfaces through which key-value pairs can be manipulated by
+interfaces through which key-value pairs can be manipulated by
generic algorithms. Typically, an algorithm that uses property maps is
parameterized on the types of the property maps it uses, and it
manipulates them using the interfaces specified by the
@@ -53,7 +52,7 @@
<p>The following generic function illustrates property map basics.</p>
<pre class="literal-block">
template <typename AgeMap, typename GPAMap>
-void
+void
manipulate_freds_info(AgeMap ages, GPAMap gpas) {
typedef typename boost::property_traits<AgeMap>::key_type name_type;
@@ -115,7 +114,7 @@
meet the requirements of the underlying property map or signals a
runtime exception if it cannot.</p>
<div class="section" id="fred-s-info-revisited">
-<h2><a class="toc-backref" href="#id4" name="fred-s-info-revisited">"Fred's Info" Revisited</a></h2>
+<h2><a class="toc-backref" href="#id4">"Fred's Info" Revisited</a></h2>
<p>Here's what the example above looks like using the
<tt class="docutils literal"><span class="pre">dynamic_properties</span></tt> interface:</p>
<pre class="literal-block">
@@ -173,7 +172,7 @@
manipulate_freds_info(properties);
std::cout << "Fred's age: " << get(age_map,fred) << "\n"
- << "Fred's gpa: " << get(gpa_map,fred) << "\n";
+ << "Fred's gpa: " << get(gpa_map,fred) << "\n";
}
</pre>
<p>The code first creates two property maps using <tt class="docutils literal"><span class="pre">std::map</span></tt> and the
@@ -189,7 +188,7 @@
</div>
</div>
<div class="section" id="reference">
-<h1><a class="toc-backref" href="#id5" name="reference">Reference</a></h1>
+<h1><a class="toc-backref" href="#id5">Reference</a></h1>
<pre class="literal-block">
class dynamic_properties
</pre>
@@ -198,27 +197,27 @@
an object of this class with property maps using the <tt class="docutils literal"><span class="pre">property</span></tt> member
function.</p>
<div class="section" id="member-functions">
-<h2><a class="toc-backref" href="#id6" name="member-functions">Member Functions</a></h2>
+<h2><a class="toc-backref" href="#id6">Member Functions</a></h2>
<pre class="literal-block">
dynamic_properties()
dynamic_properties(
const boost::function<
- std::auto_ptr<dynamic_property_map> (
+ boost::shared_ptr<dynamic_property_map> (
const std::string&, const boost::any&, const boost::any&)
>& fn)
</pre>
<p>A <tt class="docutils literal"><span class="pre">dynamic_properties</span></tt> object can be constructed with a function object
-that, when called, creates a new property map. The library provides the
+that, when called, creates a new property map. The library provides the
<tt class="docutils literal"><span class="pre">ignore_other_properties</span></tt> function object, which lets the <tt class="docutils literal"><span class="pre">dynamic_properties</span></tt> object ignore any properties that it hasn't been prepared to record.
If an attempt is made
to <tt class="docutils literal"><span class="pre">put</span></tt> a key-value pair to a nonexistent <tt class="docutils literal"><span class="pre">dynamic_properties</span></tt> key,
then this function is called with the <tt class="docutils literal"><span class="pre">dynamic_properties</span></tt> key and the
intended property key and value . If <tt class="docutils literal"><span class="pre">dynamic_properties</span></tt> is
-default-constructed, such a <tt class="docutils literal"><span class="pre">put</span></tt> attempt throws
+default-constructed, such a <tt class="docutils literal"><span class="pre">put</span></tt> attempt throws
<tt class="docutils literal"><span class="pre">property_not_found</span></tt>.</p>
<pre class="literal-block">
template<typename PropertyMap>
-dynamic_properties&
+dynamic_properties&
property(const std::string& name, PropertyMap property_map)
</pre>
<p>This member function adds a property map to the set of maps contained,
@@ -226,7 +225,7 @@
<p>Requirements: <tt class="docutils literal"><span class="pre">PropertyMap</span></tt> must model Readable Property Map or
Read/Write Property Map.</p>
<pre class="literal-block">
-void insert(const std::string& name, std::auto_ptr<dynamic_property_map> pm)
+void insert(const std::string& name, boost::shared_ptr<dynamic_property_map> pm)
</pre>
<p>This member function directly adds a <tt class="docutils literal"><span class="pre">dynamic_property_map</span></tt>
to the collection, using <tt class="docutils literal"><span class="pre">name</span></tt> as its key.</p>
@@ -244,29 +243,29 @@
dynamic property maps held by the <tt class="docutils literal"><span class="pre">dynamic_properties</span></tt> object. It is used to
terminate traversals over the set of dynamic property maps</p>
<pre class="literal-block">
-iterator lower_bound(const std::string& name)
+iterator lower_bound(const std::string& name)
</pre>
<p>This member function returns an iterator that points to the first
-property map whose <tt class="docutils literal"><span class="pre">dynamic_properties</span></tt> key is <tt class="docutils literal"><span class="pre">name</span></tt>.
+property map whose <tt class="docutils literal"><span class="pre">dynamic_properties</span></tt> key is <tt class="docutils literal"><span class="pre">name</span></tt>.
Bear in mind that multiple property maps may have the same
<tt class="docutils literal"><span class="pre">dynamic_properties</span></tt> key, so long as their property map key types differ.</p>
<p>Invariant: The range [ lower_bound(name), end() ) contains every
property map that has name for its <tt class="docutils literal"><span class="pre">dynamic_properties</span></tt> key.</p>
</div>
<div class="section" id="free-functions">
-<h2><a class="toc-backref" href="#id7" name="free-functions">Free functions</a></h2>
+<h2><a class="toc-backref" href="#id7">Free functions</a></h2>
<pre class="literal-block">
-std::auto_ptr<boost::dynamic_property_map>
+boost::shared_ptr<boost::dynamic_property_map>
ignore_other_properties(const std::string&,
- const boost::any&,
- const boost::any&)
+ const boost::any&,
+ const boost::any&)
</pre>
<p>When passed to the <tt class="docutils literal"><span class="pre">dynamic_properties</span></tt> constructor, this function
allows the <tt class="docutils literal"><span class="pre">dynamic_properties</span></tt> object to disregard attempts to put
values to unknown keys without signaling an error.</p>
<pre class="literal-block">
template<typename Key, typename Value>
-bool put(const std::string& name, dynamic_properties& dp, const Key& key,
+bool put(const std::string& name, dynamic_properties& dp, const Key& key,
const Value& value)
</pre>
<p>This function adds a key-value pair to the property map with the
@@ -275,7 +274,7 @@
a property map generator was supplied when the <tt class="docutils literal"><span class="pre">dynamic_properties</span></tt>
object was constructed, then that function is used to create a new
property map. If the generator fails to generate a property map
-(returns a null <tt class="docutils literal"><span class="pre">auto_ptr</span></tt>), then the <tt class="docutils literal"><span class="pre">put</span></tt> function returns
+(returns a null <tt class="docutils literal"><span class="pre">shared_ptr</span></tt>), then the <tt class="docutils literal"><span class="pre">put</span></tt> function returns
<tt class="docutils literal"><span class="pre">false</span></tt>. If, on the other hand, the <tt class="docutils literal"><span class="pre">dynamic_properties</span></tt> object
has no property map generator (meaning it was default-constructed),
then <tt class="docutils literal"><span class="pre">property_not_found</span></tt> is thrown. If a candidate property map is
@@ -283,7 +282,7 @@
thrown.</p>
<pre class="literal-block">
template<typename Value, typename Key>
-Value get(const std::string& name, const dynamic_properties& dp,
+Value get(const std::string& name, const dynamic_properties& dp,
const Key& key)
</pre>
<p>This function gets the value from the property-map whose namee is
@@ -308,7 +307,7 @@
2) For this expression to be valid, the key must be
associated with some value, otherwise the result is undefined.</p>
<pre class="literal-block">
-std::string get_string(const any& key)
+std::string get_string(const any& key)
</pre>
<p>Given a representation of a key, return the string representation
of the value associated with that key.</p>
@@ -319,7 +318,7 @@
associated with some value, otherwise the result is undefined.
3) The value type of the property map must model Output Streamable.</p>
<pre class="literal-block">
-void put(const any& key, const any& value)
+void put(const any& key, const any& value)
</pre>
<p>Given a representation of a key and a representation of a value, the
key and value are associated in the property map.</p>
@@ -332,16 +331,16 @@
case an error will be signaled. This is the runtime analogue of the
Readable Property Map concept.</p>
<pre class="literal-block">
-const std::type_info& key() const
+const std::type_info& key() const
</pre>
<p>Returns a <tt class="docutils literal"><span class="pre">type_info</span></tt> object that represents the property map's key type.</p>
<pre class="literal-block">
-const std::type_info& value() const
+const std::type_info& value() const
</pre>
<p>Returns a <tt class="docutils literal"><span class="pre">type_info</span></tt> object that represents the property map's value type.</p>
</div>
<div class="section" id="exceptions">
-<h2><a class="toc-backref" href="#id8" name="exceptions">Exceptions</a></h2>
+<h2><a class="toc-backref" href="#id8">Exceptions</a></h2>
<pre class="literal-block">
struct dynamic_property_exception : public std::exception {
virtual ~dynamic_property_exception() throw() {}
@@ -380,9 +379,11 @@
</div>
</div>
</div>
-<hr class="docutils footer" />
<div class="footer">
-Generated on: 2007-06-20 16:36 UTC.
+<hr class="footer" />
+Generated on: 2010-03-29 18:04 UTC.
+Generated by <a class="reference external" href="http://docutils.sourceforge.net/">Docutils</a> from <a class="reference external" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> source.
+
</div>
</body>
</html>
Modified: branches/release/libs/property_map/doc/dynamic_property_map.rst
==============================================================================
--- branches/release/libs/property_map/doc/dynamic_property_map.rst (original)
+++ branches/release/libs/property_map/doc/dynamic_property_map.rst 2010-04-02 11:25:11 EDT (Fri, 02 Apr 2010)
@@ -204,7 +204,7 @@
dynamic_properties()
dynamic_properties(
const boost::function<
- std::auto_ptr<dynamic_property_map> (
+ boost::shared_ptr<dynamic_property_map> (
const std::string&, const boost::any&, const boost::any&)
>& fn)
@@ -233,7 +233,7 @@
::
- void insert(const std::string& name, std::auto_ptr<dynamic_property_map> pm)
+ void insert(const std::string& name, boost::shared_ptr<dynamic_property_map> pm)
This member function directly adds a ``dynamic_property_map``
to the collection, using ``name`` as its key.
@@ -272,10 +272,10 @@
::
- std::auto_ptr<boost::dynamic_property_map>
+ boost::shared_ptr<boost::dynamic_property_map>
ignore_other_properties(const std::string&,
- const boost::any&,
- const boost::any&)
+ const boost::any&,
+ const boost::any&)
When passed to the ``dynamic_properties`` constructor, this function
allows the ``dynamic_properties`` object to disregard attempts to put
@@ -293,7 +293,7 @@
a property map generator was supplied when the ``dynamic_properties``
object was constructed, then that function is used to create a new
property map. If the generator fails to generate a property map
-(returns a null ``auto_ptr``), then the ``put`` function returns
+(returns a null ``shared_ptr``), then the ``put`` function returns
``false``. If, on the other hand, the ``dynamic_properties`` object
has no property map generator (meaning it was default-constructed),
then ``property_not_found`` is thrown. If a candidate property map is
Modified: branches/release/libs/property_map/test/dynamic_properties_test.cpp
==============================================================================
--- branches/release/libs/property_map/test/dynamic_properties_test.cpp (original)
+++ branches/release/libs/property_map/test/dynamic_properties_test.cpp 2010-04-02 11:25:11 EDT (Fri, 02 Apr 2010)
@@ -18,16 +18,18 @@
#endif
#include <boost/test/minimal.hpp>
+#include <boost/smart_ptr.hpp>
#include <boost/property_map/dynamic_property_map.hpp>
#include <boost/property_map/property_map.hpp>
#include <map>
#include <iostream>
#include <string>
+#include <memory>
// generate a dynamic_property_map that maps strings to strings
// WARNING: This code leaks memory. For testing purposes only!
// WARNING: This code uses library internals. For testing purposes only!
-std::auto_ptr<boost::dynamic_property_map>
+boost::shared_ptr<boost::dynamic_property_map>
string2string_gen(const std::string& name,
const boost::any&,
const boost::any&) {
@@ -41,7 +43,7 @@
property_t property_map(*mymap);
- std::auto_ptr<boost::dynamic_property_map> pm(
+ boost::shared_ptr<boost::dynamic_property_map> pm(
new
boost::detail::dynamic_property_map_adaptor<property_t>(property_map));
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk