Skip to content
Snippets Groups Projects
Commit 07eb61ce authored by Paul Nitzke's avatar Paul Nitzke
Browse files

Merge branch 'labeling-fix' into 'master'

Fix: Correct labeling to display column partition

See merge request !44
parents bfdc604c f62b77ca
Branches
No related tags found
1 merge request!44Fix: Correct labeling to display column partition
......@@ -39,11 +39,11 @@ namespace SparseTransform.Tests.Library.Convert
StringSplitOptions.None
);
Assert.That(lines[2], Is.EqualTo("\tc_1 [shape=circle, style=filled]"));
Assert.That(lines[4], Is.EqualTo("\tc_3 [shape=circle, style=filled]"));
Assert.That(lines[5], Is.EqualTo("\tc_4 [shape=circle, style=filled]"));
Assert.That(lines[13], Is.EqualTo("\tc_2 -- {r_3};"));
Assert.That(lines[15], Is.EqualTo("\tc_4 -- {r_1};"));
Assert.That(lines[2], Is.EqualTo("\tr_1 [shape=circle, style=filled]"));
Assert.That(lines[4], Is.EqualTo("\tr_3 [shape=circle, style=filled]"));
Assert.That(lines[5], Is.EqualTo("\tr_4 [shape=circle, style=filled]"));
Assert.That(lines[13], Is.EqualTo("\tc_2 -- {r_1 r_3};"));
Assert.That(lines[15], Is.EqualTo("\tc_4 -- {r_3 r_5};"));
}
......@@ -54,12 +54,12 @@ namespace SparseTransform.Tests.Library.Convert
DotWriter writer = new DotWriter();
AdjacencyGraph graph = new AdjacencyGraph();
graph.AddEdge(1, 2);
graph.AddEdge(1, 5);
graph.AddEdge(2, 1);
graph.AddEdge(3, 2);
graph.AddEdge(3, 4);
graph.AddEdge(4, 1);
graph.AddEdge(5, 4);
graph.AddEdge(5, 2);
graph.AddEdge(6, 2);
graph.AddEdge(4, 3);
graph.AddEdge(6, 4);
String[] lines = writer.Write(graph).Split(
new String[] { "\r\n", "\r", "\n" },
......@@ -69,8 +69,8 @@ namespace SparseTransform.Tests.Library.Convert
Assert.That(lines[2], Is.EqualTo("\tc_2 [shape=circle, style=filled]"));
Assert.That(lines[4], Is.EqualTo("\tc_4 [shape=circle, style=filled]"));
Assert.That(lines[5], Is.EqualTo("\tc_5 [shape=circle, style=filled]"));
Assert.That(lines[7], Is.EqualTo("\tc_3 -- {c_2};"));
Assert.That(lines[9], Is.EqualTo("\tc_5 -- {c_1 c_4};"));
Assert.That(lines[7], Is.EqualTo("\tc_2 -- {c_1};"));
Assert.That(lines[9], Is.EqualTo("\tc_4 -- {c_3};"));
}
......
......@@ -37,7 +37,7 @@ namespace SparseTransform.Convert
private StringBuilder processAdjacencyGraph(AdjacencyGraph inputGraph, StringBuilder output)
{
output.AppendLine("graph G {");
processNodes(inputGraph.GetNodes(), output, true);
processNodes(inputGraph.GetNodes(), output, false);
processEdges(inputGraph.GetNodes(), output, false);
output.AppendLine("}");
return output;
......@@ -57,7 +57,7 @@ namespace SparseTransform.Convert
output.AppendLine("\tforcelabels=true;");
processNodes(inputGraph.GetLeftNodes(), output, true);
processNodes(inputGraph.GetRightNodes(), output, false);
processEdges(inputGraph.GetLeftNodes(), output, true);
processEdges(inputGraph.GetRightNodes(), output, true);
output.AppendLine("}");
return output;
}
......@@ -100,7 +100,7 @@ namespace SparseTransform.Convert
{
foreach (GraphNode v in nodes)
{
output.AppendLine(NodeLabel(v, (left ? "c_" : "r_")));
output.AppendLine(NodeLabel(v, (left ? "r_" : "c_")));
}
}
......
......@@ -127,9 +127,9 @@ namespace SparseTransform.Convert
{
throw new ArgumentException("Syntax Error in MatrixMarket file: Data line did not contain three elements.");
}
int xCoordinate = Int32.Parse(values[0]);
int yCoordinate = Int32.Parse(values[1]);
processor(xCoordinate, yCoordinate, Double.Parse(values[2]));
int i = Int32.Parse(values[0]);
int j = Int32.Parse(values[1]);
processor(i, j, Double.Parse(values[2]));
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment