diff --git a/src/Numerics/LinearAlgebra/Complex/SparseMatrix.cs b/src/Numerics/LinearAlgebra/Complex/SparseMatrix.cs index 602f44f9..a883e048 100644 --- a/src/Numerics/LinearAlgebra/Complex/SparseMatrix.cs +++ b/src/Numerics/LinearAlgebra/Complex/SparseMatrix.cs @@ -1367,6 +1367,11 @@ namespace MathNet.Numerics.LinearAlgebra.Complex return (SparseMatrix)leftSide.Modulus(rightSide); } + + public override string ToTypeString() + { + return string.Format("SparseMatrix {0}x{1}-Complex {2:P2} Filled", RowCount, ColumnCount, 100d * NonZerosCount / (RowCount * (double)ColumnCount)); + } } } diff --git a/src/Numerics/LinearAlgebra/Complex/SparseVector.cs b/src/Numerics/LinearAlgebra/Complex/SparseVector.cs index 1ce1d42e..52af8e8e 100644 --- a/src/Numerics/LinearAlgebra/Complex/SparseVector.cs +++ b/src/Numerics/LinearAlgebra/Complex/SparseVector.cs @@ -1034,5 +1034,10 @@ namespace MathNet.Numerics.LinearAlgebra.Complex return ret; } #endregion + + public override string ToTypeString() + { + return string.Format("SparseVector {0}-Complex {1:P2} Filled", Count, NonZerosCount / (double)Count); + } } } diff --git a/src/Numerics/LinearAlgebra/Complex32/SparseMatrix.cs b/src/Numerics/LinearAlgebra/Complex32/SparseMatrix.cs index e4b68103..7ee8f8cd 100644 --- a/src/Numerics/LinearAlgebra/Complex32/SparseMatrix.cs +++ b/src/Numerics/LinearAlgebra/Complex32/SparseMatrix.cs @@ -1366,5 +1366,10 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32 return (SparseMatrix)leftSide.Modulus(rightSide); } + + public override string ToTypeString() + { + return string.Format("SparseMatrix {0}x{1}-Complex32 {2:P2} Filled", RowCount, ColumnCount, 100d * NonZerosCount / (RowCount * (double)ColumnCount)); + } } } diff --git a/src/Numerics/LinearAlgebra/Complex32/SparseVector.cs b/src/Numerics/LinearAlgebra/Complex32/SparseVector.cs index 4ce331c4..0579a4a0 100644 --- a/src/Numerics/LinearAlgebra/Complex32/SparseVector.cs +++ b/src/Numerics/LinearAlgebra/Complex32/SparseVector.cs @@ -1034,5 +1034,10 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32 return ret; } #endregion + + public override string ToTypeString() + { + return string.Format("SparseVector {0}-Complex32 {1:P2} Filled", Count, NonZerosCount / (double)Count); + } } } diff --git a/src/Numerics/LinearAlgebra/Double/SparseMatrix.cs b/src/Numerics/LinearAlgebra/Double/SparseMatrix.cs index 938a6c12..d34f1c03 100644 --- a/src/Numerics/LinearAlgebra/Double/SparseMatrix.cs +++ b/src/Numerics/LinearAlgebra/Double/SparseMatrix.cs @@ -1391,5 +1391,10 @@ namespace MathNet.Numerics.LinearAlgebra.Double return (SparseMatrix)leftSide.Modulus(rightSide); } + + public override string ToTypeString() + { + return string.Format("SparseMatrix {0}x{1}-Double {2:P2} Filled", RowCount, ColumnCount, NonZerosCount / (RowCount * (double)ColumnCount)); + } } } diff --git a/src/Numerics/LinearAlgebra/Double/SparseVector.cs b/src/Numerics/LinearAlgebra/Double/SparseVector.cs index 510eed82..7bd49bb2 100644 --- a/src/Numerics/LinearAlgebra/Double/SparseVector.cs +++ b/src/Numerics/LinearAlgebra/Double/SparseVector.cs @@ -1068,5 +1068,10 @@ namespace MathNet.Numerics.LinearAlgebra.Double } #endregion + + public override string ToTypeString() + { + return string.Format("SparseVector {0}-Double {1:P2} Filled", Count, NonZerosCount / (double)Count); + } } } diff --git a/src/Numerics/LinearAlgebra/Single/SparseMatrix.cs b/src/Numerics/LinearAlgebra/Single/SparseMatrix.cs index 363d7c5b..67346b6b 100644 --- a/src/Numerics/LinearAlgebra/Single/SparseMatrix.cs +++ b/src/Numerics/LinearAlgebra/Single/SparseMatrix.cs @@ -1390,5 +1390,10 @@ namespace MathNet.Numerics.LinearAlgebra.Single return (SparseMatrix)leftSide.Modulus(rightSide); } + + public override string ToTypeString() + { + return string.Format("SparseMatrix {0}x{1}-Single {2:P2} Filled", RowCount, ColumnCount, NonZerosCount / (RowCount * (double)ColumnCount)); + } } } diff --git a/src/Numerics/LinearAlgebra/Single/SparseVector.cs b/src/Numerics/LinearAlgebra/Single/SparseVector.cs index a5edeae0..8dbb5a05 100644 --- a/src/Numerics/LinearAlgebra/Single/SparseVector.cs +++ b/src/Numerics/LinearAlgebra/Single/SparseVector.cs @@ -1072,5 +1072,10 @@ namespace MathNet.Numerics.LinearAlgebra.Single } #endregion + + public override string ToTypeString() + { + return string.Format("SparseVector {0}-Single {1:P2} Filled", Count, NonZerosCount / (double)Count); + } } }