Browse Source

added fix to other data types and updated tests to check that the bug was fixed

pull/75/head
Marcus Cuda 14 years ago
parent
commit
3d203b46b7
  1. 11
      src/Numerics.IO/LinearAlgebra/IO/Matlab/MatlabParser.cs
  2. 14
      src/UnitTests/LinearAlgebraTests/Complex/IO/MatlabWriterTests.cs
  3. 14
      src/UnitTests/LinearAlgebraTests/Complex32/IO/MatlabWriterTests.cs
  4. 14
      src/UnitTests/LinearAlgebraTests/Double/IO/MatlabWriterTests.cs
  5. 14
      src/UnitTests/LinearAlgebraTests/Single/IO/MatlabWriterTests.cs

11
src/Numerics.IO/LinearAlgebra/IO/Matlab/MatlabParser.cs

@ -412,7 +412,6 @@ namespace MathNet.Numerics.LinearAlgebra.IO.Matlab
for (var i = 0; i < ir.Count; i++)
{
var row = ir[i];
// if (jc[col + 1] == i)
while(jc[col + 1] == i)
{
col++;
@ -470,7 +469,7 @@ namespace MathNet.Numerics.LinearAlgebra.IO.Matlab
for (var i = 0; i < ir.Count; i++)
{
var row = ir[i];
if (jc[col + 1] == i)
while (jc[col + 1] == i)
{
col++;
}
@ -529,7 +528,7 @@ namespace MathNet.Numerics.LinearAlgebra.IO.Matlab
for (var i = 0; i < ir.Count; i++)
{
var row = ir[i];
if (jc[col + 1] == i)
while (jc[col + 1] == i)
{
col++;
}
@ -585,7 +584,7 @@ namespace MathNet.Numerics.LinearAlgebra.IO.Matlab
for (var i = 0; i < ir.Count; i++)
{
var row = ir[i];
if (jc[col + 1] == i)
while (jc[col + 1] == i)
{
col++;
}
@ -646,7 +645,7 @@ namespace MathNet.Numerics.LinearAlgebra.IO.Matlab
for (var i = 0; i < ir.Count; i++)
{
var row = ir[i];
if (jc[col + 1] == i)
while (jc[col + 1] == i)
{
col++;
}
@ -703,7 +702,7 @@ namespace MathNet.Numerics.LinearAlgebra.IO.Matlab
for (var i = 0; i < ir.Count; i++)
{
var row = ir[i];
if (jc[col + 1] == i)
while (jc[col + 1] == i)
{
col++;
}

14
src/UnitTests/LinearAlgebraTests/Complex/IO/MatlabWriterTests.cs

@ -97,16 +97,14 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex.IO
}
Matrix mat3 = new SparseMatrix(5, 4);
for (var i = 0; i < mat3.ColumnCount; i++)
{
mat3[i, i] = new Complex(i + .1, i + .1);
}
mat3[0, 0] = new Complex(1.1, 1.1);
mat3[0, 2] = new Complex(2.2, 2.2);
mat3[4, 3] = new Complex(3.3, 3.3);
Matrix mat4 = new SparseMatrix(3, 5);
for (var i = 0; i < mat4.RowCount; i++)
{
mat4[i, i] = new Complex(i + .1, i + .1);
}
mat4[0, 0] = new Complex(1.1, 1.1);
mat4[0, 2] = new Complex(2.2, 2.2);
mat4[2, 4] = new Complex(3.3, 3.3);
var write = new[] { mat1, mat2, mat3, mat4 };

14
src/UnitTests/LinearAlgebraTests/Complex32/IO/MatlabWriterTests.cs

@ -97,16 +97,14 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex32.IO
}
Matrix mat3 = new SparseMatrix(5, 4);
for (var i = 0; i < mat3.ColumnCount; i++)
{
mat3[i, i] = new Complex32(i + .1f, i + .1f);
}
mat3[0, 0] = new Complex32(1.1f, 1.1f);
mat3[0, 2] = new Complex32(2.2f, 2.2f);
mat3[4, 3] = new Complex32(3.3f, 3.3f);
Matrix mat4 = new SparseMatrix(3, 5);
for (var i = 0; i < mat4.RowCount; i++)
{
mat4[i, i] = new Complex32(i + .1f, i + .1f);
}
mat4[0, 0] = new Complex32(1.1f, 1.1f);
mat4[0, 2] = new Complex32(2.2f, 2.2f);
mat4[2, 4] = new Complex32(3.3f, 3.3f);
var write = new[] { mat1, mat2, mat3, mat4 };

14
src/UnitTests/LinearAlgebraTests/Double/IO/MatlabWriterTests.cs

@ -96,16 +96,14 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Double.IO
}
Matrix mat3 = new SparseMatrix(5, 4);
for (var i = 0; i < mat3.ColumnCount; i++)
{
mat3[i, i] = i + .1;
}
mat3[0, 0] = 1.1;
mat3[0, 2] = 2.2;
mat3[4, 3] = 3.3;
Matrix mat4 = new SparseMatrix(3, 5);
for (var i = 0; i < mat4.RowCount; i++)
{
mat4[i, i] = i + .1;
}
mat4[0, 0] = 1.1;
mat4[0, 2] = 2.2;
mat4[2, 4] = 3.3;
var write = new[] { mat1, mat2, mat3, mat4 };

14
src/UnitTests/LinearAlgebraTests/Single/IO/MatlabWriterTests.cs

@ -95,16 +95,14 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Single.IO
}
Matrix mat3 = new SparseMatrix(5, 4);
for (var i = 0; i < mat3.ColumnCount; i++)
{
mat3[i, i] = i + .1f;
}
mat3[0, 0] = 1.1f;
mat3[0, 2] = 2.2f;
mat3[4, 3] = 3.3f;
Matrix mat4 = new SparseMatrix(3, 5);
for (var i = 0; i < mat4.RowCount; i++)
{
mat4[i, i] = i + .1f;
}
mat4[0, 0] = 1.1f;
mat4[0, 2] = 2.2f;
mat4[2, 4] = 3.3f;
var write = new[] { mat1, mat2, mat3, mat4 };

Loading…
Cancel
Save