diff --git a/configure.ac b/configure.ac index dcdb443ad3bd496a57e75ca4459f218987e4fff9..993181852a514a249f04f3d181a333f5973b2ce0 100644 --- a/configure.ac +++ b/configure.ac @@ -34,7 +34,7 @@ AC_PROG_INSTALL AC_CANONICAL_TARGET dnl turn on warnings -[CXXFLAGS="-Wall -Wextra -Wno-unused-local-typedefs -Wno-unused-parameter ${CXXFLAGS}"] +[CXXFLAGS="-Wall -Wextra -ftemplate-backtrace-limit=0 ${CXXFLAGS}"] dnl Checks for options diff --git a/src/boost-workaround/boost/graph/betweenness_centrality.hpp b/src/boost-workaround/boost/graph/betweenness_centrality.hpp index 0ab8c7d374f3f2bdf4324facb6f158483b302ed0..1fe760d6fb4fe971624fc0ce61d79b2650f06e44 100644 --- a/src/boost-workaround/boost/graph/betweenness_centrality.hpp +++ b/src/boost-workaround/boost/graph/betweenness_centrality.hpp @@ -305,7 +305,6 @@ namespace detail { namespace graph { ShortestPaths shortest_paths) { typedef typename graph_traits::vertex_iterator vertex_iterator; - typedef typename graph_traits::edge_iterator edge_iterator; typedef typename graph_traits::vertex_descriptor vertex_descriptor; // Initialize centrality @@ -446,7 +445,6 @@ namespace detail { namespace graph { VertexIndexMap vertex_index) { typedef typename graph_traits::degree_size_type degree_size_type; - typedef typename graph_traits::vertex_descriptor vertex_descriptor; typedef typename graph_traits::edge_descriptor edge_descriptor; typedef typename mpl::if_c<(is_same::value), @@ -482,7 +480,6 @@ namespace detail { namespace graph { VertexIndexMap vertex_index) { typedef typename graph_traits::degree_size_type degree_size_type; - typedef typename graph_traits::vertex_descriptor vertex_descriptor; typedef typename graph_traits::edge_descriptor edge_descriptor; typedef typename mpl::if_c<(is_same::value), diff --git a/src/boost-workaround/boost/graph/metric_tsp_approx.hpp b/src/boost-workaround/boost/graph/metric_tsp_approx.hpp index c079d7775931f3fa78ac748d03baf8c131041e1e..0e2d85b22aa08d51213022180028078245ec40e9 100644 --- a/src/boost-workaround/boost/graph/metric_tsp_approx.hpp +++ b/src/boost-workaround/boost/graph/metric_tsp_approx.hpp @@ -173,7 +173,6 @@ namespace boost // We build a custom graph in this algorithm. typedef adjacency_list MSTImpl; - typedef graph_traits::edge_descriptor Edge; typedef graph_traits::vertex_descriptor Vertex; typedef graph_traits::vertex_iterator VItr; diff --git a/src/boost-workaround/boost/graph/stoer_wagner_min_cut.hpp b/src/boost-workaround/boost/graph/stoer_wagner_min_cut.hpp index 814eae0ce8d351e27508fc70f750588754ca9c31..60be16abbf7053b0a663ee4e50212cfbef5288f2 100644 --- a/src/boost-workaround/boost/graph/stoer_wagner_min_cut.hpp +++ b/src/boost-workaround/boost/graph/stoer_wagner_min_cut.hpp @@ -212,7 +212,6 @@ namespace boost { inline typename boost::property_traits::value_type stoer_wagner_min_cut(const UndirectedGraph& g, WeightMap weights, const boost::bgl_named_params& params) { typedef typename boost::graph_traits::vertex_descriptor vertex_descriptor; - typedef typename std::vector::size_type heap_container_size_type; typedef typename boost::property_traits::value_type weight_type; typedef boost::bgl_named_params params_type; diff --git a/src/graph/centrality/graph_closeness.hh b/src/graph/centrality/graph_closeness.hh index d5ca6aded48cc4ecfbcd3693c9d875961ba36113..48c3916dc6d6eb4e7ecdd7736543a1e701a4d838 100644 --- a/src/graph/centrality/graph_closeness.hh +++ b/src/graph/centrality/graph_closeness.hh @@ -121,7 +121,7 @@ struct get_closeness : _comp_size(comp_size) { } template - void discover_vertex(Vertex u, const Graph&) + void discover_vertex(Vertex, const Graph&) { ++_comp_size; } diff --git a/src/graph/centrality/graph_eigenvector.hh b/src/graph/centrality/graph_eigenvector.hh index 1aea9727ee79cfb55a86411170e97776696ee511..b7fd0ee63393e447ff81ee017468e1b3fb5f2ff7 100644 --- a/src/graph/centrality/graph_eigenvector.hh +++ b/src/graph/centrality/graph_eigenvector.hh @@ -46,7 +46,6 @@ struct get_eigenvector CentralityMap c, double epsilon, size_t max_iter, long double& eig) const { - typedef typename property_traits::value_type c_type; typedef typename property_traits::value_type t_type; CentralityMap c_temp(vertex_index, num_vertices(g)); diff --git a/src/graph/centrality/graph_hits.hh b/src/graph/centrality/graph_hits.hh index 6f47cc039f62341e20d24dbe07be6a550a732919..83a54a2d86e4c2fcf43577495895db299db4115e 100644 --- a/src/graph/centrality/graph_hits.hh +++ b/src/graph/centrality/graph_hits.hh @@ -46,7 +46,6 @@ struct get_hits CentralityMap x, CentralityMap y, double epsilon, size_t max_iter, long double& eig) const { - typedef typename property_traits::value_type c_type; typedef typename property_traits::value_type t_type; CentralityMap x_temp(vertex_index, num_vertices(g)); diff --git a/src/graph/centrality/graph_katz.hh b/src/graph/centrality/graph_katz.hh index ac493e3c3cf182d4b58424aa80314dfbeb36144c..b51b4d371261d21e0da7b4fcd7c791ba66b54035 100644 --- a/src/graph/centrality/graph_katz.hh +++ b/src/graph/centrality/graph_katz.hh @@ -46,7 +46,6 @@ struct get_katz CentralityMap c, PersonalizationMap beta, long double alpha, long double epsilon, size_t max_iter) const { - typedef typename property_traits::value_type c_type; typedef typename property_traits::value_type t_type; CentralityMap c_temp(vertex_index, num_vertices(g)); diff --git a/src/graph/centrality/graph_trust_transitivity.hh b/src/graph/centrality/graph_trust_transitivity.hh index 94dafc45ceba65a47e57aec22cb5cae2a00cf1a5..91d5a47e5c41b8989f97a66f516d267cd4a63774 100644 --- a/src/graph/centrality/graph_trust_transitivity.hh +++ b/src/graph/centrality/graph_trust_transitivity.hh @@ -100,8 +100,6 @@ struct get_trust_transitivity int64_t target, TrustMap c, InferredTrustMap t) const { typedef typename graph_traits::vertex_descriptor vertex_t; - typedef typename graph_traits::edge_descriptor edge_t; - typedef typename property_traits::value_type c_type; typedef typename property_traits::value_type::value_type t_type; diff --git a/src/graph/community/graph_blockmodel.cc b/src/graph/community/graph_blockmodel.cc index c059aaea43b2b5e29534e0ae08dc5af5af1368b0..00f165e56e8148da3b2bdc0a5fb5f29d5a63628e 100644 --- a/src/graph/community/graph_blockmodel.cc +++ b/src/graph/community/graph_blockmodel.cc @@ -332,7 +332,6 @@ struct move_sweep_dispatch sampler_map_t sampler = any_cast(asampler); sampler_map_t cavity_sampler = any_cast(acavity_sampler); - ConstantPropertyMap::edge_descriptor> ce(0); ConstantPropertyMap, typename graph_traits::vertex_descriptor> cv({-1}); IdentityArrayPropertyMap::vertex_descriptor> vmap; boost::typed_identity_property_map identity; @@ -362,7 +361,7 @@ struct move_sweep_dispatch move_sweep(states, m_entries, wr.get_unchecked(num_vertices(bg)), b.get_unchecked(num_vertices(g)), - ce, cv, vmap, + cv, vmap, label.get_unchecked(num_vertices(bg)), vlist, deg_corr, dense, multigraph, beta, eweight.get_unchecked(max_edge_index), @@ -371,7 +370,7 @@ struct move_sweep_dispatch nmerges, merge_map.get_unchecked(num_vertices(g)), niter, num_vertices(bg), - verbose, rng, S, nmoves, ostats); + verbose, rng, S, nmoves); } }; diff --git a/src/graph/community/graph_blockmodel.hh b/src/graph/community/graph_blockmodel.hh index 7624ef8329da3189143bc7805993d164719dfa28..30dcea22b169e7fefba96e6437650f59ed5ff00f 100644 --- a/src/graph/community/graph_blockmodel.hh +++ b/src/graph/community/graph_blockmodel.hh @@ -166,7 +166,7 @@ double get_xi(NType N, EType E, double epsilon=1e-8) return 0; double mu = 0, l = 0; - get_mu_l(N, E, mu, l); + get_mu_l(N, E, mu, l, epsilon); double S = double(N) * l + 2 * double(E) * mu; return S; } @@ -186,7 +186,7 @@ double get_xi_fast(NType N, EType E) // "edge" term of the entropy template __attribute__((always_inline)) -inline double eterm(size_t r, size_t s, size_t mrs, const Graph& g) +inline double eterm(size_t r, size_t s, size_t mrs, const Graph&) { if (!is_directed::apply::type::value && r == s) mrs *= 2; @@ -200,8 +200,8 @@ inline double eterm(size_t r, size_t s, size_t mrs, const Graph& g) } // "vertex" term of the entropy -template -inline double vterm(Vertex v, size_t mrp, size_t mrm, size_t wr, bool deg_corr, +template +inline double vterm(size_t mrp, size_t mrm, size_t wr, bool deg_corr, Graph&) { double one = 0.5; @@ -225,7 +225,7 @@ struct entropy for (auto e : edges_range(g)) S += eterm(source(e, g), target(e, g), mrs[e], g); for (auto v : vertices_range(g)) - S += vterm(v, mrp[v], mrm[v], wr[v], deg_corr, g); + S += vterm(mrp[v], mrm[v], wr[v], deg_corr, g); } }; @@ -233,7 +233,7 @@ struct entropy // ============== template -double get_parallel_neighbours_entropy(Vertex v, List& us, Graph& g, +double get_parallel_neighbours_entropy(Vertex v, List& us, Graph&, const GetNode& get_node) { double S = 0; @@ -305,7 +305,7 @@ inline double lbinom_fast(int N, int k) template __attribute__((always_inline)) inline double eterm_dense(size_t r, size_t s, int ers, double wr_r, - double wr_s, bool multigraph, const Graph& g) + double wr_s, bool multigraph, const Graph&) { // we should not use integers here, since they may overflow double nrns; @@ -461,7 +461,7 @@ public: } template - double get_delta_dl(size_t v, size_t r, size_t nr, OStats& os, Graph&) + double get_delta_dl(size_t, size_t r, size_t nr, OStats&, Graph&) { if (r == nr) return 0; @@ -549,9 +549,8 @@ public: } template - void move_vertex(size_t v, size_t r, size_t nr, bool deg_corr, - OStats& overlap_stats, Graph& g, size_t kin = 0, - size_t kout = 0) + void move_vertex(size_t v, size_t r, size_t nr, bool deg_corr, OStats&, + Graph& g, size_t kin = 0, size_t kout = 0) { if (r == nr) return; @@ -647,7 +646,7 @@ inline __attribute__((always_inline)) pair::edge_descriptor, bool> get_me(typename graph_traits::vertex_descriptor r, typename graph_traits::vertex_descriptor s, - const typename get_emat_t::apply::type& emat, const Graph& g) + const typename get_emat_t::apply::type& emat, const Graph&) { return emat[r][s]; } @@ -658,7 +657,7 @@ void put_me(typename graph_traits::vertex_descriptor r, typename graph_traits::vertex_descriptor s, const typename graph_traits::edge_descriptor& e, - typename get_emat_t::apply::type& emat, const Graph& g) + typename get_emat_t::apply::type& emat, const Graph&) { emat[r][s] = make_pair(e, true); if (!is_directed::apply::type::value && r != s) @@ -670,8 +669,8 @@ inline __attribute__((always_inline)) void remove_me(typename graph_traits::vertex_descriptor r, typename graph_traits::vertex_descriptor s, - const typename graph_traits::edge_descriptor& e, - typename get_emat_t::apply::type& emat, Graph& g, + const typename graph_traits::edge_descriptor&, + typename get_emat_t::apply::type& emat, Graph&, bool delete_edge=true) { if (!delete_edge) @@ -708,7 +707,7 @@ inline __attribute__((always_inline)) pair::edge_descriptor, bool> get_me(typename graph_traits::vertex_descriptor r, typename graph_traits::vertex_descriptor s, - const typename get_ehash_t::apply::type& ehash, const Graph& bg) + const typename get_ehash_t::apply::type& ehash, const Graph&) { assert(r < ehash.size()); const auto& map = ehash[r]; @@ -725,9 +724,8 @@ put_me(typename graph_traits::vertex_descriptor r, typename graph_traits::vertex_descriptor s, const typename graph_traits::edge_descriptor& e, typename get_ehash_t::apply::type& ehash, - const Graph& bg) + const Graph&) { - typedef typename graph_traits::vertex_descriptor vertex_t; assert(r < ehash.size()); ehash[r][s] = e; if (!is_directed::apply::type::value) @@ -757,7 +755,6 @@ struct create_ehash void operator()(Graph& g, boost::any& oemap) const { typedef typename get_ehash_t::apply::type emat_t; - typedef typename get_ehash_t::apply::map_t map_t; typedef typename graph_traits::vertex_descriptor vertex_t; emat_t emat(num_vertices(g)); @@ -1210,7 +1207,7 @@ private: struct is_loop_nop { - bool operator()(size_t u) const { return false; } + bool operator()(size_t) const { return false; } }; @@ -1220,7 +1217,7 @@ template void move_entries(Vertex v, Vertex nr, Vprop& b, Eprop& eweights, Graph& g, - BGraph& bg, MEntries& m_entries, + BGraph&, MEntries& m_entries, const NPolicy& npolicy = NPolicy(), IL is_loop = IL()) { typedef typename graph_traits::vertex_descriptor vertex_t; @@ -1355,10 +1352,10 @@ double virtual_move_sparse(const Vec& vs, size_t nr, Eprop& mrs, Vprop& mrp, if (!is_directed::apply::type::value) kin = kout; - dS += vterm(r, mrp[r] - kout, mrm[r] - kin, wr[r] - dwr , deg_corr, bg); - dS += vterm(nr, mrp[nr] + kout, mrm[nr] + kin, wr[nr] + dwnr, deg_corr, bg); - dS -= vterm(r, mrp[r] , mrm[r] , wr[r] , deg_corr, bg); - dS -= vterm(nr, mrp[nr] , mrm[nr] , wr[nr] , deg_corr, bg); + dS += vterm(mrp[r] - kout, mrm[r] - kin, wr[r] - dwr , deg_corr, bg); + dS += vterm(mrp[nr] + kout, mrm[nr] + kin, wr[nr] + dwnr, deg_corr, bg); + dS -= vterm(mrp[r] , mrm[r] , wr[r] , deg_corr, bg); + dS -= vterm(mrp[nr] , mrm[nr] , wr[nr] , deg_corr, bg); return dS; } @@ -1387,8 +1384,8 @@ double virtual_move_sparse(size_t v, size_t nr, Eprop& mrs, Vprop& mrp, template -double virtual_move_dense(const Vec& vs, size_t nr, Eprop& mrs, Vprop& mrp, - Vprop& mrm, Vprop& wr, Vprop& b, bool deg_corr, +double virtual_move_dense(const Vec& vs, size_t nr, Eprop& mrs, Vprop&, + Vprop&, Vprop& wr, Vprop& b, bool deg_corr, const EWprop& eweight, const VWprop& vweight, Graph& g, BGraph& bg, EMat& emat, MEntries& m_entries, OStats& overlap_stats, bool multigraph, @@ -1667,7 +1664,7 @@ struct egroups_manage template static void build_dispatch(Vprop b, Egroups egroups, VEprop esrcpos, VEprop etgtpos, Eprop eweight, Graph& g, - VertexIndex vertex_index, size_t B, mpl::true_) + VertexIndex, size_t, mpl::true_) { for (auto e : edges_range(g)) { @@ -1684,7 +1681,7 @@ struct egroups_manage } template - static size_t insert_edge(const Edge& e, EV& elist, size_t weight) + static size_t insert_edge(const Edge& e, EV& elist, size_t) { elist.push_back(e); return elist.size() - 1; @@ -1728,7 +1725,7 @@ struct egroups_manage } template - static void remove_egroups(Vertex v, Vertex r, Eprop& eweight, + static void remove_egroups(Vertex v, Vertex r, Eprop&, EVprop& egroups, VEprop& esrcpos, VEprop& etgtpos, Graph& g) { @@ -2284,23 +2281,22 @@ double virtual_move(const Vec& vs, size_t s, Vprop& b, VLprop& cv, VVprop& vmap, } template -size_t get_block_map(const BlockState& state, const BlockMap& bmap, size_t r) +size_t get_block_map(const BlockState&, const BlockMap&, size_t r) { return r; } template -void remove_block_map(const BlockState& state, const BlockMap& bmap, size_t r) +void remove_block_map(const BlockState&, const BlockMap&, size_t) { } template + class NPolicy = standard_neighbours_policy> void move_vertex(size_t v, size_t s, Vprop& b, VLprop& cv, VVprop& vmap, - Vprop& wr, Vprop& vweight, bool deg_corr, - vector& states, bool update_egroups, - OStats& overlap_stats, const NPolicy& npolicy = NPolicy()) + bool deg_corr, vector& states, bool update_egroups, + const NPolicy& npolicy = NPolicy()) { size_t r = b[v]; @@ -2343,11 +2339,10 @@ void move_vertex(size_t v, size_t s, Vprop& b, VLprop& cv, VVprop& vmap, template + class Vec, class NPolicy = standard_neighbours_policy> void move_vertex(const Vec& vs, size_t s, Vprop& b, VLprop& cv, VVprop& vmap, - Vprop& wr, Vprop& vweight, bool deg_corr, - vector& states, bool update_egroups, - OStats& overlap_stats, const NPolicy& npolicy = NPolicy()) + bool deg_corr, vector& states, bool update_egroups, + const NPolicy& npolicy = NPolicy()) { size_t r = b[vs[0]]; if (s == r) @@ -2407,7 +2402,7 @@ void insert_vec(vector& v, size_t i, const Type& x) } template -void insert_vec(const std::array& v, size_t i, const Type& x) +void insert_vec(const std::array&, size_t, const Type&) { } @@ -2418,22 +2413,21 @@ void clear_vec(vector& v) } template -void clear_vec(const std::array& v) +void clear_vec(const std::array&) { } //A single Monte Carlo Markov chain sweep -template +template void move_sweep(vector& states, vector& m_entries_r, - Vprop wr, Vprop b, EVprop ce, VLprop cv, VVprop vmap, - Vprop clabel, vector& vlist, bool deg_corr, bool dense, - bool multigraph, double beta, Eprop eweight, Vprop vweight, - Graph& g, bool sequential, bool parallel, bool random_move, - double c, size_t nmerges, Vprop merge_map, size_t niter, - size_t B, bool verbose, RNG& rng, double& S, size_t& nmoves, - OStats ostats) + Vprop wr, Vprop b, VLprop cv, VVprop vmap, Vprop clabel, + vector& vlist, bool deg_corr, bool dense, bool multigraph, + double beta, Eprop eweight, Vprop vweight, Graph& g, + bool sequential, bool parallel, bool random_move, double c, + size_t nmerges, Vprop merge_map, size_t niter, size_t B, + bool verbose, RNG& rng, double& S, size_t& nmoves) { typedef typename graph_traits::vertex_descriptor vertex_t; @@ -2641,8 +2635,8 @@ void move_sweep(vector& states, vector& m_entries_r, if (!parallel) { assert(b[v] == int(r)); - move_vertex(v, s, b, cv, vmap, wr, vweight, deg_corr, - states, not random_move, ostats); + move_vertex(v, s, b, cv, vmap, deg_corr, states, + not random_move); S += dS; ++nmoves; @@ -2676,8 +2670,8 @@ void move_sweep(vector& states, vector& m_entries_r, if (dS > 0 && std::isinf(beta)) continue; - move_vertex(v, s, b, cv, vmap, wr, vweight, deg_corr, states, - not random_move, ostats); + move_vertex(v, s, b, cv, vmap, deg_corr, states, + not random_move); S += dS; ++nmoves; @@ -2755,8 +2749,7 @@ void move_sweep(vector& states, vector& m_entries_r, double dS = virtual_move(v, s, b, cv, vmap, states, m_entries, dense, deg_corr, multigraph); - move_vertex(v, s, b, cv, vmap, wr, vweight, deg_corr, states, false, - ostats); + move_vertex(v, s, b, cv, vmap, deg_corr, states, false); size_t i = 0, j = 0; auto l_v = cv[v][0]; diff --git a/src/graph/community/graph_blockmodel_covariates.cc b/src/graph/community/graph_blockmodel_covariates.cc index ef5e4732475edf7f6d51a80058ac05e3870fd7d3..85dd5a541c65c0e941411de6174e33ccbe63a7bc 100644 --- a/src/graph/community/graph_blockmodel_covariates.cc +++ b/src/graph/community/graph_blockmodel_covariates.cc @@ -324,7 +324,6 @@ struct cov_move_sweep_dispatch move_sweep(states, m_entries, wr[0].get().get_unchecked(B), b.get_unchecked(num_vertices(g)), - ce.get_unchecked(meindex), cv.get_unchecked(num_vertices(g)), vmap.get_unchecked(num_vertices(g)), label.get_unchecked(B), @@ -336,7 +335,7 @@ struct cov_move_sweep_dispatch nmerges, merge_map.get_unchecked(num_vertices(g)), niter, B, - verbose, rng, S, nmoves, ostats); + verbose, rng, S, nmoves); } else { @@ -387,10 +386,9 @@ struct cov_move_sweep_dispatch { move_sweep_overlap(states, m_entries, overlap_stats[0].get(), wr[0].get().get_unchecked(B), - b.get_unchecked(num_vertices(g)), ce, cv, + b.get_unchecked(num_vertices(g)), cv, vmap, label.get_unchecked(B), vlist, deg_corr, dense, multigraph, beta, - eweight[0].get().get_unchecked(max_edge_index[0]), vweight[0].get().get_unchecked(num_vertices(g)), g, sequential, parallel, random_move, c, niter, B, verbose, rng, S, nmoves); @@ -402,14 +400,13 @@ struct cov_move_sweep_dispatch m_entries.emplace_back(num_vertices(state.bg)); coherent_move_sweep_overlap(states, m_entries, overlap_stats[0].get(), wr[0].get().get_unchecked(B), - b.get_unchecked(num_vertices(g)), ce, cv, + b.get_unchecked(num_vertices(g)), cv, vmap, label.get_unchecked(B), vlist, deg_corr, dense, multigraph, beta, - eweight[0].get().get_unchecked(max_edge_index[0]), vweight[0].get().get_unchecked(num_vertices(g)), g, - sequential, parallel, random_move, c, + sequential, random_move, c, confine_layers, niter, - B, verbose, rng, S, nmoves); + B, rng, S, nmoves); } } else @@ -417,14 +414,10 @@ struct cov_move_sweep_dispatch merge_sweep_overlap(states, m_entries, overlap_stats[0].get(), wr[0].get().get_unchecked(B), b.get_unchecked(num_vertices(g)), ce, cv, - vmap, label.get_unchecked(B), - vlist, deg_corr, dense, multigraph, beta, - eweight[0].get().get_unchecked(max_edge_index[0]), - vweight[0].get().get_unchecked(num_vertices(g)), g, - sequential, parallel, random_move, c, confine_layers, - nmerges, niter, - merge_map.get_unchecked(num_vertices(g)), - B, verbose, rng, S, nmoves); + vmap, label.get_unchecked(B), vlist, + deg_corr, dense, multigraph, g, + random_move, confine_layers, nmerges, niter, + B, rng, S, nmoves); } } } diff --git a/src/graph/community/graph_blockmodel_overlap.cc b/src/graph/community/graph_blockmodel_overlap.cc index 8025c9230048b400c4c30cbc748005368650560a..0a2f814c323281d600a0465371ca4648a5e5493e 100644 --- a/src/graph/community/graph_blockmodel_overlap.cc +++ b/src/graph/community/graph_blockmodel_overlap.cc @@ -215,10 +215,9 @@ struct move_sweep_overlap_dispatch { move_sweep_overlap(states, m_entries, overlap_stats, wr.get_unchecked(num_vertices(bg)), - b.get_unchecked(num_vertices(g)), ce, cv, + b.get_unchecked(num_vertices(g)), cv, vmap, label.get_unchecked(num_vertices(bg)), vlist, deg_corr, dense, multigraph, beta, - eweight.get_unchecked(max_edge_index), vweight.get_unchecked(num_vertices(g)), g, sequential, parallel, random_move, c, niter, num_vertices(bg), verbose, rng, S, nmoves); @@ -228,29 +227,24 @@ struct move_sweep_overlap_dispatch vector> m_entries(1, EntrySet(num_vertices(bg))); coherent_move_sweep_overlap(states, m_entries, overlap_stats, wr.get_unchecked(num_vertices(bg)), - b.get_unchecked(num_vertices(g)), ce, cv, + b.get_unchecked(num_vertices(g)), cv, vmap, label.get_unchecked(num_vertices(bg)), vlist, deg_corr, dense, multigraph, beta, - eweight.get_unchecked(max_edge_index), vweight.get_unchecked(num_vertices(g)), g, - sequential, parallel, random_move, c, + sequential, random_move, c, false, niter, - num_vertices(bg), verbose, rng, S, nmoves); + num_vertices(bg), rng, S, nmoves); } } else { merge_sweep_overlap(states, m_entries, overlap_stats, wr.get_unchecked(num_vertices(bg)), - b.get_unchecked(num_vertices(g)), ce, cv, - vmap, label.get_unchecked(num_vertices(bg)), - vlist, deg_corr, dense, multigraph, beta, - eweight.get_unchecked(max_edge_index), - vweight.get_unchecked(num_vertices(g)), g, - sequential, parallel, random_move, c, false, - nmerges, niter, - merge_map.get_unchecked(num_vertices(g)), - num_vertices(bg), verbose, rng, S, nmoves); + b.get_unchecked(num_vertices(g)), ce, cv, vmap, + label.get_unchecked(num_vertices(bg)), vlist, + deg_corr, dense, multigraph, g, random_move, + false, nmerges, niter, + num_vertices(bg), rng, S, nmoves); } } }; @@ -387,19 +381,13 @@ do_get_overlap_partition_stats(GraphInterface& gi, boost::any ob, return partition_stats; } -double do_get_overlap_parallel_entropy(GraphInterface& gi, boost::any ob, +double do_get_overlap_parallel_entropy(GraphInterface& gi, overlap_stats_t& overlap_stats) { - typedef property_map_type::apply::type - vmap_t; - - vmap_t b = any_cast(ob); - double S = 0; run_action<>() (gi, std::bind(entropy_parallel_edges_overlap(), - placeholders::_1, b, std::ref(overlap_stats), + placeholders::_1, std::ref(overlap_stats), std::ref(S)))(); return S; } @@ -513,9 +501,6 @@ void do_get_be_overlap(GraphInterface& gi, GraphInterface& egi, boost::any obe, typedef property_map_type::apply, GraphInterface::edge_index_map_t>::type evmap_t; - typedef property_map_type::apply::type - emap_t; vmap_t b = any_cast(ob); evmap_t be = any_cast(obe); @@ -642,9 +627,6 @@ void do_get_bv_overlap(GraphInterface& gi, boost::any ob, boost::any onode_inde typedef property_map_type::apply, GraphInterface::vertex_index_map_t>::type vvmap_t; - typedef property_map_type::apply, - GraphInterface::edge_index_map_t>::type - evmap_t; vmap_t b = any_cast(ob); vimap_t node_index = any_cast(onode_index); @@ -662,8 +644,6 @@ struct get_wr_overlap template void operator()(Graph& g, VVProp bv, VProp wr) const { - typedef typename graph_traits::vertex_descriptor vertex_t; - for (auto v : vertices_range(g)) { for (size_t i = 0; i < bv[v].size(); ++i) @@ -728,9 +708,6 @@ struct get_augmented_overlap void operator()(Graph& g, VProp b, VIProp node_index, VProp br_map, vector& br_b, vector& br_ni) const { - - typedef typename graph_traits::vertex_descriptor vertex_t; - unordered_map, size_t> idx_map; vector> idx_rmap; size_t pos = 0; @@ -824,8 +801,6 @@ struct get_maj_overlap template void operator()(Graph& g, VVProp bv, VVProp bc_total, VProp b) const { - typedef typename graph_traits::vertex_descriptor vertex_t; - for (auto v : vertices_range(g)) { if (bv[v].empty()) diff --git a/src/graph/community/graph_blockmodel_overlap.hh b/src/graph/community/graph_blockmodel_overlap.hh index 9c105caac54c990f6d1bab2fbbce3a02bc9c966b..c59ceea86d7e0aed079d6b6ebe9ea61bebc1d1cf 100644 --- a/src/graph/community/graph_blockmodel_overlap.hh +++ b/src/graph/community/graph_blockmodel_overlap.hh @@ -145,7 +145,7 @@ public: } template - void add_half_edge(size_t v, size_t v_r, VProp& b, Graph& g) + void add_half_edge(size_t v, size_t v_r, VProp& b, Graph&) { size_t u = _node_index[v]; size_t kin = (_in_neighbours[v] == -1) ? 0 : 1; @@ -179,7 +179,7 @@ public: } template - void remove_half_edge(size_t v, size_t v_r, VProp& b, Graph& g) + void remove_half_edge(size_t v, size_t v_r, VProp& b, Graph&) { size_t u = _node_index[v]; size_t kin = (_in_neighbours[v] == -1) ? 0 : 1; @@ -285,7 +285,7 @@ public: template double virtual_move_parallel_dS(size_t v, size_t v_r, size_t v_nr, VProp& b, - Graph& g, bool coherent=false) const + Graph&, bool coherent=false) const { int m = _mi[v]; if (m == -1) @@ -1079,7 +1079,7 @@ struct overlap_partition_stats_t } template - void move_vertex(size_t v, size_t r, size_t nr, bool deg_corr, + void move_vertex(size_t v, size_t r, size_t nr, bool, overlap_stats_t& overlap_stats, Graph& g, size_t in_deg = 0, size_t out_deg = 0) { @@ -1229,8 +1229,8 @@ private: struct entropy_parallel_edges_overlap { - template - void operator()(Graph& g, VProp b, overlap_stats_t& overlap_stats, double& S) const + template + void operator()(Graph&, overlap_stats_t& overlap_stats, double& S) const { S = 0; for(auto& h : overlap_stats.get_parallel_bundles()) @@ -1278,7 +1278,7 @@ struct half_edge_neighbour_policy template iter_range_t - get_out_edges(Vertex v, Graph& g) const + get_out_edges(Vertex v, Graph&) const { const auto& e = _out_edges[v]; if (e != edge_t()) @@ -1289,7 +1289,7 @@ struct half_edge_neighbour_policy template iter_range_t - get_in_edges(Vertex v, Graph& g) const + get_in_edges(Vertex v, Graph&) const { const auto& e = _in_edges[v]; if (e != edge_t()) @@ -1299,13 +1299,13 @@ struct half_edge_neighbour_policy } template - int get_out_degree(Vertex& v, Graph& g, Weight& eweight) const + int get_out_degree(Vertex& v, Graph& g, Weight&) const { return out_degreeS()(v, g); } template - int get_in_degree(Vertex& v, Graph& g, Weight& eweight) const + int get_in_degree(Vertex& v, Graph& g, Weight&) const { return in_degreeS()(v, g); } @@ -1318,7 +1318,7 @@ class SingleEntrySet public: SingleEntrySet() : _pos(0) {} - void set_move(size_t r, size_t nr) {} + void set_move(size_t, size_t) {} __attribute__((always_inline)) void insert_delta(size_t r, size_t s, int delta, bool source) @@ -1364,17 +1364,17 @@ size_t get_lateral_half_edge(size_t v, } //A single Monte Carlo Markov chain sweep -template +template void move_sweep_overlap(vector& states, vector& m_entries_r, overlap_stats_t& overlap_stats, Vprop wr, Vprop b, - EVprop ce, VLprop cv, VVprop vmap, Vprop clabel, + VLprop cv, VVprop vmap, Vprop clabel, vector& vlist, bool deg_corr, bool dense, - bool multigraph, double beta, Eprop eweight, - Vprop vweight, Graph& g, bool sequential, bool parallel, - bool random_move, double c, size_t niter, size_t B, - bool verbose, RNG& rng, double& S, size_t& nmoves) + bool multigraph, double beta, Vprop vweight, Graph& g, + bool sequential, bool parallel, bool random_move, + double c, size_t niter, size_t B, bool verbose, + RNG& rng, double& S, size_t& nmoves) { typedef typename graph_traits::vertex_descriptor vertex_t; @@ -1552,9 +1552,8 @@ void move_sweep_overlap(vector& states, { assert(b[v] == int(r)); - move_vertex(v, s, b, cv, vmap, wr, vweight, deg_corr, - states, not random_move, overlap_stats, - npolicy); + move_vertex(v, s, b, cv, vmap, deg_corr, states, + not random_move, npolicy); S += dS; ++nmoves; @@ -1588,9 +1587,8 @@ void move_sweep_overlap(vector& states, assert (!std::isinf(dS) && !std::isnan(dS)); if (dS > 0 && std::isinf(beta)) continue; - move_vertex(v, s, b, cv, vmap, wr, vweight, deg_corr, - states, not random_move, overlap_stats, - npolicy); + move_vertex(v, s, b, cv, vmap, deg_corr, states, + not random_move, npolicy); S += dS; ++nmoves; } @@ -1614,20 +1612,17 @@ size_t get_ce(size_t v, CEMap& ce, Graph& g) return 0; } -template +template void coherent_move_sweep_overlap(vector& states, vector& m_entries, overlap_stats_t& overlap_stats, Vprop wr, - Vprop b, EVprop ce, VLprop cv, VVprop vmap, - Vprop clabel, vector& vlist, - bool deg_corr, bool dense, bool multigraph, - double beta, Eprop eweight, Vprop vweight, - Graph& g, bool sequential, bool parallel, - bool random_move, double c, - bool confine_layers, size_t niter, size_t B, - bool verbose, RNG& rng, double& S, - size_t& nmoves) + Vprop b, VLprop cv, VVprop vmap, Vprop clabel, + vector& vlist, bool deg_corr, bool dense, + bool multigraph, double beta, Vprop vweight, + Graph& g, bool sequential, bool random_move, + double c, bool confine_layers, size_t niter, + size_t B, RNG& rng, double& S, size_t& nmoves) { typedef typename graph_traits::vertex_descriptor vertex_t; @@ -1810,8 +1805,8 @@ void coherent_move_sweep_overlap(vector& states, { S += dS; nmoves += vs.size(); - move_vertex(vs, s, b, cv, vmap, wr, vweight, deg_corr, states, - not random_move, overlap_stats, npolicy); + move_vertex(vs, s, b, cv, vmap, deg_corr, states, + not random_move, npolicy); } } } @@ -1820,18 +1815,15 @@ void coherent_move_sweep_overlap(vector& states, //A single Monte Carlo Markov chain sweep template + class RNG, class BlockState, class MEntries> void merge_sweep_overlap(vector& states, vector& m_entries, overlap_stats_t& overlap_stats, Vprop wr, Vprop b, EVprop ce, VLprop cv, VVprop vmap, Vprop clabel, vector& vlist, bool deg_corr, bool dense, - bool multigraph, double beta, Eprop eweight, - Vprop vweight, Graph& g, bool sequential, - bool parallel, bool random_move, double c, + bool multigraph, Graph& g, bool random_move, size_t confine_layers, size_t nmerges, size_t ntries, - Vprop merge_map, size_t B, bool verbose, RNG& rng, - double& S, size_t& nmoves) + size_t B, RNG& rng, double& S, size_t& nmoves) { typedef typename graph_traits::vertex_descriptor vertex_t; @@ -1931,8 +1923,8 @@ void merge_sweep_overlap(vector& states, { ddS += virtual_move(u, s, b, cv, vmap, states, m_entries, dense, deg_corr, multigraph, npolicy); - move_vertex(u, s, b, cv, vmap, wr, vweight, deg_corr, - states, false, overlap_stats, npolicy); + move_vertex(u, s, b, cv, vmap, deg_corr, states, false, + npolicy); } @@ -1946,9 +1938,8 @@ void merge_sweep_overlap(vector& states, { for (auto u : bundle) { - move_vertex(u, best_move[u], b, cv, vmap, wr, vweight, - deg_corr, states, false, overlap_stats, - npolicy); + move_vertex(u, best_move[u], b, cv, vmap, deg_corr, + states, false, npolicy); } } @@ -1958,8 +1949,7 @@ void merge_sweep_overlap(vector& states, // reset for (auto v : groups[r]) { - move_vertex(v, r, b, cv, vmap, wr, vweight, deg_corr, states, false, - overlap_stats, npolicy); + move_vertex(v, r, b, cv, vmap, deg_corr, states, false, npolicy); } best_move_dS[r] = dS; @@ -2010,8 +2000,7 @@ void merge_sweep_overlap(vector& states, //assert(s != r); double dS = virtual_move(v, s, b, cv, vmap, states, m_entries, dense, deg_corr, multigraph, npolicy); - move_vertex(v, s, b, cv, vmap, wr, vweight, deg_corr, - states, false, overlap_stats, npolicy); + move_vertex(v, s, b, cv, vmap, deg_corr, states, false, npolicy); S += dS; } diff --git a/src/graph/community/graph_community.hh b/src/graph/community/graph_community.hh index 110ead7dec9dd25b01b10d976b7db28fbabc5414..d0728fd90a80a507cb4f043539f823f6f375e0c8 100644 --- a/src/graph/community/graph_community.hh +++ b/src/graph/community/graph_community.hh @@ -54,7 +54,6 @@ struct get_communities pair verbose) const { typedef typename graph_traits::vertex_descriptor vertex_t; - typedef typename graph_traits::edge_descriptor edge_t; typedef typename property_traits::key_type weight_key_t; @@ -490,10 +489,6 @@ struct get_modularity template void operator()(const Graph& g, WeightMap weights, CommunityMap b, double& Q) const { - typedef typename property_traits::key_type weight_key_t; - typedef typename property_traits::value_type weight_val_t; - typedef typename property_traits::value_type s_val_t; - vector er, err; double W = 0; diff --git a/src/graph/community/graph_community_network.hh b/src/graph/community/graph_community_network.hh index 3470c43af1071ac9c36008829c6bf7f6c36f1081..66f723a8ad88bf6cc998b154d30e21746870b9da 100644 --- a/src/graph/community/graph_community_network.hh +++ b/src/graph/community/graph_community_network.hh @@ -45,15 +45,10 @@ struct get_community_network_vertices VertexProperty vertex_count) const { typedef typename graph_traits::vertex_descriptor vertex_t; - typedef typename graph_traits::edge_descriptor edge_t; typedef typename graph_traits::vertex_descriptor cvertex_t; - typedef typename graph_traits::edge_descriptor - cedge_t; typedef typename boost::property_traits::value_type s_type; - typedef typename boost::property_traits::value_type - vprop_type; #ifdef HAVE_SPARSEHASH google::dense_hash_map > comms; @@ -114,7 +109,6 @@ struct get_community_network_edges bool self_loops, bool parallel_edges) const { typedef typename graph_traits::vertex_descriptor vertex_t; - typedef typename graph_traits::edge_descriptor edge_t; typedef typename graph_traits::vertex_descriptor cvertex_t; typedef typename graph_traits::edge_descriptor @@ -262,9 +256,6 @@ struct get_vertex_community_property_sum CCommunityMap cs_map, Vprop vprop, Vprop cvprop) const { typedef typename graph_traits::vertex_descriptor vertex_t; - typedef typename graph_traits::edge_descriptor edge_t; - typedef typename graph_traits::vertex_descriptor - cvertex_t; typedef typename boost::property_traits::value_type s_type; @@ -308,7 +299,6 @@ struct get_edge_community_property_sum bool self_loops) const { typedef typename graph_traits::vertex_descriptor vertex_t; - typedef typename graph_traits::edge_descriptor edge_t; typedef typename graph_traits::vertex_descriptor cvertex_t; typedef typename graph_traits::edge_descriptor diff --git a/src/graph/community/graph_community_network_eavg.cc b/src/graph/community/graph_community_network_eavg.cc index 01c387d23442aa5c254850215d1d64f405748a85..0c7c3175a06d017cd363ee4071e0655410c95cb2 100644 --- a/src/graph/community/graph_community_network_eavg.cc +++ b/src/graph/community/graph_community_network_eavg.cc @@ -57,7 +57,6 @@ void sum_eprops(GraphInterface& gi, GraphInterface& cgi, void community_network_eavg(GraphInterface& gi, GraphInterface& cgi, boost::any community_property, boost::any condensed_community_property, - boost::any edge_count, boost::any eweight, boost::python::list aeprops, bool self_loops) diff --git a/src/graph/community/graph_community_network_vavg.cc b/src/graph/community/graph_community_network_vavg.cc index 32a574e5f2eb330676d7c35d49d0a809ddea6fbc..d1b817fee8114943be75249a9af6d9ab0d029d69 100644 --- a/src/graph/community/graph_community_network_vavg.cc +++ b/src/graph/community/graph_community_network_vavg.cc @@ -67,7 +67,6 @@ struct get_vertex_sum_dispatch void community_network_vavg(GraphInterface& gi, GraphInterface& cgi, boost::any community_property, boost::any condensed_community_property, - boost::any vertex_count, boost::any vweight, boost::python::list avprops) { diff --git a/src/graph/generation/graph_line_graph.cc b/src/graph/generation/graph_line_graph.cc index 5d253b41ef11b7824ff163b73c7e20ff1d861285..da134ab5f7f23c5a680cc476dbff6296466c0509 100644 --- a/src/graph/generation/graph_line_graph.cc +++ b/src/graph/generation/graph_line_graph.cc @@ -33,9 +33,6 @@ struct get_line_graph LineGraph& line_graph, EdgeIndexMap edge_index, LGVertexIndex vmap) const { - typedef typename graph_traits::vertex_descriptor vertex_t; - typedef boost::property EdgeProperty; - typedef typename graph_traits::vertex_descriptor lg_vertex_t; typedef HashedDescriptorMap edge_to_vertex_map_t; diff --git a/src/graph/generation/graph_rewiring.hh b/src/graph/generation/graph_rewiring.hh index 6f266b64287b8f112ab68c0d5b307bc1cef9ec54..4e0d50f773e47860d08bd4a1bda075a2c51e34bd 100644 --- a/src/graph/generation/graph_rewiring.hh +++ b/src/graph/generation/graph_rewiring.hh @@ -67,7 +67,7 @@ target(const pair& e, template -void add_count(size_t s, size_t t, Nmap& nvmap, Graph& g) +void add_count(size_t s, size_t t, Nmap& nvmap, Graph&) { if (!is_directed::apply::type::value && s > t) std::swap(s, t); @@ -76,7 +76,7 @@ void add_count(size_t s, size_t t, Nmap& nvmap, Graph& g) } template -void remove_count(size_t s, size_t t, Nmap& nvmap, Graph& g) +void remove_count(size_t s, size_t t, Nmap& nvmap, Graph&) { if (!is_directed::apply::type::value && s > t) std::swap(s, t); @@ -88,7 +88,7 @@ void remove_count(size_t s, size_t t, Nmap& nvmap, Graph& g) } template -size_t get_count(size_t s, size_t t, Nmap& nvmap, Graph& g) +size_t get_count(size_t s, size_t t, Nmap& nvmap, Graph&) { if (!is_directed::apply::type::value && s > t) std::swap(s, t); @@ -384,7 +384,7 @@ public: ErdosRewireStrategy(Graph& g, EdgeIndexMap edge_index, vector& edges, CorrProb, BlockDeg, - bool, rng_t& rng, bool parallel_edges) + bool, rng_t& rng, bool) : _g(g), _edge_index(edge_index), _edges(edges), _vertices(HardNumVertices()(g)), _rng(rng) { @@ -566,7 +566,7 @@ public: bool, rng_t& rng, bool parallel_edges) : base_t(g, edge_index, edges, rng, parallel_edges), _g(g) {} - pair get_target_edge(pair& e, bool parallel_edges) + pair get_target_edge(pair& e, bool) { std::uniform_int_distribution<> sample(0, base_t::_edges.size() - 1); pair et = make_pair(sample(base_t::_rng), false); @@ -637,7 +637,7 @@ public: } } - pair get_target_edge(pair& e, bool parallel_edge) + pair get_target_edge(pair& e, bool) { if (!is_directed::apply::type::value) { @@ -769,8 +769,7 @@ public: return _blockdeg.get_block(v, g); } - pair get_target_edge(pair& e, - bool parallel_edges) + pair get_target_edge(pair& e, bool) { if (!is_directed::apply::type::value) { @@ -1017,8 +1016,7 @@ public: return _blockdeg.get_block(v, g); } - pair get_target_edge(pair& e, - bool parallel_edges) + pair get_target_edge(pair& e, bool) { if (!is_directed::apply::type::value) { @@ -1240,7 +1238,7 @@ public: TradBlockRewireStrategy(Graph& g, EdgeIndexMap edge_index, vector& edges, CorrProb corr_prob, BlockDeg blockdeg, bool, rng_t& rng, - bool parallel_edges) + bool) : _g(g), _edge_index(edge_index), _edges(edges), _corr_prob(corr_prob), _blockdeg(blockdeg), _rng(rng), _sampler(nullptr) diff --git a/src/graph/graph_bind.cc b/src/graph/graph_bind.cc index 05a57fc1c53a7a1bdc48f720162b232f5141200e..8e85b13f1624e11f7681d94491cee1b16a23b18a 100644 --- a/src/graph/graph_bind.cc +++ b/src/graph/graph_bind.cc @@ -147,7 +147,7 @@ struct export_vector_types } template - void wrap_array(class_ >& vc, boost::mpl::false_) const + void wrap_array(class_ >&, boost::mpl::false_) const { } }; @@ -359,7 +359,7 @@ struct graph_type_name { typedef void result_type; template - void operator()(const Graph& g, string& name) const + void operator()(const Graph&, string& name) const { using boost::python::detail::gcc_demangle; name = string(gcc_demangle(typeid(Graph).name())); diff --git a/src/graph/graph_io.cc b/src/graph/graph_io.cc index 7cb80babb964dc5c5e0575471336586528d08b07..496d864e1dadf6e1a33bacf6852388d760b14de2 100644 --- a/src/graph/graph_io.cc +++ b/src/graph/graph_io.cc @@ -453,8 +453,6 @@ struct write_to_file void operator()(ostream& stream, Graph& g, IndexMap index_map, dynamic_properties& dp, const string& format) const { - typedef typename graph_traits::vertex_descriptor vertex_t; - if (format == "dot") { string name = graphviz_insert_index(dp, index_map, false); diff --git a/src/graph/graph_io_binary.hh b/src/graph/graph_io_binary.hh index 41953594f737100612afcd07d9c511d8b77191ff..f7f938d8fa18a9e6195da69218dcb580257b0edf 100644 --- a/src/graph/graph_io_binary.hh +++ b/src/graph/graph_io_binary.hh @@ -259,7 +259,7 @@ struct graph_range_traits { typedef GraphInterface::graph_index_map_t index_map_t; template - static index_map_t get_index_map(Graph& g) { return index_map_t(0); } + static index_map_t get_index_map(Graph&) { return index_map_t(0); } struct graph_range { diff --git a/src/graph/graph_properties_imp2.cc b/src/graph/graph_properties_imp2.cc index 7df0cc0592e85ee9cd589fa3b29e1a9bee7004f8..d6d9048c0317f96b4c2558358c2f15af387bcea1 100644 --- a/src/graph/graph_properties_imp2.cc +++ b/src/graph/graph_properties_imp2.cc @@ -35,7 +35,7 @@ void operator+=(std::vector& v1, const std::vector& v2) v1[i] += v2[i]; } -void operator*=(std::string& v1, const std::string& v2) +void operator*=(std::string&, const std::string&) { throw GraphException("Cannot multiply strings."); } @@ -157,7 +157,6 @@ struct do_out_edges_op typename mpl::if_, int64_t, eval_t>::type, GraphInterface::vertex_index_map_t>::type VProp; - typedef typename property_traits::value_type vval_t; auto vprop = boost::any_cast(avprop).get_unchecked(num_vertices(g)); diff --git a/src/graph/graph_python_interface.cc b/src/graph/graph_python_interface.cc index acc46c9e8227d66be866fe0342dadcfd92838fad..bd58be29549961a1fc3f2357072d91ea6220180b 100644 --- a/src/graph/graph_python_interface.cc +++ b/src/graph/graph_python_interface.cc @@ -190,11 +190,10 @@ python::object add_edge(python::object g, const python::object& s, struct get_edge_descriptor { template - void operator()(const Graph& g, const python::object& e, + void operator()(const Graph&, const python::object& e, typename GraphInterface::edge_t& edge, bool& found) const { - typedef typename graph_traits::edge_descriptor edge_t; PythonEdge& pe = python::extract&>(e); pe.CheckValid(); pe.SetValid(false); diff --git a/src/graph/graph_python_interface.hh b/src/graph/graph_python_interface.hh index 0388db4f917ed6b8dcf50fd3a707267c363d8b00..ba97e6ee97f27d60afdd330a74f5c3b4d89f423c 100644 --- a/src/graph/graph_python_interface.hh +++ b/src/graph/graph_python_interface.hh @@ -463,7 +463,7 @@ public: } template - void set_value(const PythonDescriptor& key, const value_type& val, + void set_value(const PythonDescriptor&, const value_type&, std::false_type) { throw ValueException("property is read-only"); @@ -508,16 +508,16 @@ public: typename boost::mpl::not_< typename boost::mpl::has_key::type > ::type>::type isnt_vector_map; - return get_array(_pmap, size, isnt_vector_map()); + return get_array(size, isnt_vector_map()); } - boost::python::object get_array(PropertyMap pmap, size_t size, boost::mpl::bool_) + boost::python::object get_array(size_t size, boost::mpl::bool_) { _pmap.reserve(size); return wrap_vector_not_owned(_pmap.get_storage()); } - boost::python::object get_array(PropertyMap pmap, size_t size, boost::mpl::bool_) + boost::python::object get_array(size_t, boost::mpl::bool_) { return boost::python::object(); } diff --git a/src/graph/graph_util.hh b/src/graph/graph_util.hh index b968a72635939cca54a457a81d76c2a2d4517563..8a2d47a9bd2ce7ceadc11be25cfe3fde38231d80 100644 --- a/src/graph/graph_util.hh +++ b/src/graph/graph_util.hh @@ -534,7 +534,7 @@ struct tuple_combine template struct tuple_combine<0, T...> { - void operator()(size_t& seed, const std::tuple& v) const {} + void operator()(size_t&, const std::tuple&) const {} }; template diff --git a/src/graph/layout/graph_fruchterman_reingold.cc b/src/graph/layout/graph_fruchterman_reingold.cc index 7e98adb22895a58e568515d6c81242e4a7c85fae..dadc3996745b6e109b1a5207b6ff9752ce49f74c 100644 --- a/src/graph/layout/graph_fruchterman_reingold.cc +++ b/src/graph/layout/graph_fruchterman_reingold.cc @@ -121,8 +121,7 @@ struct get_layout Value _r; template - Value operator()(Vertex v1, Vertex v2, KVal k, DVal dist, - const Graph&) const + Value operator()(Vertex, Vertex, KVal k, DVal dist, const Graph&) const { return _r * power(k, 2) / dist; } diff --git a/src/graph/layout/graph_sfdp.cc b/src/graph/layout/graph_sfdp.cc index ae1152745034df6d9a6025dc62351a51b06f308d..1dd42c8d7a32f7217fb8b0986c4209714042102f 100644 --- a/src/graph/layout/graph_sfdp.cc +++ b/src/graph/layout/graph_sfdp.cc @@ -70,7 +70,7 @@ void sfdp_layout(GraphInterface& g, boost::any pos, boost::any vweight, std::bind(get_sfdp_layout(C, K, p, theta, gamma, mu, mu_p, init_step, step_schedule, max_level, epsilon, max_iter, adaptive), - placeholders::_1, g.GetVertexIndex(), placeholders::_2, + placeholders::_1, placeholders::_2, placeholders::_3, placeholders::_4, pin_map.get_unchecked(num_vertices(g.GetGraph())), groups.get_unchecked(num_vertices(g.GetGraph())), verbose, diff --git a/src/graph/layout/graph_sfdp.hh b/src/graph/layout/graph_sfdp.hh index 6c6e05396d9879dbf007e942efe21f7b96521b0a..a73990bc922e5f46f93ac86f7b02739aa0375eba 100644 --- a/src/graph/layout/graph_sfdp.hh +++ b/src/graph/layout/graph_sfdp.hh @@ -201,11 +201,11 @@ struct get_sfdp_layout size_t max_level, max_iter; bool simple; - template - void operator()(Graph& g, VertexIndex vertex_index, PosMap pos, - VertexWeightMap vweight, EdgeWeightMap eweight, PinMap pin, - GroupMap group, bool verbose, RNG& rng) const + void operator()(Graph& g, PosMap pos, VertexWeightMap vweight, + EdgeWeightMap eweight, PinMap pin, GroupMap group, + bool verbose, RNG& rng) const { typedef typename property_traits::value_type pos_t; typedef typename property_traits::value_type::value_type val_t; diff --git a/src/graph/mpl_nested_loop.hh b/src/graph/mpl_nested_loop.hh index c0b08f17f86d11e4483d858cfbdf7c928dc917b4..a3277d4ad4a5accce51533701b5c80e9c59aad0b 100644 --- a/src/graph/mpl_nested_loop.hh +++ b/src/graph/mpl_nested_loop.hh @@ -169,14 +169,14 @@ struct selected_types } template - void dispatch(unsigned int i, std::tuple<>, Args&&... args) const + void dispatch(unsigned int, std::tuple<>, Args&&... args) const { _a(std::forward(args)...); _found = true; } template - void operator()(Ts&&... ts) const + void operator()(Ts&&...) const { dispatch(0, std::tuple()); } diff --git a/src/graph/search/graph_astar.hh b/src/graph/search/graph_astar.hh index bb29291736cfd8b2ec222ef00acd0398c7ce9781..b8820f0ec72e463662fbdc3064fa4a067fd8ad06 100644 --- a/src/graph/search/graph_astar.hh +++ b/src/graph/search/graph_astar.hh @@ -70,7 +70,7 @@ public: } template - void edge_not_relaxed(Edge e, const Graph& g) + void edge_not_relaxed(Edge e, const Graph&) { _vis.attr("edge_not_relaxed") (PythonEdge(_gi, e)); diff --git a/src/graph/search/graph_bellman_ford.cc b/src/graph/search/graph_bellman_ford.cc index 14cdf47ed354ecc98e552927edbc6666221805a4..1b4c532596c5405a601ed6cd4a4cf26820587b46 100644 --- a/src/graph/search/graph_bellman_ford.cc +++ b/src/graph/search/graph_bellman_ford.cc @@ -37,35 +37,35 @@ public: : _gi(gi), _vis(vis) {} template - void examine_edge(Edge e, const Graph& g) + void examine_edge(Edge e, const Graph&) { _vis.attr("examine_edge") (PythonEdge(_gi, e)); } template - void edge_relaxed(Edge e, const Graph& g) + void edge_relaxed(Edge e, const Graph&) { _vis.attr("edge_relaxed") (PythonEdge(_gi, e)); } template - void edge_not_relaxed(Edge e, const Graph& g) + void edge_not_relaxed(Edge e, const Graph&) { _vis.attr("edge_not_relaxed") (PythonEdge(_gi, e)); } template - void edge_minimized(Edge e, const Graph& g) + void edge_minimized(Edge e, const Graph&) { _vis.attr("edge_minimized") (PythonEdge(_gi, e)); } template - void edge_not_minimized(Edge e, const Graph& g) + void edge_not_minimized(Edge e, const Graph&) { _vis.attr("edge_not_minimized") (PythonEdge(_gi, e)); diff --git a/src/graph/search/graph_bfs.cc b/src/graph/search/graph_bfs.cc index 5f7f159125e92be2420c0b58209e39141a7b1c0a..7ceba9c4bcd8b3ae8ece293ee55a270250438422 100644 --- a/src/graph/search/graph_bfs.cc +++ b/src/graph/search/graph_bfs.cc @@ -36,60 +36,60 @@ public: : _gi(gi), _vis(vis) {} template - void initialize_vertex(Vertex u, const Graph& g) + void initialize_vertex(Vertex u, const Graph&) { _vis.attr("initialize_vertex")(PythonVertex(_gi, u)); } template - void discover_vertex(Vertex u, const Graph& g) + void discover_vertex(Vertex u, const Graph&) { _vis.attr("discover_vertex")(PythonVertex(_gi, u)); } template - void examine_vertex(Vertex u, const Graph& g) + void examine_vertex(Vertex u, const Graph&) { _vis.attr("examine_vertex")(PythonVertex(_gi, u)); } template - void examine_edge(Edge e, const Graph& g) + void examine_edge(Edge e, const Graph&) { _vis.attr("examine_edge") (PythonEdge(_gi, e)); } template - void tree_edge(Edge e, const Graph& g) + void tree_edge(Edge e, const Graph&) { _vis.attr("tree_edge") (PythonEdge(_gi, e)); } template - void non_tree_edge(Edge e, const Graph& g) + void non_tree_edge(Edge e, const Graph&) { _vis.attr("non_tree_edge") (PythonEdge(_gi, e)); } template - void gray_target(Edge e, const Graph& g) + void gray_target(Edge e, const Graph&) { _vis.attr("gray_target") (PythonEdge(_gi, e)); } template - void black_target(Edge e, const Graph& g) + void black_target(Edge e, const Graph&) { _vis.attr("black_target") (PythonEdge(_gi, e)); } template - void finish_vertex(Vertex u, const Graph& g) + void finish_vertex(Vertex u, const Graph&) { _vis.attr("finish_vertex")(PythonVertex(_gi, u)); } diff --git a/src/graph/search/graph_dijkstra.cc b/src/graph/search/graph_dijkstra.cc index 278f6e742804b41d80ebacb059d6eea187d690bd..6853ca010e3d5d2d9678d8787b2b3c6b51f693d0 100644 --- a/src/graph/search/graph_dijkstra.cc +++ b/src/graph/search/graph_dijkstra.cc @@ -37,46 +37,46 @@ public: : _gi(gi), _vis(vis) {} template - void initialize_vertex(Vertex u, const Graph& g) + void initialize_vertex(Vertex u, const Graph&) { _vis.attr("initialize_vertex")(PythonVertex(_gi, u)); } template - void discover_vertex(Vertex u, const Graph& g) + void discover_vertex(Vertex u, const Graph&) { _vis.attr("discover_vertex")(PythonVertex(_gi, u)); } template - void examine_vertex(Vertex u, const Graph& g) + void examine_vertex(Vertex u, const Graph&) { _vis.attr("examine_vertex")(PythonVertex(_gi, u)); } template - void examine_edge(Edge e, const Graph& g) + void examine_edge(Edge e, const Graph&) { _vis.attr("examine_edge") (PythonEdge(_gi, e)); } template - void edge_relaxed(Edge e, const Graph& g) + void edge_relaxed(Edge e, const Graph&) { _vis.attr("edge_relaxed") (PythonEdge(_gi, e)); } template - void edge_not_relaxed(Edge e, const Graph& g) + void edge_not_relaxed(Edge e, const Graph&) { _vis.attr("edge_not_relaxed") (PythonEdge(_gi, e)); } template - void finish_vertex(Vertex u, const Graph& g) + void finish_vertex(Vertex u, const Graph&) { _vis.attr("finish_vertex")(PythonVertex(_gi, u)); } diff --git a/src/graph/stats/graph_average.hh b/src/graph/stats/graph_average.hh index d54435eefb016e01c0606813e33e0468b120970d..115c7d5384462e23e3fb824d512b37a6f020f0e8 100644 --- a/src/graph/stats/graph_average.hh +++ b/src/graph/stats/graph_average.hh @@ -72,7 +72,6 @@ struct get_average template void operator()(Graph& g, DegreeSelector deg) const { - typedef typename DegreeSelector::value_type value_type; long double a = 0, aa = 0; size_t count = 0; diff --git a/src/graph/stats/graph_parallel.cc b/src/graph/stats/graph_parallel.cc index 5eee5754b1ec670544e8f985646ae73e207e6ea3..d00eca426a14af192d933061b3034b7791544c3a 100644 --- a/src/graph/stats/graph_parallel.cc +++ b/src/graph/stats/graph_parallel.cc @@ -30,10 +30,10 @@ using namespace boost; using namespace graph_tool; void do_label_parallel_edges(GraphInterface& gi, boost::any property, - bool mark_only, bool count_all) + bool mark_only) { run_action<>()(gi, std::bind(label_parallel_edges(), placeholders::_1, - placeholders::_2, mark_only, count_all), + placeholders::_2, mark_only), writable_edge_scalar_properties())(property); } diff --git a/src/graph/stats/graph_parallel.hh b/src/graph/stats/graph_parallel.hh index 84513b6f839fe8f516ecbabc3011dfa46f07d172..b2c828bd78b1357b2d863709a8cc6765d086bf4f 100644 --- a/src/graph/stats/graph_parallel.hh +++ b/src/graph/stats/graph_parallel.hh @@ -35,15 +35,15 @@ using namespace boost; struct label_parallel_edges { template - void operator()(const Graph& g, ParallelMap parallel, bool mark_only, - bool count_all) const + void operator()(const Graph& g, ParallelMap parallel, bool mark_only) const { typedef typename graph_traits::vertex_descriptor vertex_t; typedef typename graph_traits::edge_descriptor edge_t; typename property_map::type eidx = get(edge_index, g); int i, N = num_vertices(g); - #pragma omp parallel for default(shared) private(i) schedule(runtime) if (N > 100) + #pragma omp parallel for default(shared) private(i) schedule(runtime) \ + if (N > 100) for (i = 0; i < N; ++i) { typename graph_traits::vertex_descriptor v = vertex(i, g); @@ -76,7 +76,7 @@ struct label_parallel_edges self_loops[eidx[*e]] = true; } - typeof(vset.begin()) iter = vset.find(u); + auto iter = vset.find(u); if (iter == vset.end()) { vset[u] = *e; @@ -104,8 +104,6 @@ struct label_self_loops template void operator()(const Graph& g, SelfMap self, bool mark_only) const { - typedef typename graph_traits::edge_descriptor edge_t; - int i, N = num_vertices(g); #pragma omp parallel for default(shared) private(i) schedule(runtime) if (N > 100) for (i = 0; i < N; ++i) diff --git a/src/graph/topology/graph_maximal_vertex_set.cc b/src/graph/topology/graph_maximal_vertex_set.cc index b9a8ae984b7b7ca1bda476c302ca6206766677e1..bb9999bd5633842fe02b8bd6b82751f64d5ef786 100644 --- a/src/graph/topology/graph_maximal_vertex_set.cc +++ b/src/graph/topology/graph_maximal_vertex_set.cc @@ -37,8 +37,6 @@ struct do_maximal_vertex_set bool high_deg, RNG& rng) const { typedef typename graph_traits::vertex_descriptor vertex_t; - typedef typename graph_traits::edge_descriptor edge_t; - typedef typename property_traits::value_type wval_t; uniform_real_distribution<> sample(0, 1); diff --git a/src/graph_tool/community/blockmodel.py b/src/graph_tool/community/blockmodel.py index a0695d9f1c639e94b7f9e3b115d9402af378a28b..226eeb494bf06492e2571eecfd1688e95ad6f13a 100644 --- a/src/graph_tool/community/blockmodel.py +++ b/src/graph_tool/community/blockmodel.py @@ -2809,20 +2809,20 @@ def condensation_graph(g, prop, vweight=None, eweight=None, avprops=None, _prop("e", g, eweight), self_loops, parallel_edges) + u = GraphView(g, directed=True, reversed=False) libcommunity.community_network_vavg(u._Graph__graph, gp._Graph__graph, _prop("v", g, prop), _prop("v", gp, cprop), - _prop("v", gp, vcount), _prop("v", g, vweight), avp) + u = GraphView(g, directed=True) libcommunity.community_network_eavg(u._Graph__graph, gp._Graph__graph, _prop("v", g, prop), _prop("v", gp, cprop), - _prop("e", gp, ecount), _prop("e", g, eweight), aep, self_loops) diff --git a/src/graph_tool/community/overlap_blockmodel.py b/src/graph_tool/community/overlap_blockmodel.py index 005b2d8e1f8ffebf7e1683f6e699b7ae3f30e9ca..0742bbba365d8d5ead5314ae950f3d0e6503cef5 100644 --- a/src/graph_tool/community/overlap_blockmodel.py +++ b/src/graph_tool/community/overlap_blockmodel.py @@ -576,7 +576,6 @@ class OverlapBlockState(BlockState): if multigraph: S += libcommunity.overlap_parallel_entropy(self.g._Graph__graph, - _prop("v", self.g, self.b), self.overlap_stats) if self.deg_corr: diff --git a/src/graph_tool/stats/__init__.py b/src/graph_tool/stats/__init__.py index c8cacfb8c3b554a194c81f7abb137f3cc6cf577e..73314c216c180a26fc96d46f8c061bf4e55699db 100644 --- a/src/graph_tool/stats/__init__.py +++ b/src/graph_tool/stats/__init__.py @@ -300,13 +300,12 @@ def remove_labeled_edges(g, label): remove_labeled_edges(u._Graph__graph, _prop("e", g, label)) -def label_parallel_edges(g, mark_only=False, count_all=False, eprop=None): +def label_parallel_edges(g, mark_only=False, eprop=None): r"""Label edges which are parallel, i.e, have the same source and target vertices. For each parallel edge set :math:`PE`, the labelling starts from 0 - to :math:`|PE|-1`. (If `count_all==True`, the range is 0 to :math:`|PE|` - instead). If `mark_only==True`, all parallel edges are simply marked with - the value 1. If the `eprop` parameter is given - (a :class:`~graph_tool.PropertyMap`), the labelling is stored there.""" + to :math:`|PE|-1`. If `mark_only==True`, all parallel edges are simply + marked with the value 1. If the `eprop` parameter is given (a + :class:`~graph_tool.PropertyMap`), the labelling is stored there.""" if eprop is None: if mark_only: eprop = g.new_edge_property("bool") @@ -314,7 +313,7 @@ def label_parallel_edges(g, mark_only=False, count_all=False, eprop=None): eprop = g.new_edge_property("int32_t") libgraph_tool_stats.\ label_parallel_edges(g._Graph__graph, _prop("e", g, eprop), - mark_only, count_all) + mark_only) return eprop