mirror of
https://github.com/boostorg/graph.git
synced 2026-07-24 13:48:03 +00:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e63940fea1 | |||
| 0c9dbd7808 | |||
| 83646b1913 | |||
| 4149230e27 | |||
| 7f77c3563b | |||
| 14c2bf17b4 | |||
| ca17604dca |
@@ -1,4 +1,4 @@
|
||||
Boost Graph Library
|
||||
Boost Graph Library [](https://travis-ci.org/boostorg/graph)
|
||||
===================
|
||||
|
||||
A generic interface for traversing graphs, using C++ templates.
|
||||
@@ -7,9 +7,14 @@ The full documentation is available on [boost.org](http://www.boost.org/doc/libs
|
||||
|
||||
## Support, bugs and feature requests ##
|
||||
|
||||
Bugs and feature requests can be reported through the [Trac issue tracker](https://svn.boost.org/trac/boost/query?component=graph&desc=1&order=id)
|
||||
(see [open issues](https://svn.boost.org/trac/boost/query?status=!closed&component=graph&desc=1&order=id) and
|
||||
[closed issues](https://svn.boost.org/trac/boost/query?status=closed&component=graph&col=id&col=summary&col=status&col=owner&col=type&col=milestone&col=version&desc=1&order=id)). [Here](http://lists.boost.org/Archives/boost/2015/04/221780.php) is why Trac is still in use.
|
||||
Bugs and feature requests can be reported through the [Github issue page](https://github.com/boostorg/graph/issues).
|
||||
|
||||
See also:
|
||||
|
||||
* [Current open issues](https://github.com/boostorg/graph/issues)
|
||||
* [Closed issues](https://github.com/boostorg/graph/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aclosed)
|
||||
* Old issues still open on [Trac](https://svn.boost.org/trac/boost/query?status=!closed&component=graph&desc=1&order=id)
|
||||
* Closed issues on [Trac](https://svn.boost.org/trac/boost/query?status=closed&component=graph&col=id&col=summary&col=status&col=owner&col=type&col=milestone&col=version&desc=1&order=id)).
|
||||
|
||||
You can submit your changes through a [pull request](https://github.com/boostorg/graph/pulls). One of the maintainers will take a look (remember that it can take some time).
|
||||
|
||||
@@ -18,6 +23,12 @@ There is no mailing-list specific to Boost Graph, although you can use the gener
|
||||
|
||||
## Development ##
|
||||
|
||||
| | Master | Develop |
|
||||
|------------------|----------|-------------|
|
||||
| Travis | [](https://travis-ci.org/boostorg/graph) | [](https://travis-ci.org/boostorg/graph) |
|
||||
| Appveyor | [](https://ci.appveyor.com/project/jzmaddock/graph/branch/master) | [](https://ci.appveyor.com/project/jzmaddock/graph/branch/develop) |
|
||||
|
||||
|
||||
Clone the whole boost project, which includes the individual Boost projects as submodules ([see boost+git doc](https://github.com/boostorg/boost/wiki/Getting-Started)):
|
||||
|
||||
git clone https://github.com/boostorg/boost
|
||||
|
||||
@@ -49,6 +49,10 @@ edges are not desired.</p>
|
||||
|
||||
<p>For example, if a circuit <code>u -> v -> w -> u</code> exists in the graph, the
|
||||
visitor will be called with a sequence consisting of <code>(u, v, w)</code>.</p>
|
||||
|
||||
Note that if <code>visitor</code> is a <code>std::reference_wrapper</code>,
|
||||
it will be unwrapped before the <code>.cycle</code> method being called on it.
|
||||
This allows passing a visitor that shouldn't be copied.
|
||||
</blockquote>
|
||||
|
||||
<p><strong>IN:</strong> <code>VertexIndexMap const& vim = get(vertex_index, graph)</code></p>
|
||||
|
||||
@@ -8,11 +8,11 @@
|
||||
#ifndef BOOST_DEPRECATED_INCLUDE_EDMONDS_KARP_MAX_FLOW_HPP
|
||||
#define BOOST_DEPRECATED_INCLUDE_EDMONDS_KARP_MAX_FLOW_HPP
|
||||
|
||||
#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
|
||||
#if defined(_MSC_VER) || defined(__BORLANDC__) && !defined(__clang__) || defined(__DMC__)
|
||||
#pragma message( \
|
||||
"Warning: This header is deprecated. Please use: boost/graph/edmonds_karp_max_flow.hpp")
|
||||
#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) \
|
||||
|| defined(__IBMCPP__)
|
||||
|| defined(__IBMCPP__) || defined(__BORLANDC__)
|
||||
#warning \
|
||||
"This header is deprecated. Please use: boost/graph/edmonds_karp_max_flow.hpp"
|
||||
#endif
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace boost
|
||||
// It is needed in order to allow us to write using boost::vertices as
|
||||
// needed for ADL when using vector_as_graph below.
|
||||
#if !defined(BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP) \
|
||||
&& !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
|
||||
&& !BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x564))
|
||||
#define BOOST_VECTOR_AS_GRAPH_GRAPH_ADL_HACK
|
||||
#endif
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include <boost/tuple/tuple.hpp> // for boost::tie
|
||||
#include <boost/type_traits/remove_reference.hpp>
|
||||
#include <boost/utility/result_of.hpp>
|
||||
#include <functional> // for std::reference_wrapper
|
||||
#include <set>
|
||||
#include <utility> // for std::pair
|
||||
#include <vector>
|
||||
@@ -89,6 +90,18 @@ namespace hawick_circuits_detail
|
||||
return std::find(boost::begin(c), boost::end(c), v) != boost::end(c);
|
||||
}
|
||||
|
||||
template < typename T >
|
||||
struct unwrap_reference_wrapper {
|
||||
typedef T type;
|
||||
};
|
||||
|
||||
#if __cplusplus >= 201103L
|
||||
template < typename T >
|
||||
struct unwrap_reference_wrapper<std::reference_wrapper<T> > {
|
||||
typedef T& type;
|
||||
};
|
||||
#endif
|
||||
|
||||
/*!
|
||||
* @internal
|
||||
* Algorithm finding all the cycles starting from a given vertex.
|
||||
@@ -301,8 +314,9 @@ namespace hawick_circuits_detail
|
||||
|
||||
typedef std::vector< Vertex > Stack;
|
||||
typedef std::vector< std::vector< Vertex > > ClosedMatrix;
|
||||
typedef typename unwrap_reference_wrapper<Visitor>::type VisitorNoRef;
|
||||
|
||||
typedef hawick_circuits_from< Graph, Visitor, VertexIndexMap, Stack,
|
||||
typedef hawick_circuits_from< Graph, VisitorNoRef, VertexIndexMap, Stack,
|
||||
ClosedMatrix, GetAdjacentVertices >
|
||||
SubAlgorithm;
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ typename graph_traits< Graph >::vertex_descriptor random_vertex(
|
||||
{
|
||||
if (num_vertices(g) > 1)
|
||||
{
|
||||
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x581))
|
||||
#if BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x581))
|
||||
std::size_t n = std::random(num_vertices(g));
|
||||
#else
|
||||
uniform_int<> distrib(0, num_vertices(g) - 1);
|
||||
@@ -59,7 +59,7 @@ typename graph_traits< Graph >::edge_descriptor random_edge(
|
||||
{
|
||||
if (num_edges(g) > 1)
|
||||
{
|
||||
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x581))
|
||||
#if BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x581))
|
||||
typename graph_traits< Graph >::edges_size_type n
|
||||
= std::random(num_edges(g));
|
||||
#else
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include <iostream>
|
||||
#include <map>
|
||||
#include <vector>
|
||||
#include <ctime>
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
@@ -80,7 +81,7 @@ int main(int argc, char* argv[])
|
||||
|
||||
int vertices_to_create = 10;
|
||||
int edges_to_create = 500;
|
||||
std::size_t random_seed = time(0);
|
||||
std::size_t random_seed = std::time(0);
|
||||
|
||||
if (argc > 1)
|
||||
{
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
#include <set>
|
||||
#include <ctime>
|
||||
|
||||
#include <boost/foreach.hpp>
|
||||
#include <boost/lexical_cast.hpp>
|
||||
@@ -224,7 +225,7 @@ template < unsigned int Dims > void do_test(minstd_rand& generator)
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
|
||||
std::size_t random_seed = time(0);
|
||||
std::size_t random_seed = std::time(0);
|
||||
|
||||
if (argc > 1)
|
||||
{
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
|
||||
#include "cycle_test.hpp"
|
||||
#include <boost/graph/hawick_circuits.hpp>
|
||||
#include <cstddef>
|
||||
#include <functional>
|
||||
#include <iostream>
|
||||
|
||||
struct call_hawick_circuits
|
||||
@@ -26,6 +28,20 @@ struct call_hawick_unique_circuits
|
||||
}
|
||||
};
|
||||
|
||||
struct not_copyable
|
||||
{
|
||||
not_copyable() { }
|
||||
|
||||
template < typename Path, typename Graph >
|
||||
void cycle(Path const&, Graph const&)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private:
|
||||
not_copyable(not_copyable const&);
|
||||
};
|
||||
|
||||
int main()
|
||||
{
|
||||
std::cout << "---------hawick_circuits---------\n";
|
||||
@@ -33,4 +49,24 @@ int main()
|
||||
|
||||
std::cout << "\n\n---------hawick_unique_circuits---------\n";
|
||||
cycle_test(call_hawick_unique_circuits());
|
||||
|
||||
// Make sure we can pass a reference_wrapper to the algorithm.
|
||||
#if __cplusplus >= 201103L
|
||||
{
|
||||
typedef boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS> Graph;
|
||||
typedef std::pair<std::size_t, std::size_t> Pair;
|
||||
Pair edges[3] = {
|
||||
Pair(0, 1), // a->b
|
||||
Pair(1, 2), // b->c
|
||||
Pair(2, 0), // c->a
|
||||
};
|
||||
|
||||
Graph G(3);
|
||||
for (int i = 0; i < 3; ++i)
|
||||
add_edge(edges[i].first, edges[i].second, G);
|
||||
|
||||
not_copyable visitor;
|
||||
boost::hawick_circuits(G, std::ref(visitor));
|
||||
}
|
||||
#endif // >= C++11
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include <iostream>
|
||||
#include <map>
|
||||
#include <set>
|
||||
#include <ctime>
|
||||
|
||||
#include <boost/foreach.hpp>
|
||||
#include <boost/graph/adjacency_list.hpp>
|
||||
@@ -127,7 +128,7 @@ template < typename Graph > void test_graph(const Graph& graph)
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
std::size_t vertices_to_generate = 100, edges_to_generate = 50,
|
||||
random_seed = time(0);
|
||||
random_seed = std::time(0);
|
||||
|
||||
// Parse command-line arguments
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include <fstream>
|
||||
#include <sstream>
|
||||
#include <vector>
|
||||
#include <ctime>
|
||||
|
||||
#include <boost/lexical_cast.hpp>
|
||||
#include <boost/random.hpp>
|
||||
@@ -311,7 +312,7 @@ int main(int argc, char* argv[])
|
||||
{
|
||||
int vertices_to_create = 10;
|
||||
int max_edges_per_vertex = 2;
|
||||
std::size_t random_seed = time(0);
|
||||
std::size_t random_seed = std::time(0);
|
||||
|
||||
if (argc > 1)
|
||||
{
|
||||
|
||||
@@ -90,7 +90,7 @@ void testScalability(unsigned numpts)
|
||||
typedef set< simple_point< double >, cmpPnt< double > > PointSet;
|
||||
typedef vector< Vertex > Container;
|
||||
|
||||
boost::mt19937 rng(time(0));
|
||||
boost::mt19937 rng(std::time(0));
|
||||
uniform_real<> range(0.01, (numpts * 2));
|
||||
variate_generator< boost::mt19937&, uniform_real<> > pnt_gen(rng, range);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user