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

Merge branch 'seed-matrix-fix' into 'master'

Fix: Fix incorrect dimensions for seed matrix

See merge request !41
parents dafc39a5 05e7435e
No related branches found
No related tags found
1 merge request!41Fix: Fix incorrect dimensions for seed matrix
...@@ -38,12 +38,10 @@ namespace SparseTransform.Convert ...@@ -38,12 +38,10 @@ namespace SparseTransform.Convert
/// <returns>MatrixMarket string</returns> /// <returns>MatrixMarket string</returns>
public String Write(IGraph graph) public String Write(IGraph graph)
{ {
IntegerMatrix? seedMatrix = graph.ToSeedMatrix(_inputMatrix.RowCount); IntegerMatrix? seedMatrix = graph.ToSeedMatrix(_inputMatrix.ColumnCount);
if (_seed) if (_seed)
{ {
// ziemlich wilder ausdruck, wa? Liefert die seed matrix aus einem AdjacencyGraph oder BipartiteGraph. (je nachdem was IGraph ist) if (seedMatrix is IntegerMatrix && seedMatrix.ColumnCount != 0)
if (seedMatrix is IntegerMatrix && seedMatrix.RowCount != 0)
{ {
return seedMatrix.ToMatrixMarketString(); return seedMatrix.ToMatrixMarketString();
} }
...@@ -51,7 +49,7 @@ namespace SparseTransform.Convert ...@@ -51,7 +49,7 @@ namespace SparseTransform.Convert
} }
else else
{ {
if (seedMatrix is IntegerMatrix && _inputMatrix is DoubleMatrix && seedMatrix.RowCount != 0) if (seedMatrix is IntegerMatrix && _inputMatrix is DoubleMatrix && seedMatrix.ColumnCount != 0)
{ {
return CalculateCompressedMatrix(_inputMatrix, seedMatrix).ToMatrixMarketString(); return CalculateCompressedMatrix(_inputMatrix, seedMatrix).ToMatrixMarketString();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment