Browse Source

Merge pull request #79 from tibel/sparsevector-nonzeroscount

Add SparseVector.NonZerosCount property
v2
Christoph Ruegg 14 years ago
parent
commit
f90890e130
  1. 9
      src/Numerics/LinearAlgebra/Complex/SparseVector.cs
  2. 9
      src/Numerics/LinearAlgebra/Complex32/SparseVector.cs
  3. 9
      src/Numerics/LinearAlgebra/Double/SparseVector.cs
  4. 9
      src/Numerics/LinearAlgebra/Single/SparseVector.cs

9
src/Numerics/LinearAlgebra/Complex/SparseVector.cs

@ -49,6 +49,15 @@ namespace MathNet.Numerics.LinearAlgebra.Complex
{
readonly SparseVectorStorage<Complex> _storage;
/// <summary>
/// Gets the number of non zero elements in the vector.
/// </summary>
/// <value>The number of non zero elements.</value>
public int NonZerosCount
{
get { return _storage.ValueCount; }
}
internal SparseVector(SparseVectorStorage<Complex> storage)
: base(storage)
{

9
src/Numerics/LinearAlgebra/Complex32/SparseVector.cs

@ -49,6 +49,15 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32
{
readonly SparseVectorStorage<Complex32> _storage;
/// <summary>
/// Gets the number of non zero elements in the vector.
/// </summary>
/// <value>The number of non zero elements.</value>
public int NonZerosCount
{
get { return _storage.ValueCount; }
}
internal SparseVector(SparseVectorStorage<Complex32> storage)
: base(storage)
{

9
src/Numerics/LinearAlgebra/Double/SparseVector.cs

@ -49,6 +49,15 @@ namespace MathNet.Numerics.LinearAlgebra.Double
{
readonly SparseVectorStorage<double> _storage;
/// <summary>
/// Gets the number of non zero elements in the vector.
/// </summary>
/// <value>The number of non zero elements.</value>
public int NonZerosCount
{
get { return _storage.ValueCount; }
}
internal SparseVector(SparseVectorStorage<double> storage)
: base(storage)
{

9
src/Numerics/LinearAlgebra/Single/SparseVector.cs

@ -49,6 +49,15 @@ namespace MathNet.Numerics.LinearAlgebra.Single
{
readonly SparseVectorStorage<float> _storage;
/// <summary>
/// Gets the number of non zero elements in the vector.
/// </summary>
/// <value>The number of non zero elements.</value>
public int NonZerosCount
{
get { return _storage.ValueCount; }
}
internal SparseVector(SparseVectorStorage<float> storage)
: base(storage)
{

Loading…
Cancel
Save