Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Tiago Peixoto
graph-tool
Commits
add3d518
Commit
add3d518
authored
Oct 27, 2015
by
Tiago Peixoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove any mention of boost::coroutine if HAVE_BOOST_COROUTINE is not defined
parent
1e051953
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
44 additions
and
10 deletions
+44
-10
src/graph/search/graph_astar.cc
src/graph/search/graph_astar.cc
+11
-3
src/graph/search/graph_bfs.cc
src/graph/search/graph_bfs.cc
+11
-2
src/graph/search/graph_dfs.cc
src/graph/search/graph_dfs.cc
+11
-2
src/graph/search/graph_dijkstra.cc
src/graph/search/graph_dijkstra.cc
+11
-3
No files found.
src/graph/search/graph_astar.cc
View file @
add3d518
...
...
@@ -20,7 +20,6 @@
#include <boost/python.hpp>
#include <boost/graph/astar_search.hpp>
#include <boost/coroutine/all.hpp>
#include "graph.hh"
#include "graph_selectors.hh"
...
...
@@ -28,6 +27,10 @@
#include "graph_astar.hh"
#ifdef HAVE_BOOST_COROUTINE
#include <boost/coroutine/all.hpp>
#endif // HAVE_BOOST_COROUTINE
using
namespace
std
;
using
namespace
boost
;
using
namespace
graph_tool
;
...
...
@@ -100,6 +103,7 @@ void a_star_search(GraphInterface& g, size_t source, boost::any dist_map,
writable_vertex_properties
())(
dist_map
);
}
#ifdef HAVE_BOOST_COROUTINE
typedef
boost
::
coroutines
::
asymmetric_coroutine
<
boost
::
python
::
object
>
coro_t
;
...
...
@@ -143,6 +147,8 @@ private:
coro_t
::
pull_type
::
iterator
_end
;
};
#endif // HAVE_BOOST_COROUTINE
boost
::
python
::
object
astar_search_generator
(
GraphInterface
&
g
,
size_t
source
,
boost
::
any
dist_map
,
...
...
@@ -166,7 +172,7 @@ boost::python::object astar_search_generator(GraphInterface& g,
};
return
boost
::
python
::
object
(
AStarGenerator
(
dispatch
));
#else
throw
GraphException
(
"This functionality is not available because boost::coroutine was not found at compile-time"
)
throw
GraphException
(
"This functionality is not available because boost::coroutine was not found at compile-time"
)
;
#endif
}
...
...
@@ -191,7 +197,7 @@ boost::python::object astar_search_generator_fast(GraphInterface& g,
};
return
boost
::
python
::
object
(
AStarGenerator
(
dispatch
));
#else
throw
GraphException
(
"This functionality is not available because boost::coroutine was not found at compile-time"
)
throw
GraphException
(
"This functionality is not available because boost::coroutine was not found at compile-time"
)
;
#endif
}
...
...
@@ -202,8 +208,10 @@ void export_astar()
def
(
"astar_search"
,
&
a_star_search
);
def
(
"astar_generator"
,
&
astar_search_generator
);
def
(
"astar_generator_fast"
,
&
astar_search_generator_fast
);
#ifdef HAVE_BOOST_COROUTINE
class_
<
AStarGenerator
>
(
"AStarGenerator"
,
no_init
)
.
def
(
"__iter__"
,
objects
::
identity_function
())
.
def
(
"next"
,
&
AStarGenerator
::
next
)
.
def
(
"__next__"
,
&
AStarGenerator
::
next
);
#endif
}
src/graph/search/graph_bfs.cc
View file @
add3d518
...
...
@@ -20,12 +20,15 @@
#include <boost/python.hpp>
#include <boost/graph/breadth_first_search.hpp>
#include <boost/coroutine/all.hpp>
#include "graph.hh"
#include "graph_selectors.hh"
#include "graph_util.hh"
#ifdef HAVE_BOOST_COROUTINE
#include <boost/coroutine/all.hpp>
#endif // HAVE_BOOST_COROUTINE
using
namespace
std
;
using
namespace
boost
;
using
namespace
graph_tool
;
...
...
@@ -120,6 +123,8 @@ void bfs_search(GraphInterface& g, size_t s, python::object vis)
BFSVisitorWrapper
(
g
,
vis
)))();
}
#ifdef HAVE_BOOST_COROUTINE
typedef
boost
::
coroutines
::
asymmetric_coroutine
<
boost
::
python
::
object
>
coro_t
;
class
BFSGeneratorVisitor
:
public
bfs_visitor
<>
...
...
@@ -162,6 +167,8 @@ private:
coro_t
::
pull_type
::
iterator
_end
;
};
#endif // HAVE_BOOST_COROUTINE
boost
::
python
::
object
bfs_search_generator
(
GraphInterface
&
g
,
size_t
s
)
{
#ifdef HAVE_BOOST_COROUTINE
...
...
@@ -173,7 +180,7 @@ boost::python::object bfs_search_generator(GraphInterface& g, size_t s)
};
return
boost
::
python
::
object
(
BFSGenerator
(
dispatch
));
#else
throw
GraphException
(
"This functionality is not available because boost::coroutine was not found at compile-time"
)
throw
GraphException
(
"This functionality is not available because boost::coroutine was not found at compile-time"
)
;
#endif
}
...
...
@@ -182,8 +189,10 @@ void export_bfs()
using
namespace
boost
::
python
;
def
(
"bfs_search"
,
&
bfs_search
);
def
(
"bfs_search_generator"
,
&
bfs_search_generator
);
#ifdef HAVE_BOOST_COROUTINE
class_
<
BFSGenerator
>
(
"BFSGenerator"
,
no_init
)
.
def
(
"__iter__"
,
objects
::
identity_function
())
.
def
(
"next"
,
&
BFSGenerator
::
next
)
.
def
(
"__next__"
,
&
BFSGenerator
::
next
);
#endif
}
src/graph/search/graph_dfs.cc
View file @
add3d518
...
...
@@ -11,12 +11,15 @@
#include <boost/python.hpp>
#include <boost/graph/depth_first_search.hpp>
#include <boost/graph/undirected_dfs.hpp>
#include <boost/coroutine/all.hpp>
#include "graph.hh"
#include "graph_selectors.hh"
#include "graph_util.hh"
#ifdef HAVE_BOOST_COROUTINE
#include <boost/coroutine/all.hpp>
#endif // HAVE_BOOST_COROUTINE
using
namespace
std
;
using
namespace
boost
;
using
namespace
graph_tool
;
...
...
@@ -109,6 +112,7 @@ void dfs_search(GraphInterface& g, size_t s, python::object vis)
s
,
DFSVisitorWrapper
(
g
,
vis
)))();
}
#ifdef HAVE_BOOST_COROUTINE
typedef
boost
::
coroutines
::
asymmetric_coroutine
<
boost
::
python
::
object
>
coro_t
;
...
...
@@ -152,6 +156,9 @@ private:
coro_t
::
pull_type
::
iterator
_end
;
};
#endif // HAVE_BOOST_COROUTINE
boost
::
python
::
object
dfs_search_generator
(
GraphInterface
&
g
,
size_t
s
)
{
#ifdef HAVE_BOOST_COROUTINE
...
...
@@ -164,7 +171,7 @@ boost::python::object dfs_search_generator(GraphInterface& g, size_t s)
};
return
boost
::
python
::
object
(
DFSGenerator
(
dispatch
));
#else
throw
GraphException
(
"This functionality is not available because boost::coroutine was not found at compile-time"
)
throw
GraphException
(
"This functionality is not available because boost::coroutine was not found at compile-time"
)
;
#endif
}
...
...
@@ -173,8 +180,10 @@ void export_dfs()
using
namespace
boost
::
python
;
def
(
"dfs_search"
,
&
dfs_search
);
def
(
"dfs_search_generator"
,
&
dfs_search_generator
);
#ifdef HAVE_BOOST_COROUTINE
class_
<
DFSGenerator
>
(
"DFSGenerator"
,
no_init
)
.
def
(
"__iter__"
,
objects
::
identity_function
())
.
def
(
"next"
,
&
DFSGenerator
::
next
)
.
def
(
"__next__"
,
&
DFSGenerator
::
next
);
#endif
}
src/graph/search/graph_dijkstra.cc
View file @
add3d518
...
...
@@ -20,12 +20,15 @@
#include <boost/python.hpp>
#include <boost/graph/dijkstra_shortest_paths_no_color_map.hpp>
#include <boost/coroutine/all.hpp>
#include "graph.hh"
#include "graph_selectors.hh"
#include "graph_util.hh"
#ifdef HAVE_BOOST_COROUTINE
#include <boost/coroutine/all.hpp>
#endif // HAVE_BOOST_COROUTINE
using
namespace
std
;
using
namespace
boost
;
using
namespace
graph_tool
;
...
...
@@ -179,6 +182,7 @@ void dijkstra_search(GraphInterface& g, size_t source, boost::any dist_map,
writable_vertex_properties
())(
dist_map
);
}
#ifdef HAVE_BOOST_COROUTINE
typedef
boost
::
coroutines
::
asymmetric_coroutine
<
boost
::
python
::
object
>
coro_t
;
...
...
@@ -222,6 +226,8 @@ private:
coro_t
::
pull_type
::
iterator
_end
;
};
#endif // HAVE_BOOST_COROUTINE
boost
::
python
::
object
dijkstra_search_generator
(
GraphInterface
&
g
,
size_t
source
,
boost
::
any
dist_map
,
...
...
@@ -244,7 +250,7 @@ boost::python::object dijkstra_search_generator(GraphInterface& g,
};
return
boost
::
python
::
object
(
DJKGenerator
(
dispatch
));
#else
throw
GraphException
(
"This functionality is not available because boost::coroutine was not found at compile-time"
)
throw
GraphException
(
"This functionality is not available because boost::coroutine was not found at compile-time"
)
;
#endif
}
...
...
@@ -267,7 +273,7 @@ boost::python::object dijkstra_search_generator_fast(GraphInterface& g,
};
return
boost
::
python
::
object
(
DJKGenerator
(
dispatch
));
#else
throw
GraphException
(
"This functionality is not available because boost::coroutine was not found at compile-time"
)
throw
GraphException
(
"This functionality is not available because boost::coroutine was not found at compile-time"
)
;
#endif
}
...
...
@@ -277,8 +283,10 @@ void export_dijkstra()
def
(
"dijkstra_search"
,
&
dijkstra_search
);
def
(
"dijkstra_generator"
,
&
dijkstra_search_generator
);
def
(
"dijkstra_generator_fast"
,
&
dijkstra_search_generator_fast
);
#ifdef HAVE_BOOST_COROUTINE
class_
<
DJKGenerator
>
(
"DJKGenerator"
,
no_init
)
.
def
(
"__iter__"
,
objects
::
identity_function
())
.
def
(
"next"
,
&
DJKGenerator
::
next
)
.
def
(
"__next__"
,
&
DJKGenerator
::
next
);
#endif
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment