Commit 79097dc9 authored by incardon's avatar incardon

Fixing GraphML writer

parent cb4a6f2c
......@@ -532,7 +532,7 @@ class GraphMLWriter
vn.new_node(nc);
// Iterate through all the vertex and create the vertex list
boost::mpl::for_each< boost::mpl::range_c<int,0,Graph::V_type::max_prop-1> >(vn);
boost::mpl::for_each< boost::mpl::range_c<int,0,Graph::V_type::max_prop> >(vn);
// end node
vn.end_node();
......@@ -570,7 +570,7 @@ class GraphMLWriter
en.new_node(nc,it.source(),it.target());
// Iterate through all the vertex and create the vertex list
boost::mpl::for_each< boost::mpl::range_c<int,0,Graph::V_type::max_prop-1> >(en);
boost::mpl::for_each< boost::mpl::range_c<int,0,Graph::V_type::max_prop> >(en);
// end new node
en.end_node();
......
......@@ -86,23 +86,23 @@ BOOST_AUTO_TEST_CASE( graphml_writer_use)
// Add 4 vertex and connect
struct ne_cp n1;
n1.get_x() = 0;
n1.get_y() = 0;
n1.get_z() = 0;
n1.get_dn() = 0;
n1.get_ln() = 0;
n1.get_i() = 0;
n1.get_x() = 1.0;
n1.get_y() = 2.0;
n1.get_z() = 3.0;
n1.get_dn() = 4.0;
n1.get_ln() = 5.0;
n1.get_i() = 6.0;
n1.get_str() = std::string("test");
g_csr2.addVertex(n1);
g_csr2.addVertex(n1);
g_csr2.addVertex(n1);
g_csr2.addVertex(n1);
g_csr2.addEdge(0,1);
g_csr2.addEdge(2,1);
g_csr2.addEdge(3,1);
g_csr2.addEdge(2,0);
g_csr2.addEdge(3,2);
g_csr2.addEdge(0,1,n1);
g_csr2.addEdge(2,1,n1);
g_csr2.addEdge(3,1,n1);
g_csr2.addEdge(2,0,n1);
g_csr2.addEdge(3,2,n1);
// Create a graph ML
GraphMLWriter<Graph_CSR<ne_cp,ne_cp>> gv2(g_csr2);
......
......@@ -16,76 +16,85 @@
<key id="ek5" for="edge" attr.name="integer" attr.type="int"/>
<key id="ek6" for="edge" attr.name="string" attr.type="string"/>
<node id="n0">
<data key="vk0">0.000000</data>
<data key="vk1">0.000000</data>
<data key="vk2">0.000000</data>
<data key="vk3">0.000000</data>
<data key="vk4">0</data>
<data key="vk5">0</data>
<data key="vk0">1.000000</data>
<data key="vk1">2.000000</data>
<data key="vk2">3.000000</data>
<data key="vk3">4.000000</data>
<data key="vk4">5</data>
<data key="vk5">6</data>
<data key="vk6">test</data>
</node>
<node id="n1">
<data key="vk0">0.000000</data>
<data key="vk1">0.000000</data>
<data key="vk2">0.000000</data>
<data key="vk3">0.000000</data>
<data key="vk4">0</data>
<data key="vk5">0</data>
<data key="vk0">1.000000</data>
<data key="vk1">2.000000</data>
<data key="vk2">3.000000</data>
<data key="vk3">4.000000</data>
<data key="vk4">5</data>
<data key="vk5">6</data>
<data key="vk6">test</data>
</node>
<node id="n2">
<data key="vk0">0.000000</data>
<data key="vk1">0.000000</data>
<data key="vk2">0.000000</data>
<data key="vk3">0.000000</data>
<data key="vk4">0</data>
<data key="vk5">0</data>
<data key="vk0">1.000000</data>
<data key="vk1">2.000000</data>
<data key="vk2">3.000000</data>
<data key="vk3">4.000000</data>
<data key="vk4">5</data>
<data key="vk5">6</data>
<data key="vk6">test</data>
</node>
<node id="n3">
<data key="vk0">0.000000</data>
<data key="vk1">0.000000</data>
<data key="vk2">0.000000</data>
<data key="vk3">0.000000</data>
<data key="vk4">0</data>
<data key="vk5">0</data>
<data key="vk0">1.000000</data>
<data key="vk1">2.000000</data>
<data key="vk2">3.000000</data>
<data key="vk3">4.000000</data>
<data key="vk4">5</data>
<data key="vk5">6</data>
<data key="vk6">test</data>
</node>
<edge id="e0" source="n0" target="n1">
<data key="ek0">0.000000</data>
<data key="ek1">0.000000</data>
<data key="ek2">0.000000</data>
<data key="ek3">0.000000</data>
<data key="ek4">0</data>
<data key="ek5">0</data>
<data key="ek0">1.000000</data>
<data key="ek1">2.000000</data>
<data key="ek2">3.000000</data>
<data key="ek3">4.000000</data>
<data key="ek4">5</data>
<data key="ek5">6</data>
<data key="ek6">test</data>
</edge>
<edge id="e1" source="n2" target="n1">
<data key="ek0">0.000000</data>
<data key="ek1">0.000000</data>
<data key="ek2">0.000000</data>
<data key="ek3">0.000000</data>
<data key="ek4">0</data>
<data key="ek5">0</data>
<data key="ek0">1.000000</data>
<data key="ek1">2.000000</data>
<data key="ek2">3.000000</data>
<data key="ek3">4.000000</data>
<data key="ek4">5</data>
<data key="ek5">6</data>
<data key="ek6">test</data>
</edge>
<edge id="e2" source="n2" target="n0">
<data key="ek0">0.000000</data>
<data key="ek1">0.000000</data>
<data key="ek2">0.000000</data>
<data key="ek3">0.000000</data>
<data key="ek4">0</data>
<data key="ek5">0</data>
<data key="ek0">1.000000</data>
<data key="ek1">2.000000</data>
<data key="ek2">3.000000</data>
<data key="ek3">4.000000</data>
<data key="ek4">5</data>
<data key="ek5">6</data>
<data key="ek6">test</data>
</edge>
<edge id="e3" source="n3" target="n1">
<data key="ek0">0.000000</data>
<data key="ek1">0.000000</data>
<data key="ek2">0.000000</data>
<data key="ek3">0.000000</data>
<data key="ek4">0</data>
<data key="ek5">0</data>
<data key="ek0">1.000000</data>
<data key="ek1">2.000000</data>
<data key="ek2">3.000000</data>
<data key="ek3">4.000000</data>
<data key="ek4">5</data>
<data key="ek5">6</data>
<data key="ek6">test</data>
</edge>
<edge id="e4" source="n3" target="n2">
<data key="ek0">0.000000</data>
<data key="ek1">0.000000</data>
<data key="ek2">0.000000</data>
<data key="ek3">0.000000</data>
<data key="ek4">0</data>
<data key="ek5">0</data>
<data key="ek0">1.000000</data>
<data key="ek1">2.000000</data>
<data key="ek2">3.000000</data>
<data key="ek3">4.000000</data>
<data key="ek4">5</data>
<data key="ek5">6</data>
<data key="ek6">test</data>
</edge>
</graph>
</graphml>
\ No newline at end of file
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