Commit f3c37d4c authored by Tiago Peixoto's avatar Tiago Peixoto
Browse files

Fix vertex_range to consider all types of properties

This changes the meaning of the all_selectors type, which includes all
property types, and creates a scalar_selectors type, which includes only
the scalar types.
parent de3f34f5
......@@ -32,7 +32,7 @@ assortativity_coefficient(GraphInterface& gi,
using namespace boost::lambda;
double a, a_err;
run_action<>()(gi,bind<void>(get_assortativity_coefficient(), _1, _2,
var(a), var(a_err)), all_selectors())
var(a), var(a_err)), scalar_selectors())
(degree_selector(deg));
return make_pair(a, a_err);
}
......@@ -45,7 +45,7 @@ scalar_assortativity_coefficient(GraphInterface& gi,
double a, a_err;
run_action<>()(gi, bind<void>(get_scalar_assortativity_coefficient(),
_1, _2, var(a), var(a_err)),
all_selectors())
scalar_selectors())
(degree_selector(deg));
return make_pair(a, a_err);
}
......
......@@ -69,7 +69,7 @@ get_vertex_avg_correlation(GraphInterface& gi,
{
run_action<>()(gi, get_avg_correlation<GetNeighboursPairs>
(avg, dev, bins, ret_bins),
all_selectors(), all_selectors(),
scalar_selectors(), scalar_selectors(),
mpl::vector<cweight_map_t>())
(degree_selector(deg1), degree_selector(deg2), weight_prop);
}
......
......@@ -46,7 +46,7 @@ get_vertex_avg_combined_correlation(GraphInterface& gi,
run_action<>()(gi, get_avg_correlation<GetCombinedPair>
(avg, dev, bins, ret_bins),
all_selectors(), all_selectors(),
scalar_selectors(), scalar_selectors(),
mpl::vector<dummy_weight>())
(degree_selector(deg1), degree_selector(deg2), dummy_weight());
return python::make_tuple(avg, dev, ret_bins);
......
......@@ -43,7 +43,7 @@ void graph_avg_correlations_imp1(GraphInterface& g, python::object& avg,
wrapped_weight_t;
run_action<>()(g, get_avg_correlation<GetNeighboursPairs>
(avg, dev, bins, ret_bins),
all_selectors(), all_selectors(),
scalar_selectors(), scalar_selectors(),
mpl::vector<wrapped_weight_t>())
(deg1, deg2, weight);
}
......
......@@ -75,7 +75,7 @@ get_vertex_correlation_histogram(GraphInterface& gi,
{
run_action<>()(gi, get_correlation_histogram<GetNeighboursPairs>
(hist, bins, ret_bins),
all_selectors(), all_selectors(),
scalar_selectors(), scalar_selectors(),
mpl::vector<cweight_map_t>())
(degree_selector(deg1), degree_selector(deg2), weight_prop);
}
......
......@@ -50,7 +50,7 @@ get_vertex_combined_correlation_histogram(GraphInterface& gi,
run_action<>()(gi, get_correlation_histogram<GetCombinedPair>(hist, bins,
ret_bins),
all_selectors(), all_selectors(),
scalar_selectors(), scalar_selectors(),
mpl::vector<dummy_weight>())
(degree_selector(deg1), degree_selector(deg2),
boost::any(dummy_weight()));
......
......@@ -42,7 +42,7 @@ void graph_correlations_imp1(GraphInterface& g, python::object& hist,
wrapped_weight_t;
run_action<>()(g, get_correlation_histogram<GetNeighboursPairs>
(hist, bins, ret_bins),
all_selectors(), all_selectors(),
scalar_selectors(), scalar_selectors(),
mpl::vector<wrapped_weight_t>())
(deg1, deg2, weight);
}
......
......@@ -418,6 +418,11 @@ struct vertex_scalar_selectors:
scalar_selector_type>::type {};
struct all_selectors:
mpl::transform<vertex_properties,
scalar_selector_type,
mpl::back_inserter<degree_selectors> >::type {};
struct scalar_selectors:
mpl::transform<vertex_scalar_properties,
scalar_selector_type,
mpl::back_inserter<degree_selectors> >::type {};
......
......@@ -31,7 +31,7 @@ get_vertex_average(GraphInterface& gi, GraphInterface::deg_t deg)
{
long double a, dev;
run_action<>()(gi, get_average<VertexAverageTraverse>(a,dev),
all_selectors())(degree_selector(deg));
scalar_selectors())(degree_selector(deg));
return python::make_tuple(a,dev);
}
......
......@@ -35,7 +35,7 @@ get_vertex_histogram(GraphInterface& gi, GraphInterface::deg_t deg,
run_action<>()(gi, get_histogram<VertexHistogramFiller>(hist, bins,
ret_bins),
all_selectors())(degree_selector(deg));
scalar_selectors())(degree_selector(deg));
return python::make_tuple(hist, ret_bins);
}
......
......@@ -39,7 +39,7 @@ find_vertex_range(GraphInterface& gi, GraphInterface::deg_t deg,
return ret;
}
// find vertices which match a certain (inclusive) property range
// find edges which match a certain (inclusive) property range
python::list
find_edge_range(GraphInterface& gi, boost::any eprop,
python::tuple range)
......
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