Browse Source

LA: fix bug in Complex and Complex32 SparseMatrix.ToTypeString #347

The Complex and Complex32 implementation of SparseMatrix.ToTypeString
was reporting a filling percentage that was too large by a factor of 100
because the conversion to percentage was done twice (once by `P2` string
format)
netstandard
Christoph Ruegg 11 years ago
parent
commit
55db448f90
  1. 2
      src/Numerics/LinearAlgebra/Complex/SparseMatrix.cs
  2. 2
      src/Numerics/LinearAlgebra/Complex32/SparseMatrix.cs

2
src/Numerics/LinearAlgebra/Complex/SparseMatrix.cs

@ -1494,7 +1494,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex
public override string ToTypeString()
{
return string.Format("SparseMatrix {0}x{1}-Complex {2:P2} Filled", RowCount, ColumnCount, 100d * NonZerosCount / (RowCount * (double)ColumnCount));
return string.Format("SparseMatrix {0}x{1}-Complex {2:P2} Filled", RowCount, ColumnCount, NonZerosCount / (RowCount * (double)ColumnCount));
}
}
}

2
src/Numerics/LinearAlgebra/Complex32/SparseMatrix.cs

@ -1488,7 +1488,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32
public override string ToTypeString()
{
return string.Format("SparseMatrix {0}x{1}-Complex32 {2:P2} Filled", RowCount, ColumnCount, 100d * NonZerosCount / (RowCount * (double)ColumnCount));
return string.Format("SparseMatrix {0}x{1}-Complex32 {2:P2} Filled", RowCount, ColumnCount, NonZerosCount / (RowCount * (double)ColumnCount));
}
}
}

Loading…
Cancel
Save