Skip to content
Snippets Groups Projects

Add additional tests for Matrix, IntegerMatrix, and DoubleMatrix

6 files
+ 161
7
Compare changes
  • Side-by-side
  • Inline

Files

@@ -18,7 +18,7 @@ namespace DataStructures
{
for (int j = 0; j < ColumnCount; j++)
{
if(this[i, j] != 0)
if (this[i, j] != 0)
{
nonZeros++;
}
@@ -43,7 +43,7 @@ namespace DataStructures
public String ToMatrixMarketString()
{
String MMString;
String type = "double";
String type = "real";
String symmetry;
if (Symmetric)
{
@@ -61,9 +61,10 @@ namespace DataStructures
for (int i = 0; i < RowCount; i++)
{
for (int j = 0; j < ColumnCount; j++)
{
MMString += $"{i} {j} {this[i, j]}\n";
}
if (this[i, j] != 0)
{
MMString += $"{i} {j} {this[i, j]}\n";
}
}
return MMString;
}
Loading