......@@ -15,9 +15,6 @@
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <boost/math/special_functions/zeta.hpp>
#include <boost/math/special_functions/gamma.hpp>
#include "graph_tool.hh"
#include "hash_map_wrap.hh"
#include "int_part.hh"
......
......@@ -25,7 +25,6 @@
#include "graph_tool.hh"
#include "../support/graph_state.hh"
#include "graph_blockmodel_dynamics.hh"
#include "graph_python_interface.hh"
namespace graph_tool
{
......
......@@ -19,8 +19,6 @@
#include "graph.hh"
#include "graph_properties.hh"
#include <boost/lambda/bind.hpp>
#include "graph_arf.hh"
using namespace std;
......
......@@ -31,10 +31,6 @@ Value power(Value value, int n)
}
#endif
#include <boost/math/special_functions/gamma.hpp>
#include <boost/math/special_functions/hypot.hpp>
#include <boost/math/constants/constants.hpp>
#include <boost/graph/fruchterman_reingold.hpp>
using namespace std;
......
......@@ -20,8 +20,6 @@
#include "graph_properties.hh"
#include "graph_exceptions.hh"
#include <boost/lambda/bind.hpp>
#include "graph_sfdp.hh"
#include "random.hh"
#include "hash_map_wrap.hh"
......
......@@ -63,55 +63,6 @@ namespace mpl
// of arguments according to the called types. If the cast is successful, the
// function will be called with those types, and true will be returned.
template <class Action, std::size_t N>
struct all_any_cast
{
all_any_cast(Action a, std::array<any*, N>& args)
: _a(a), _args(args) {}
template <class... Ts>
[[gnu::always_inline]]
bool operator()(Ts*... vs) const
{
return dispatch(std::make_index_sequence<sizeof...(Ts)>(), vs...);
}
template <class T>
T* try_any_cast(boost::any& a) const
{
T* t = any_cast<T>(&a);
if (t != nullptr)
return t;
std::reference_wrapper<T>* tr = any_cast<std::reference_wrapper<T>>(&a);
if (tr != nullptr)
return &(tr->get());
return nullptr;
}
template <std::size_t... Idx, class... Ts>
[[gnu::always_inline]]
bool dispatch(std::index_sequence<Idx...>, Ts*...) const
{
static_assert(sizeof...(Idx) == N,
"all_any_cast: wrong number of arguments");
std::tuple<std::add_pointer_t<Ts>...> args;
if (((std::get<Idx>(args) = try_any_cast<Ts>(*_args[Idx])) && ...))
{
// successful set of casts. Dereference and call action.
std::apply([this](auto*... arg){ _a(*arg...); }, args);
return true;
}
return false;
}
Action _a;
std::array<any*, N>& _args;
};
// recursion-free variadic version of for_each
template <class...>
struct for_each_variadic;
......@@ -143,6 +94,9 @@ struct to_tuple
to_tuple_imp<mpl::_1, mpl::_2>>::type type;
};
template <class Seq>
using to_tuple_t = typename to_tuple<Seq>::type;
// nested type loops via variadic templates
template <class...>
......@@ -179,17 +133,6 @@ struct inner_loop<Action, std::tuple<Ts...>, TR1, TRS...>
// final function
template <class TR1, class... TRS, class Action, class... Args>
bool nested_for_each(Action a, Args&&... args)
{
std::array<any*, sizeof...(args)> as{{&args...}};
auto b = all_any_cast<Action, sizeof...(args)>(a, as);
typedef decltype(b) action_t;
typedef typename to_tuple<TR1>::type tr_tuple;
typedef inner_loop<action_t, std::tuple<>, TRS...> inner_loop_t;
return for_each_variadic<inner_loop_t, tr_tuple>()(inner_loop_t(b));
}
template <class TR1, class... TRS, class Action>
void nested_for_each(Action a)
{
......
......@@ -33,7 +33,6 @@
#define BOOST_DISABLE_ASSERTS
#include <boost/multi_array.hpp>
#include <boost/type_traits.hpp>
#include <boost/mpl/int.hpp>
#include <boost/mpl/vector.hpp>
#include <boost/mpl/map.hpp>
......
......@@ -25,8 +25,6 @@
// Ronald Garcia
//
#include <boost/ref.hpp>
#include <boost/function/function2.hpp>
#include <boost/version.hpp>
#if (BOOST_VERSION >= 104000)
# include <boost/property_map/dynamic_property_map.hpp>
......@@ -47,8 +45,6 @@
#include <cstdlib>
#include <boost/throw_exception.hpp>
#include <boost/regex.hpp>
#include <boost/function.hpp>
#include <boost/bind.hpp>
#include <boost/graph/graphviz.hpp>
namespace boost {
......
......@@ -28,7 +28,6 @@
#include "graph_astar.hh"
#include "coroutine.hh"
#include "graph_python_interface.hh"
using namespace std;
using namespace boost;
......
......@@ -16,7 +16,6 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "graph_filtering.hh"
#include "graph_python_interface.hh"
#include <boost/python.hpp>
#include <boost/graph/astar_search.hpp>
......
......@@ -26,7 +26,6 @@
#include "graph_util.hh"
#include "coroutine.hh"
#include "graph_python_interface.hh"
using namespace std;
using namespace boost;
......
......@@ -10,14 +10,12 @@
#include <boost/python.hpp>
#include <boost/graph/depth_first_search.hpp>
#include <boost/graph/undirected_dfs.hpp>
#include "graph.hh"
#include "graph_selectors.hh"
#include "graph_util.hh"
#include "coroutine.hh"
#include "graph_python_interface.hh"
using namespace std;
using namespace boost;
......
......@@ -26,7 +26,6 @@
#include "graph_util.hh"
#include "coroutine.hh"
#include "graph_python_interface.hh"
using namespace std;
using namespace boost;
......
......@@ -19,8 +19,6 @@
#define GRAPH_AVERAGE_HH
#include <algorithm>
#include <boost/numeric/conversion/bounds.hpp>
#include <boost/numeric/conversion/cast.hpp>
namespace graph_tool
{
......
......@@ -23,7 +23,6 @@
#include <boost/python/object.hpp>
#include <boost/python/list.hpp>
#include <boost/python/extract.hpp>
#include "histogram.hh"
#include "numpy_bind.hh"
......
......@@ -23,7 +23,6 @@
#include <boost/python/object.hpp>
#include <boost/python/list.hpp>
#include <boost/python/extract.hpp>
#include "histogram.hh"
#include "numpy_bind.hh"
......
......@@ -22,8 +22,6 @@
#include <boost/numeric/conversion/bounds.hpp>
#include <boost/numeric/conversion/cast.hpp>
#include <boost/python/object.hpp>
#include <boost/python/list.hpp>
#include <boost/python/extract.hpp>
#include "numpy_bind.hh"
#include "histogram.hh"
#include "shared_map.hh"
......
......@@ -22,8 +22,6 @@
#include "graph_util.hh"
#include "idx_map.hh"
#include <boost/range/adaptor/reversed.hpp>
namespace graph_tool
{
using namespace std;
......
......@@ -30,7 +30,6 @@
#include <boost/graph/dijkstra_shortest_paths_no_color_map.hpp>
#include <boost/graph/bellman_ford_shortest_paths.hpp>
#include <boost/graph/dag_shortest_paths.hpp>
#include <boost/python/stl_iterator.hpp>
#include <boost/python.hpp>
#if (BOOST_VERSION >= 106000)
......
......@@ -21,6 +21,8 @@
#include <array>
#include <deque>
#include "hash_map_wrap.hh"
namespace graph_tool
{
......