Commit d6aaa556 authored by Tiago Peixoto's avatar Tiago Peixoto

Replace ConstantPropertyMap by UnityPropertyMap whenever appropriate

parent 27f82a7d
Pipeline #88 failed with stage
...@@ -33,12 +33,12 @@ long double eigenvector(GraphInterface& g, boost::any w, boost::any c, ...@@ -33,12 +33,12 @@ long double eigenvector(GraphInterface& g, boost::any w, boost::any c,
throw ValueException("vertex property must be of floating point" throw ValueException("vertex property must be of floating point"
" value type"); " value type");
typedef ConstantPropertyMap<int, GraphInterface::edge_t> weight_map_t; typedef UnityPropertyMap<int,GraphInterface::edge_t> weight_map_t;
typedef boost::mpl::push_back<writable_edge_scalar_properties, weight_map_t>::type typedef boost::mpl::push_back<writable_edge_scalar_properties, weight_map_t>::type
weight_props_t; weight_props_t;
if(w.empty()) if(w.empty())
w = weight_map_t(1); w = weight_map_t();
long double eig = 0; long double eig = 0;
run_action<>() run_action<>()
......
...@@ -59,12 +59,12 @@ long double hits(GraphInterface& g, boost::any w, boost::any x, boost::any y, ...@@ -59,12 +59,12 @@ long double hits(GraphInterface& g, boost::any w, boost::any x, boost::any y,
throw ValueException("vertex property must be of floating point" throw ValueException("vertex property must be of floating point"
" value type"); " value type");
typedef ConstantPropertyMap<int, GraphInterface::edge_t> weight_map_t; typedef UnityPropertyMap<int,GraphInterface::edge_t> weight_map_t;
typedef boost::mpl::push_back<writable_edge_scalar_properties, weight_map_t>::type typedef boost::mpl::push_back<writable_edge_scalar_properties, weight_map_t>::type
weight_props_t; weight_props_t;
if(w.empty()) if(w.empty())
w = weight_map_t(1); w = weight_map_t();
long double eig = 0; long double eig = 0;
run_action<>() run_action<>()
......
...@@ -39,19 +39,19 @@ void katz(GraphInterface& g, boost::any w, boost::any c, boost::any beta, ...@@ -39,19 +39,19 @@ void katz(GraphInterface& g, boost::any w, boost::any c, boost::any beta,
throw ValueException("personalization vertex property must be of floating point" throw ValueException("personalization vertex property must be of floating point"
" value type"); " value type");
typedef ConstantPropertyMap<double, GraphInterface::edge_t> weight_map_t; typedef UnityPropertyMap<int,GraphInterface::edge_t> weight_map_t;
typedef boost::mpl::push_back<writable_edge_scalar_properties, weight_map_t>::type typedef boost::mpl::push_back<writable_edge_scalar_properties, weight_map_t>::type
weight_props_t; weight_props_t;
if(w.empty()) if(w.empty())
w = weight_map_t(1.); w = weight_map_t();
typedef ConstantPropertyMap<double, GraphInterface::vertex_t> beta_map_t; typedef UnityPropertyMap<int,GraphInterface::vertex_t> beta_map_t;
typedef boost::mpl::push_back<vertex_floating_properties, beta_map_t>::type typedef boost::mpl::push_back<vertex_floating_properties, beta_map_t>::type
beta_props_t; beta_props_t;
if(beta.empty()) if(beta.empty())
beta = beta_map_t(1.); beta = beta_map_t();
run_action<>()(g, std::bind(get_katz(), std::placeholders::_1, g.get_vertex_index(), run_action<>()(g, std::bind(get_katz(), std::placeholders::_1, g.get_vertex_index(),
std::placeholders::_2, std::placeholders::_3, std::placeholders::_2, std::placeholders::_3,
......
...@@ -44,7 +44,7 @@ size_t pagerank(GraphInterface& g, boost::any rank, boost::any pers, ...@@ -44,7 +44,7 @@ size_t pagerank(GraphInterface& g, boost::any rank, boost::any pers,
if(pers.empty()) if(pers.empty())
pers = pers_map_t(1.0 / g.get_num_vertices()); pers = pers_map_t(1.0 / g.get_num_vertices());
typedef ConstantPropertyMap<double, GraphInterface::edge_t> weight_map_t; typedef UnityPropertyMap<int,GraphInterface::edge_t> weight_map_t;
typedef boost::mpl::push_back<edge_scalar_properties, weight_map_t>::type typedef boost::mpl::push_back<edge_scalar_properties, weight_map_t>::type
weight_props_t; weight_props_t;
...@@ -52,7 +52,7 @@ size_t pagerank(GraphInterface& g, boost::any rank, boost::any pers, ...@@ -52,7 +52,7 @@ size_t pagerank(GraphInterface& g, boost::any rank, boost::any pers,
throw ValueException("weight edge property must have a scalar value type"); throw ValueException("weight edge property must have a scalar value type");
if(weight.empty()) if(weight.empty())
weight = weight_map_t(1.0); weight = weight_map_t();
size_t iter; size_t iter;
run_action<>() run_action<>()
......
...@@ -79,12 +79,12 @@ double modularity(GraphInterface& g, boost::any weight, boost::any property) ...@@ -79,12 +79,12 @@ double modularity(GraphInterface& g, boost::any weight, boost::any property)
{ {
double modularity = 0; double modularity = 0;
typedef ConstantPropertyMap<int32_t,GraphInterface::edge_t> weight_map_t; typedef UnityPropertyMap<int,GraphInterface::edge_t> weight_map_t;
typedef boost::mpl::push_back<edge_scalar_properties, weight_map_t>::type typedef boost::mpl::push_back<edge_scalar_properties, weight_map_t>::type
edge_props_t; edge_props_t;
if(weight.empty()) if(weight.empty())
weight = weight_map_t(1); weight = weight_map_t();
run_action<graph_tool::detail::never_directed>() run_action<graph_tool::detail::never_directed>()
(g, std::bind(get_modularity(), std::placeholders::_1, std::placeholders::_2, (g, std::bind(get_modularity(), std::placeholders::_1, std::placeholders::_2,
......
...@@ -33,8 +33,8 @@ using namespace boost; ...@@ -33,8 +33,8 @@ using namespace boost;
using namespace graph_tool; using namespace graph_tool;
typedef ConstantPropertyMap<int32_t,GraphInterface::edge_t> no_eweight_map_t; typedef UnityPropertyMap<int,GraphInterface::edge_t> no_eweight_map_t;
typedef ConstantPropertyMap<int32_t,GraphInterface::vertex_t> no_vweight_map_t; typedef UnityPropertyMap<int,GraphInterface::vertex_t> no_vweight_map_t;
typedef property_map_type::apply<int32_t,GraphInterface::edge_index_map_t>::type::unchecked_t ecount_map_t; typedef property_map_type::apply<int32_t,GraphInterface::edge_index_map_t>::type::unchecked_t ecount_map_t;
typedef property_map_type::apply<int32_t,GraphInterface::vertex_index_map_t>::type::unchecked_t vcount_map_t; typedef property_map_type::apply<int32_t,GraphInterface::vertex_index_map_t>::type::unchecked_t vcount_map_t;
...@@ -97,7 +97,7 @@ void community_network(GraphInterface& gi, GraphInterface& cgi, ...@@ -97,7 +97,7 @@ void community_network(GraphInterface& gi, GraphInterface& cgi,
vweight_properties; vweight_properties;
if (vweight.empty()) if (vweight.empty())
vweight = no_vweight_map_t(1); vweight = no_vweight_map_t();
run_action<>() run_action<>()
(gi, std::bind(get_community_network_vertices_dispatch(), (gi, std::bind(get_community_network_vertices_dispatch(),
......
...@@ -33,7 +33,7 @@ using namespace boost; ...@@ -33,7 +33,7 @@ using namespace boost;
using namespace graph_tool; using namespace graph_tool;
typedef ConstantPropertyMap<int32_t,GraphInterface::edge_t> no_eweight_map_t; typedef UnityPropertyMap<int,GraphInterface::edge_t> no_eweight_map_t;
typedef property_map_type::apply<int32_t,GraphInterface::edge_index_map_t>::type ecount_map_t; typedef property_map_type::apply<int32_t,GraphInterface::edge_index_map_t>::type ecount_map_t;
struct get_weighted_edge_property_dispatch struct get_weighted_edge_property_dispatch
...@@ -68,7 +68,7 @@ void community_network_eavg(GraphInterface& gi, GraphInterface& cgi, ...@@ -68,7 +68,7 @@ void community_network_eavg(GraphInterface& gi, GraphInterface& cgi,
if (eweight.empty()) if (eweight.empty())
{ {
no_weight = true; no_weight = true;
eweight = no_eweight_map_t(1); eweight = no_eweight_map_t();
} }
typedef boost::mpl::insert_range<writable_edge_scalar_properties, typedef boost::mpl::insert_range<writable_edge_scalar_properties,
......
...@@ -33,7 +33,7 @@ using namespace boost; ...@@ -33,7 +33,7 @@ using namespace boost;
using namespace graph_tool; using namespace graph_tool;
typedef ConstantPropertyMap<int32_t,GraphInterface::edge_t> no_eweight_map_t; typedef UnityPropertyMap<int,GraphInterface::edge_t> no_eweight_map_t;
typedef property_map_type::apply<int32_t,GraphInterface::edge_index_map_t>::type ecount_map_t; typedef property_map_type::apply<int32_t,GraphInterface::edge_index_map_t>::type ecount_map_t;
struct get_edge_sum_dispatch struct get_edge_sum_dispatch
......
...@@ -33,7 +33,7 @@ using namespace boost; ...@@ -33,7 +33,7 @@ using namespace boost;
using namespace graph_tool; using namespace graph_tool;
typedef ConstantPropertyMap<int32_t,GraphInterface::edge_t> no_eweight_map_t; typedef UnityPropertyMap<int,GraphInterface::edge_t> no_eweight_map_t;
typedef property_map_type::apply<int32_t,GraphInterface::edge_index_map_t>::type::unchecked_t ecount_map_t; typedef property_map_type::apply<int32_t,GraphInterface::edge_index_map_t>::type::unchecked_t ecount_map_t;
struct get_community_network_edges_dispatch struct get_community_network_edges_dispatch
...@@ -72,7 +72,7 @@ void community_network_edges(GraphInterface& gi, GraphInterface& cgi, ...@@ -72,7 +72,7 @@ void community_network_edges(GraphInterface& gi, GraphInterface& cgi,
eweight_properties; eweight_properties;
if (eweight.empty()) if (eweight.empty())
eweight = no_eweight_map_t(1); eweight = no_eweight_map_t();
run_action<>() run_action<>()
(gi, std::bind(get_community_network_edges_dispatch(self_loops, parallel_edges), (gi, std::bind(get_community_network_edges_dispatch(self_loops, parallel_edges),
......
...@@ -33,7 +33,7 @@ using namespace boost; ...@@ -33,7 +33,7 @@ using namespace boost;
using namespace graph_tool; using namespace graph_tool;
typedef ConstantPropertyMap<int32_t,GraphInterface::vertex_t> no_vweight_map_t; typedef UnityPropertyMap<int,GraphInterface::vertex_t> no_vweight_map_t;
typedef property_map_type::apply<int32_t,GraphInterface::vertex_index_map_t>::type vcount_map_t; typedef property_map_type::apply<int32_t,GraphInterface::vertex_index_map_t>::type vcount_map_t;
...@@ -77,7 +77,7 @@ void community_network_vavg(GraphInterface& gi, GraphInterface& cgi, ...@@ -77,7 +77,7 @@ void community_network_vavg(GraphInterface& gi, GraphInterface& cgi,
if (vweight.empty()) if (vweight.empty())
{ {
no_weight = true; no_weight = true;
vweight = no_vweight_map_t(1); vweight = no_vweight_map_t();
} }
typedef boost::mpl::insert_range<writable_vertex_scalar_properties, typedef boost::mpl::insert_range<writable_vertex_scalar_properties,
......
...@@ -40,7 +40,7 @@ void graph_avg_corr_imp1(GraphInterface& g, boost::python::object& avg, ...@@ -40,7 +40,7 @@ void graph_avg_corr_imp1(GraphInterface& g, boost::python::object& avg,
const vector<long double>& bins); const vector<long double>& bins);
typedef ConstantPropertyMap<int,GraphInterface::edge_t> cweight_map_t; typedef UnityPropertyMap<int,GraphInterface::edge_t> cweight_map_t;
boost::python::object boost::python::object
get_vertex_avg_correlation(GraphInterface& gi, get_vertex_avg_correlation(GraphInterface& gi,
...@@ -61,7 +61,7 @@ get_vertex_avg_correlation(GraphInterface& gi, ...@@ -61,7 +61,7 @@ get_vertex_avg_correlation(GraphInterface& gi,
weight_prop = wrapped_weight_t(weight, edge_scalar_properties()); weight_prop = wrapped_weight_t(weight, edge_scalar_properties());
} }
else else
weight_prop = cweight_map_t(1); weight_prop = cweight_map_t();
try try
{ {
......
...@@ -31,7 +31,7 @@ using namespace std; ...@@ -31,7 +31,7 @@ using namespace std;
using namespace boost; using namespace boost;
using namespace graph_tool; using namespace graph_tool;
typedef ConstantPropertyMap<int,GraphInterface::edge_t> dummy_weight; typedef UnityPropertyMap<int,GraphInterface::edge_t> dummy_weight;
boost::python::object boost::python::object
get_vertex_avg_combined_correlation(GraphInterface& gi, get_vertex_avg_combined_correlation(GraphInterface& gi,
......
...@@ -41,7 +41,7 @@ void graph_correlations_imp1(GraphInterface& g, boost::python::object& hist, ...@@ -41,7 +41,7 @@ void graph_correlations_imp1(GraphInterface& g, boost::python::object& hist,
const std::array<vector<long double>,2>& bins); const std::array<vector<long double>,2>& bins);
typedef ConstantPropertyMap<int,GraphInterface::edge_t> cweight_map_t; typedef UnityPropertyMap<int,GraphInterface::edge_t> cweight_map_t;
boost::python::object boost::python::object
get_vertex_correlation_histogram(GraphInterface& gi, get_vertex_correlation_histogram(GraphInterface& gi,
...@@ -67,7 +67,7 @@ get_vertex_correlation_histogram(GraphInterface& gi, ...@@ -67,7 +67,7 @@ get_vertex_correlation_histogram(GraphInterface& gi,
weight_prop = wrapped_weight_t(weight, edge_scalar_properties()); weight_prop = wrapped_weight_t(weight, edge_scalar_properties());
} }
else else
weight_prop = cweight_map_t(1); weight_prop = cweight_map_t();
try try
{ {
......
...@@ -30,7 +30,7 @@ using namespace std; ...@@ -30,7 +30,7 @@ using namespace std;
using namespace boost; using namespace boost;
using namespace graph_tool; using namespace graph_tool;
typedef ConstantPropertyMap<int,GraphInterface::edge_t> dummy_weight; typedef UnityPropertyMap<int,GraphInterface::edge_t> dummy_weight;
boost::python::object boost::python::object
get_vertex_combined_correlation_histogram(GraphInterface& gi, get_vertex_combined_correlation_histogram(GraphInterface& gi,
......
...@@ -47,10 +47,10 @@ double min_cut(GraphInterface& gi, boost::any weight, boost::any part_map) ...@@ -47,10 +47,10 @@ double min_cut(GraphInterface& gi, boost::any weight, boost::any part_map)
{ {
double mc = 0; double mc = 0;
typedef ConstantPropertyMap<size_t,GraphInterface::edge_t> cweight_t; typedef UnityPropertyMap<size_t,GraphInterface::edge_t> cweight_t;
if (weight.empty()) if (weight.empty())
weight = cweight_t(1); weight = cweight_t();
typedef boost::mpl::push_back<writable_edge_scalar_properties, cweight_t>::type typedef boost::mpl::push_back<writable_edge_scalar_properties, cweight_t>::type
weight_maps; weight_maps;
......
...@@ -137,7 +137,7 @@ public: ...@@ -137,7 +137,7 @@ public:
typedef boost::property_map<multigraph_t, boost::vertex_index_t>::type vertex_index_map_t; typedef boost::property_map<multigraph_t, boost::vertex_index_t>::type vertex_index_map_t;
typedef boost::property_map<multigraph_t, boost::edge_index_t>::type edge_index_map_t; typedef boost::property_map<multigraph_t, boost::edge_index_t>::type edge_index_map_t;
typedef ConstantPropertyMap<size_t, boost::graph_property_tag> graph_index_map_t; typedef ConstantPropertyMap<size_t,boost::graph_property_tag> graph_index_map_t;
// internal access // internal access
......
...@@ -617,18 +617,18 @@ public: ...@@ -617,18 +617,18 @@ public:
}; };
// the following is a property map which always returns one // the following is a property map which always returns one
template <class Key> template <class Value, class Key>
class UnityPropertyMap class UnityPropertyMap
: public boost::put_get_helper<int, UnityPropertyMap<Key>> : public boost::put_get_helper<Value, UnityPropertyMap<Value, Key>>
{ {
public: public:
typedef int value_type; typedef Value value_type;
typedef value_type reference; typedef value_type reference;
typedef Key key_type; typedef Key key_type;
typedef boost::readable_property_map_tag category; typedef boost::readable_property_map_tag category;
template <class K> template <class K>
value_type operator[](const K&) const { return 1; } value_type operator[](const K&) const { return value_type(1); }
}; };
...@@ -639,7 +639,7 @@ struct is_constant_property ...@@ -639,7 +639,7 @@ struct is_constant_property
typedef typename boost::property_traits<Property>::value_type value_type; typedef typename boost::property_traits<Property>::value_type value_type;
typedef typename std::conditional<std::is_same<Property, ConstantPropertyMap<value_type, key_type>>::value, typedef typename std::conditional<std::is_same<Property, ConstantPropertyMap<value_type, key_type>>::value,
std::true_type, std::true_type,
typename std::is_same<Property, UnityPropertyMap<key_type>>::type>::type type; typename std::is_same<Property, UnityPropertyMap<value_type, key_type>>::type>::type type;
}; };
......
...@@ -105,9 +105,9 @@ struct in_degreeS ...@@ -105,9 +105,9 @@ struct in_degreeS
return in_degree(v, g) * weight.c; return in_degree(v, g) * weight.c;
} }
template <class Graph, class Vertex, class Key> template <class Graph, class Vertex, class Key, class Value>
auto get_in_degree(Vertex v, const Graph& g, std::true_type, auto get_in_degree(Vertex v, const Graph& g, std::true_type,
const UnityPropertyMap<Key>&) const const UnityPropertyMap<Value, Key>&) const
{ {
return in_degree(v, g); return in_degree(v, g);
} }
...@@ -159,9 +159,9 @@ struct out_degreeS ...@@ -159,9 +159,9 @@ struct out_degreeS
return out_degree(v, g) * weight.c; return out_degree(v, g) * weight.c;
} }
template <class Graph, class Vertex, class Key> template <class Graph, class Vertex, class Key, class Value>
auto get_out_degree(Vertex v, const Graph& g, auto get_out_degree(Vertex v, const Graph& g,
const UnityPropertyMap<Key>&) const const UnityPropertyMap<Value, Key>&) const
{ {
return out_degree(v, g); return out_degree(v, g);
} }
......
...@@ -31,12 +31,12 @@ void arf_layout(GraphInterface& g, boost::any pos, boost::any weight, double d, ...@@ -31,12 +31,12 @@ void arf_layout(GraphInterface& g, boost::any pos, boost::any weight, double d,
double a, double dt, size_t max_iter, double epsilon, double a, double dt, size_t max_iter, double epsilon,
size_t dim) size_t dim)
{ {
typedef ConstantPropertyMap<int32_t,GraphInterface::edge_t> weight_map_t; typedef UnityPropertyMap<int,GraphInterface::edge_t> weight_map_t;
typedef boost::mpl::push_back<edge_scalar_properties, weight_map_t>::type typedef boost::mpl::push_back<edge_scalar_properties, weight_map_t>::type
edge_props_t; edge_props_t;
if(weight.empty()) if(weight.empty())
weight = weight_map_t(1); weight = weight_map_t();
run_action<graph_tool::detail::never_directed>() run_action<graph_tool::detail::never_directed>()
(g, std::bind(get_arf_layout(), std::placeholders::_1, std::placeholders::_2, (g, std::bind(get_arf_layout(), std::placeholders::_1, std::placeholders::_2,
std::placeholders::_3, a, d, dt, epsilon, max_iter, dim), std::placeholders::_3, a, d, dt, epsilon, max_iter, dim),
......
...@@ -155,8 +155,6 @@ struct get_layout ...@@ -155,8 +155,6 @@ struct get_layout
cooling(cool). cooling(cool).
force_pairs(all_force_pairs())); force_pairs(all_force_pairs()));
} }
}; };
...@@ -165,12 +163,12 @@ void fruchterman_reingold_layout(GraphInterface& g, boost::any pos, ...@@ -165,12 +163,12 @@ void fruchterman_reingold_layout(GraphInterface& g, boost::any pos,
bool square, double scale, bool grid, bool square, double scale, bool grid,
double ti, double tf, size_t max_iter) double ti, double tf, size_t max_iter)
{ {
typedef ConstantPropertyMap<double,GraphInterface::edge_t> weight_map_t; typedef UnityPropertyMap<int,GraphInterface::edge_t> weight_map_t;
typedef boost::mpl::push_back<edge_scalar_properties, weight_map_t>::type typedef boost::mpl::push_back<edge_scalar_properties, weight_map_t>::type
edge_props_t; edge_props_t;
if(weight.empty()) if(weight.empty())
weight = weight_map_t(1.0); weight = weight_map_t();
if (square) if (square)
run_action<graph_tool::detail::never_directed>() run_action<graph_tool::detail::never_directed>()
(g, (g,
......
...@@ -36,8 +36,8 @@ void sfdp_layout(GraphInterface& g, boost::any pos, boost::any vweight, ...@@ -36,8 +36,8 @@ void sfdp_layout(GraphInterface& g, boost::any pos, boost::any vweight,
size_t max_level, double epsilon, size_t max_iter, size_t max_level, double epsilon, size_t max_iter,
bool adaptive, bool verbose, rng_t& rng) bool adaptive, bool verbose, rng_t& rng)
{ {
typedef ConstantPropertyMap<int32_t,GraphInterface::vertex_t> vweight_map_t; typedef UnityPropertyMap<int,GraphInterface::vertex_t> vweight_map_t;
typedef ConstantPropertyMap<int32_t,GraphInterface::edge_t> eweight_map_t; typedef UnityPropertyMap<int,GraphInterface::edge_t> eweight_map_t;
typedef mpl::push_back<vertex_scalar_properties, vweight_map_t>::type typedef mpl::push_back<vertex_scalar_properties, vweight_map_t>::type
vertex_props_t; vertex_props_t;
typedef mpl::push_back<edge_scalar_properties, eweight_map_t>::type typedef mpl::push_back<edge_scalar_properties, eweight_map_t>::type
...@@ -57,9 +57,9 @@ void sfdp_layout(GraphInterface& g, boost::any pos, boost::any vweight, ...@@ -57,9 +57,9 @@ void sfdp_layout(GraphInterface& g, boost::any pos, boost::any vweight,
any_cast<group_map_t>(python::extract<any>(spring_parms[6])); any_cast<group_map_t>(python::extract<any>(spring_parms[6]));
if(vweight.empty()) if(vweight.empty())
vweight = vweight_map_t(1); vweight = vweight_map_t();
if(eweight.empty()) if(eweight.empty())
eweight = eweight_map_t(1); eweight = eweight_map_t();
typedef property_map_type::apply<uint8_t, typedef property_map_type::apply<uint8_t,
GraphInterface::vertex_index_map_t>::type GraphInterface::vertex_index_map_t>::type
......
...@@ -37,7 +37,7 @@ void adjacency(GraphInterface& g, boost::any index, boost::any weight, ...@@ -37,7 +37,7 @@ void adjacency(GraphInterface& g, boost::any index, boost::any weight,
if (!belongs<vertex_scalar_properties>()(index)) if (!belongs<vertex_scalar_properties>()(index))
throw ValueException("index vertex property must have a scalar value type"); throw ValueException("index vertex property must have a scalar value type");
typedef ConstantPropertyMap<double, GraphInterface::edge_t> weight_map_t; typedef UnityPropertyMap<double, GraphInterface::edge_t> weight_map_t;
typedef mpl::push_back<edge_scalar_properties, weight_map_t>::type typedef mpl::push_back<edge_scalar_properties, weight_map_t>::type
weight_props_t; weight_props_t;
...@@ -45,7 +45,7 @@ void adjacency(GraphInterface& g, boost::any index, boost::any weight, ...@@ -45,7 +45,7 @@ void adjacency(GraphInterface& g, boost::any index, boost::any weight,
throw ValueException("weight edge property must have a scalar value type"); throw ValueException("weight edge property must have a scalar value type");
if(weight.empty()) if(weight.empty())
weight = weight_map_t(1.0); weight = weight_map_t();