Skip to content

Commit 3567a29

Browse files
committed
Specify invariant culture in sparse matrix data read unit test
1 parent 95291a8 commit 3567a29

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Numerics.Tests/LinearAlgebraTests/MatrixHelpers.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
// </copyright>
2929

3030
using System;
31+
using System.Globalization;
3132
using System.IO;
3233
using MathNet.Numerics.LinearAlgebra;
3334
using MathNet.Numerics.LinearAlgebra.Double;
@@ -136,7 +137,7 @@ public static Matrix<double> ReadTestDataSparseMatrixDoubleCoordinateFormat(stri
136137
if (!int.TryParse(split[1], out cooCols[i]))
137138
throw new InvalidDataException($"Could not parse column integer on line {i + 1}");
138139

139-
if (!double.TryParse(split[2], out cooVals[i]))
140+
if (!double.TryParse(split[2], NumberStyles.Float, CultureInfo.InvariantCulture, out cooVals[i]))
140141
throw new InvalidDataException($"Could not parse double value on line {i + 1}");
141142

142143
nRows = Math.Max(nRows, cooRows[i] + 1);

0 commit comments

Comments
 (0)