Commit 9dc8c691 authored by Tiago Peixoto's avatar Tiago Peixoto
Browse files

Get rid of inconsistent CamelCase in GraphInterface methods

parent fa6816e0
......@@ -140,10 +140,10 @@ void betweenness(GraphInterface& g, boost::any weight,
{
run_action<>()
(g, std::bind<>(get_weighted_betweenness(),
std::placeholders::_1, g.GetVertexIndex(),
std::placeholders::_1, g.get_vertex_index(),
std::placeholders::_2,
std::placeholders::_3, weight, normalize,
g.GetNumberOfVertices(), g.GetMaxEdgeIndex()),
g.get_num_vertices(), g.get_max_edge_index()),
edge_floating_properties(),
vertex_floating_properties())
(edge_betweenness, vertex_betweenness);
......@@ -152,9 +152,9 @@ void betweenness(GraphInterface& g, boost::any weight,
{
run_action<>()
(g, std::bind<void>(get_betweenness(), std::placeholders::_1,
g.GetVertexIndex(), std::placeholders::_2,
g.get_vertex_index(), std::placeholders::_2,
std::placeholders::_3, normalize,
g.GetNumberOfVertices()),
g.get_num_vertices()),
edge_floating_properties(),
vertex_floating_properties())
(edge_betweenness, vertex_betweenness);
......
......@@ -35,7 +35,7 @@ void do_get_closeness(GraphInterface& gi, boost::any weight,
{
run_action<>()(gi,
std::bind(get_closeness(), placeholders::_1,
gi.GetVertexIndex(), no_weightS(),
gi.get_vertex_index(), no_weightS(),
placeholders::_2, harmonic, norm),
writable_vertex_scalar_properties())(closeness);
}
......@@ -43,7 +43,7 @@ void do_get_closeness(GraphInterface& gi, boost::any weight,
{
run_action<>()(gi,
std::bind(get_closeness(), placeholders::_1,
gi.GetVertexIndex(), placeholders::_2,
gi.get_vertex_index(), placeholders::_2,
placeholders::_3, harmonic, norm),
edge_scalar_properties(),
writable_vertex_scalar_properties())(weight, closeness);
......
......@@ -38,7 +38,7 @@ size_t eigentrust(GraphInterface& g, boost::any c, boost::any t,
size_t iter = 0;
run_action<>()
(g, bind(get_eigentrust(),
_1, g.GetVertexIndex(), g.GetEdgeIndex(), _2,
_1, g.get_vertex_index(), g.get_edge_index(), _2,
_3, epslon, max_iter, ref(iter)),
writable_edge_scalar_properties(),
vertex_floating_properties())(c,t);
......
......@@ -42,7 +42,7 @@ long double eigenvector(GraphInterface& g, boost::any w, boost::any c,
long double eig = 0;
run_action<>()
(g, std::bind(get_eigenvector(), placeholders::_1, g.GetVertexIndex(),
(g, std::bind(get_eigenvector(), placeholders::_1, g.get_vertex_index(),
placeholders::_2, placeholders::_3, epsilon, max_iter,
std::ref(eig)),
weight_props_t(),
......
......@@ -68,7 +68,7 @@ long double hits(GraphInterface& g, boost::any w, boost::any x, boost::any y,
long double eig = 0;
run_action<>()
(g, std::bind(get_hits_dispatch(), placeholders::_1, g.GetVertexIndex(),
(g, std::bind(get_hits_dispatch(), placeholders::_1, g.get_vertex_index(),
placeholders::_2, placeholders::_3, y, epsilon, max_iter,
std::ref(eig)),
weight_props_t(),
......
......@@ -53,7 +53,7 @@ void katz(GraphInterface& g, boost::any w, boost::any c, boost::any beta,
if(beta.empty())
beta = beta_map_t(1.);
run_action<>()(g, std::bind(get_katz(), placeholders::_1, g.GetVertexIndex(),
run_action<>()(g, std::bind(get_katz(), placeholders::_1, g.get_vertex_index(),
placeholders::_2, placeholders::_3,
placeholders::_4, alpha, epsilon, max_iter),
weight_props_t(),
......
......@@ -42,7 +42,7 @@ size_t pagerank(GraphInterface& g, boost::any rank, boost::any pers,
pers_props_t;
if(pers.empty())
pers = pers_map_t(1.0 / g.GetNumberOfVertices());
pers = pers_map_t(1.0 / g.get_num_vertices());
typedef ConstantPropertyMap<double, GraphInterface::edge_t> weight_map_t;
typedef boost::mpl::push_back<edge_scalar_properties, weight_map_t>::type
......@@ -57,7 +57,7 @@ size_t pagerank(GraphInterface& g, boost::any rank, boost::any pers,
size_t iter;
run_action<>()
(g, std::bind(get_pagerank(),
placeholders::_1, g.GetVertexIndex(), placeholders::_2,
placeholders::_1, g.get_vertex_index(), placeholders::_2,
placeholders::_3, placeholders::_4, d,
epsilon, max_iter, std::ref(iter)),
vertex_floating_properties(),
......
......@@ -37,7 +37,7 @@ void trust_transitivity(GraphInterface& g, int64_t source, int64_t target,
throw ValueException("vertex property must be of floating point valued vector type");
run_action<>()(g,
bind<void>(get_trust_transitivity(), _1, g.GetVertexIndex(),
bind<void>(get_trust_transitivity(), _1, g.get_vertex_index(),
source, target, _2, _3),
edge_floating_properties(),
vertex_floating_vector_properties())(c,t);
......
......@@ -34,25 +34,25 @@ using namespace graph_tool;
boost::python::tuple global_clustering(GraphInterface& g)
{
double c, c_err;
bool directed = g.GetDirected();
g.SetDirected(false);
bool directed = g.get_directed();
g.set_directed(false);
run_action<graph_tool::detail::never_directed>()
(g, std::bind(get_global_clustering(), std::placeholders::_1,
std::ref(c), std::ref(c_err)))();
g.SetDirected(directed);
g.set_directed(directed);
return boost::python::make_tuple(c, c_err);
}
void local_clustering(GraphInterface& g, boost::any prop)
{
bool directed = g.GetDirected();
g.SetDirected(false);
bool directed = g.get_directed();
g.set_directed(false);
run_action<graph_tool::detail::never_directed>()
(g, std::bind(set_clustering_to_property(),
std::placeholders::_1,
std::placeholders::_2),
writable_vertex_scalar_properties())(prop);
g.SetDirected(directed);
g.set_directed(directed);
}
using namespace boost::python;
......
......@@ -82,7 +82,7 @@ void extended_clustering(GraphInterface& g, boost::python::list props)
boost::any vprop =
prop_vector<writable_vertex_scalar_properties>()
(cmaps, num_vertices(g.GetGraph()));
(cmaps, num_vertices(g.get_graph()));
if (vprop.empty())
throw ValueException("all vertex properties must be of the same"
" floating point type");
......@@ -93,7 +93,7 @@ void extended_clustering(GraphInterface& g, boost::python::list props)
run_action<>()
(g, std::bind<void>(get_extended_clustering(), placeholders::_1,
any_cast<GraphInterface::vertex_index_map_t>(g.GetVertexIndex()),
any_cast<GraphInterface::vertex_index_map_t>(g.get_vertex_index()),
placeholders::_2),
properties_vector()) (vprop);
}
......@@ -70,7 +70,7 @@ void get_motifs(GraphInterface& g, size_t k, boost::python::list subgraph_list,
bool fill_list, rng_t& rng)
{
boost::any list;
if (g.GetDirected())
if (g.get_directed())
list = vector<d_graph_t>();
else
list = vector<u_graph_t>();
......@@ -139,7 +139,7 @@ void get_motifs(GraphInterface& g, size_t k, boost::python::list subgraph_list,
{
GraphInterface sub;
sub.SetDirected(g.GetDirected());
sub.set_directed(g.get_directed());
typedef graph_tool::detail::get_all_graph_views::apply
<graph_tool::detail::filt_scalar_type,
boost::mpl::bool_<false>, boost::mpl::bool_<false>,
......
......@@ -179,16 +179,16 @@ boost::any do_create_emat(GraphInterface& gi, boost::any ob,
vmap_t;
vmap_t b = any_cast<vmap_t>(ob);
if (gi.GetDirected())
if (gi.get_directed())
{
run_action<>()(gi, std::bind<void>(create_emat(), placeholders::_1,
std::ref(b),
std::ref(bgi.GetGraph()),
std::ref(bgi.get_graph()),
std::ref(emat)))();
}
else
{
UndirectedAdaptor<GraphInterface::multigraph_t> ug(bgi.GetGraph());
UndirectedAdaptor<GraphInterface::multigraph_t> ug(bgi.get_graph());
run_action<>()(gi, std::bind<void>(create_emat(), placeholders::_1,
std::ref(b),
std::ref(ug),
......@@ -206,17 +206,17 @@ boost::any do_create_ehash(GraphInterface& gi, boost::any ob,
vmap_t;
vmap_t b = any_cast<vmap_t>(ob);
if (gi.GetDirected())
if (gi.get_directed())
{
run_action<>()(gi, std::bind<void>(create_ehash(), placeholders::_1,
std::ref(b),
std::ref(bgi.GetGraph()),
std::ref(bgi.get_graph()),
std::ref(emat),
std::ref(rng)))();
}
else
{
UndirectedAdaptor<GraphInterface::multigraph_t> ug(bgi.GetGraph());
UndirectedAdaptor<GraphInterface::multigraph_t> ug(bgi.get_graph());
run_action<>()(gi, std::bind<void>(create_ehash(), placeholders::_1,
std::ref(b),
std::ref(ug),
......@@ -293,11 +293,11 @@ struct move_sweep_dispatch
if (is_directed::apply<Graph>::type::value)
{
dispatch(mrs, mrp, mrm, wr, b, g, emat, sampler, cavity_sampler,
bgi.GetGraph(), weighted);
bgi.get_graph(), weighted);
}
else
{
UndirectedAdaptor<GraphInterface::multigraph_t> ug(bgi.GetGraph());
UndirectedAdaptor<GraphInterface::multigraph_t> ug(bgi.get_graph());
dispatch(mrs, mrp, mrm, wr, b, g, emat, sampler, cavity_sampler, ug,
weighted);
}
......@@ -489,7 +489,7 @@ boost::python::object do_move_sweep(GraphInterface& gi, GraphInterface& bgi,
label, vlist, block_list,
target_list, deg_corr, dense, multigraph,
beta, sequential, parallel, random_move, c, verbose,
gi.GetMaxEdgeIndex(), nmerges, niter, merge_map,
gi.get_max_edge_index(), nmerges, niter, merge_map,
partition_stats, rng, S, nmoves, bgi),
mrs, mrp, mrm, wr, b, placeholders::_1,
std::ref(emat), sampler, cavity_sampler, weighted))();
......@@ -531,11 +531,11 @@ boost::any do_build_egroups(GraphInterface& gi, GraphInterface& bgi,
boost::any oegroups;
run_action<graph_tool::detail::all_graph_views, boost::mpl::true_>()
(gi, std::bind<void>(build_egroups(), b, std::ref(oegroups),
esrcpos.get_unchecked(gi.GetMaxEdgeIndex()),
etgtpos.get_unchecked(gi.GetMaxEdgeIndex()),
eweights.get_unchecked(gi.GetMaxEdgeIndex()),
placeholders::_1, bgi.GetVertexIndex(),
bgi.GetNumberOfVertices(), weighted, empty))();
esrcpos.get_unchecked(gi.get_max_edge_index()),
etgtpos.get_unchecked(gi.get_max_edge_index()),
eweights.get_unchecked(gi.get_max_edge_index()),
placeholders::_1, bgi.get_vertex_index(),
bgi.get_num_vertices(), weighted, empty))();
return oegroups;
}
......@@ -580,7 +580,7 @@ void do_collect_edge_marginals(GraphInterface& gi, GraphInterface& gbi,
run_action<graph_tool::detail::all_graph_views, boost::mpl::true_>()
(gi, std::bind<void>(collect_edge_marginals_dispatch(),
placeholders::_1, B, b, p,
std::tuple<boost::any, GraphInterface&>(gbi.GetGraphView(), gbi)))();
std::tuple<boost::any, GraphInterface&>(gbi.get_graph_view(), gbi)))();
}
boost::python::tuple do_bethe_entropy(GraphInterface& gi, size_t B, boost::any op,
......
......@@ -151,13 +151,13 @@ struct cov_move_sweep_dispatch
{
vector<std::reference_wrapper<Graph>> gs;
for (GraphInterface& ag : ags)
gs.push_back(*any_cast<Graph*>(ag.GetGraphView()));
gs.push_back(*any_cast<Graph*>(ag.get_graph_view()));
if (is_directed::apply<Graph>::type::value)
{
vector<std::reference_wrapper<GraphInterface::multigraph_t>> bgs;
for (GraphInterface& bgi : bgis)
bgs.push_back(bgi.GetGraph());
bgs.push_back(bgi.get_graph());
dispatch(mrs, mrp, mrm, wr, b, bs, g, gs, emat, sampler,
cavity_sampler, bgs, weighted);
}
......@@ -165,7 +165,7 @@ struct cov_move_sweep_dispatch
{
vector<UndirectedAdaptor<GraphInterface::multigraph_t>> ubgs;
for (GraphInterface& bgi : bgis)
ubgs.push_back(UndirectedAdaptor<GraphInterface::multigraph_t>(bgi.GetGraph()));
ubgs.push_back(UndirectedAdaptor<GraphInterface::multigraph_t>(bgi.get_graph()));
vector<std::reference_wrapper<UndirectedAdaptor<GraphInterface::multigraph_t>>> rubgs;
for (auto& bg : ubgs)
rubgs.push_back(bg);
......@@ -577,7 +577,7 @@ boost::python::object do_cov_move_sweep(GraphInterface& gi,
vector<size_t> eidx;
for (GraphInterface& g : gis)
eidx.push_back(g.GetMaxEdgeIndex());
eidx.push_back(g.get_max_edge_index());
auto bgi = from_rlist<GraphInterface>(obgi);
......@@ -606,7 +606,7 @@ boost::python::object do_cov_move_sweep(GraphInterface& gi,
label, vlist, block_list, target_blocks, deg_corr, dense,
multigraph, beta, sequential, parallel, random_move,
node_coherent, confine_layers, c, verbose,
gi.GetMaxEdgeIndex(), eidx, nmerges, niter, merge_map,
gi.get_max_edge_index(), eidx, nmerges, niter, merge_map,
partition_stats, overlap_partition_stats, overlap_stats,
master, slave, rng, S, nmoves, bgi, bmap, brmap, free_blocks, B),
std::ref(mrs), std::ref(mrp), std::ref(mrm), std::ref(wr),
......@@ -653,7 +653,7 @@ void do_ec_hist(GraphInterface& gi, boost::any& aevc, boost::any& aec)
GraphInterface::edge_index_map_t>::type
emap_t;
typename emap_t::unchecked_t ec =
any_cast<emap_t&>(aec).get_unchecked(gi.GetMaxEdgeIndex());
any_cast<emap_t&>(aec).get_unchecked(gi.get_max_edge_index());
run_action<>()(gi, std::bind<void>(ec_hist(), placeholders::_1,
placeholders::_2, std::ref(ec)),
edge_properties())(aevc);
......
......@@ -83,7 +83,7 @@ struct split_graph
auto iter = vhmap[v].find(l);
if (iter == vhmap[v].end())
{
size_t u = add_vertex(us[l].get().GetGraph());
size_t u = add_vertex(us[l].get().get_graph());
vhmap[v][l] = u;
size_t pos = lower_bound(vc[v].begin(), vc[v].end(), l) - vc[v].begin();
vc[v].insert(vc[v].begin() + pos, l);
......@@ -124,7 +124,7 @@ struct split_graph
auto u_s = get_v(s, l);
auto u_t = get_v(t, l);
auto ne = add_edge(u_s, u_t, us[l].get().GetGraph()).first;
auto ne = add_edge(u_s, u_t, us[l].get().get_graph()).first;
ueweight[l].get()[ne] = eweight[e];
}
}
......
......@@ -116,11 +116,11 @@ struct move_sweep_overlap_dispatch
if (is_directed::apply<Graph>::type::value)
{
dispatch(mrs, mrp, mrm, wr, b, g, emat, sampler, cavity_sampler,
bgi.GetGraph(), weighted);
bgi.get_graph(), weighted);
}
else
{
UndirectedAdaptor<GraphInterface::multigraph_t> ug(bgi.GetGraph());
UndirectedAdaptor<GraphInterface::multigraph_t> ug(bgi.get_graph());
dispatch(mrs, mrp, mrm, wr, b, g, emat, sampler, cavity_sampler, ug,
weighted);
}
......@@ -324,7 +324,7 @@ do_move_sweep_overlap(GraphInterface& gi, GraphInterface& bgi, boost::any& emat,
(eweight, vweight, oegroups, esrcpos, etgtpos,
label, vlist, block_list, target_blocks, deg_corr, dense,
multigraph, parallel_edges, beta, sequential, parallel,
random_move, c, node_coherent, verbose, gi.GetMaxEdgeIndex(),
random_move, c, node_coherent, verbose, gi.get_max_edge_index(),
nmerges, niter, merge_map, overlap_stats, partition_stats,
rng, S, nmoves, bgi),
mrs, mrp, mrm, wr, b, placeholders::_1,
......@@ -476,7 +476,7 @@ void do_get_eg_overlap(GraphInterface& gi, GraphInterface& egi, boost::any obe,
emap_t eindex = any_cast<emap_t>(oeindex);
run_action<>()(gi, std::bind(get_eg_overlap(), placeholders::_1,
std::ref(egi.GetGraph()), be, b, node_index,
std::ref(egi.get_graph()), be, b, node_index,
half_edges, eindex))();
}
......@@ -534,7 +534,7 @@ void do_get_be_overlap(GraphInterface& gi, GraphInterface& egi, boost::any obe,
vimap_t node_index = any_cast<vimap_t>(onode_index);
run_action<>()(gi, std::bind(get_be_overlap(), placeholders::_1,
std::ref(egi.GetGraph()), be, b,
std::ref(egi.get_graph()), be, b,
node_index))();
}
......
......@@ -66,7 +66,7 @@ void community_structure(GraphInterface& g, double gamma, string corr_name,
throw ValueException("invalid correlation type: " + corr_name);
run_action<graph_tool::detail::never_directed>()
(g, std::bind(get_communities_selector(corr, g.GetVertexIndex()),
(g, std::bind(get_communities_selector(corr, g.get_vertex_index()),
placeholders::_1, placeholders::_2, placeholders::_3, gamma, n_iter,
make_pair(Tmin, Tmax), Nspins,
std::ref(rng), make_pair(verbose,history_file)),
......
......@@ -101,7 +101,7 @@ void community_network(GraphInterface& gi, GraphInterface& cgi,
run_action<>()
(gi, std::bind(get_community_network_vertices_dispatch(),
placeholders::_1, std::ref(cgi.GetGraph()),
placeholders::_1, std::ref(cgi.get_graph()),
placeholders::_2, condensed_community_property,
placeholders::_3, vertex_count),
writable_vertex_properties(), vweight_properties())
......
......@@ -68,7 +68,7 @@ void sum_eprops(GraphInterface& gi, GraphInterface& cgi,
run_action<graph_tool::detail::always_directed>()
(gi, std::bind(get_edge_sum_dispatch(),
placeholders::_1, std::ref(cgi.GetGraph()),
placeholders::_1, std::ref(cgi.get_graph()),
placeholders::_2,
condensed_community_property, placeholders::_3, ceprop,
self_loops),
......
......@@ -76,7 +76,7 @@ void community_network_edges(GraphInterface& gi, GraphInterface& cgi,
run_action<>()
(gi, std::bind(get_community_network_edges_dispatch(self_loops, parallel_edges),
placeholders::_1, std::ref(cgi.GetGraph()), cgi.GetEdgeIndex(),
placeholders::_1, std::ref(cgi.get_graph()), cgi.get_edge_index(),
placeholders::_2, condensed_community_property,
placeholders::_3, edge_count),
writable_vertex_properties(), eweight_properties())
......
......@@ -107,7 +107,7 @@ void community_network_vavg(GraphInterface& gi, GraphInterface& cgi,
// sum weighted values
run_action<graph_tool::detail::always_directed_never_reversed>()
(gi, std::bind(get_vertex_sum_dispatch(),
placeholders::_1, std::ref(cgi.GetGraph()),
placeholders::_1, std::ref(cgi.get_graph()),
placeholders::_2,
condensed_community_property,
placeholders::_3, cvprop),
......@@ -119,7 +119,7 @@ void community_network_vavg(GraphInterface& gi, GraphInterface& cgi,
// sum unweighted values
run_action<graph_tool::detail::always_directed_never_reversed>()
(gi, std::bind(get_vertex_sum_dispatch(),
placeholders::_1, std::ref(cgi.GetGraph()),
placeholders::_1, std::ref(cgi.get_graph()),
placeholders::_2,
condensed_community_property,
placeholders::_3, cvprop),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment