Commit 7907bd2e authored by Tiago Peixoto's avatar Tiago Peixoto
Browse files

pmap(): add support for double

parent 47225bdc
......@@ -267,8 +267,10 @@ BOOST_PYTHON_MODULE(libgraph_tool_inference)
def("vector_map", vector_map<int32_t>);
def("vector_map64", vector_map<int64_t>);
def("vector_mapdouble", vector_map<double>);
def("vector_rmap", vector_rmap<int32_t>);
def("vector_rmap64", vector_rmap<int64_t>);
def("vector_rmapdouble", vector_rmap<double>);
def("vector_contiguous_map", vector_contiguous_map<int32_t>);
def("vector_contiguous_map64", vector_contiguous_map<int64_t>);
......@@ -103,6 +103,8 @@ def pmap(prop, value_map):
value_map = array(value_map, dtype=a.dtype)
if a.dtype == "int64":
libinference.vector_map64(a, value_map)
elif a.dtype == "float64":
libinference.vector_mapdouble(a, value_map)
libinference.vector_map(a, value_map)
if isinstance(prop, PropertyMap):
......@@ -124,6 +126,8 @@ def reverse_map(prop, value_map):
prop = array(prop, dtype=a.dtype)
if a.dtype == "int64":
libinference.vector_rmap64(prop, a)
elif a.dtype == "float64":
libinference.vector_rmapdouble(prop, a)
libinference.vector_rmap(prop, a)
if isinstance(value_map, PropertyMap):
Supports Markdown
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