Browse Source

LA: Sparse vector/matrix ToString to include %-filled

pull/112/head
Christoph Ruegg 13 years ago
parent
commit
05cf8a435f
  1. 5
      src/Numerics/LinearAlgebra/Complex/SparseMatrix.cs
  2. 5
      src/Numerics/LinearAlgebra/Complex/SparseVector.cs
  3. 5
      src/Numerics/LinearAlgebra/Complex32/SparseMatrix.cs
  4. 5
      src/Numerics/LinearAlgebra/Complex32/SparseVector.cs
  5. 5
      src/Numerics/LinearAlgebra/Double/SparseMatrix.cs
  6. 5
      src/Numerics/LinearAlgebra/Double/SparseVector.cs
  7. 5
      src/Numerics/LinearAlgebra/Single/SparseMatrix.cs
  8. 5
      src/Numerics/LinearAlgebra/Single/SparseVector.cs

5
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));
}
}
}

5
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);
}
}
}

5
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));
}
}
}

5
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);
}
}
}

5
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));
}
}
}

5
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);
}
}
}

5
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));
}
}
}

5
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);
}
}
}

Loading…
Cancel
Save