Browse Source

Linear Algebra: add new sparse factories also to CreateMatrix type, drop no longer valid comments on zero-length

pull/752/head
Christoph Ruegg 5 years ago
parent
commit
bdc020988b
  1. 23
      src/Numerics/LinearAlgebra/Builder.cs
  2. 2
      src/Numerics/LinearAlgebra/Complex/DenseMatrix.cs
  3. 1
      src/Numerics/LinearAlgebra/Complex/DenseVector.cs
  4. 3
      src/Numerics/LinearAlgebra/Complex/DiagonalMatrix.cs
  5. 2
      src/Numerics/LinearAlgebra/Complex/SparseMatrix.cs
  6. 1
      src/Numerics/LinearAlgebra/Complex/SparseVector.cs
  7. 2
      src/Numerics/LinearAlgebra/Complex32/DenseMatrix.cs
  8. 1
      src/Numerics/LinearAlgebra/Complex32/DenseVector.cs
  9. 3
      src/Numerics/LinearAlgebra/Complex32/DiagonalMatrix.cs
  10. 2
      src/Numerics/LinearAlgebra/Complex32/SparseMatrix.cs
  11. 1
      src/Numerics/LinearAlgebra/Complex32/SparseVector.cs
  12. 61
      src/Numerics/LinearAlgebra/CreateMatrix.cs
  13. 2
      src/Numerics/LinearAlgebra/Double/DenseMatrix.cs
  14. 1
      src/Numerics/LinearAlgebra/Double/DenseVector.cs
  15. 3
      src/Numerics/LinearAlgebra/Double/DiagonalMatrix.cs
  16. 2
      src/Numerics/LinearAlgebra/Double/SparseMatrix.cs
  17. 1
      src/Numerics/LinearAlgebra/Double/SparseVector.cs
  18. 2
      src/Numerics/LinearAlgebra/Single/DenseMatrix.cs
  19. 1
      src/Numerics/LinearAlgebra/Single/DenseVector.cs
  20. 3
      src/Numerics/LinearAlgebra/Single/DiagonalMatrix.cs
  21. 2
      src/Numerics/LinearAlgebra/Single/SparseMatrix.cs
  22. 1
      src/Numerics/LinearAlgebra/Single/SparseVector.cs
  23. 2
      src/Numerics/LinearAlgebra/Storage/SparseCompressedRowMatrixStorage.cs

23
src/Numerics/LinearAlgebra/Builder.cs

@ -74,7 +74,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double
};
}
internal override double AddEntries(double x, double y)
internal override double Add(double x, double y)
{
return x + y;
}
@ -142,7 +142,7 @@ namespace MathNet.Numerics.LinearAlgebra.Single
};
}
internal override float AddEntries(float x, float y)
internal override float Add(float x, float y)
{
return x + y;
}
@ -212,7 +212,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex
};
}
internal override Complex AddEntries(Complex x, Complex y)
internal override Complex Add(Complex x, Complex y)
{
return x + y;
}
@ -280,7 +280,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32
};
}
internal override Numerics.Complex32 AddEntries(Numerics.Complex32 x, Numerics.Complex32 y)
internal override Numerics.Complex32 Add(Numerics.Complex32 x, Numerics.Complex32 y)
{
return x + y;
}
@ -328,6 +328,8 @@ namespace MathNet.Numerics.LinearAlgebra
/// </summary>
public abstract T One { get; }
internal abstract T Add(T x, T y);
/// <summary>
/// Create a new matrix straight from an initialized matrix storage instance.
/// If you have an instance of a discrete storage type instead, use their direct methods instead.
@ -456,7 +458,6 @@ namespace MathNet.Numerics.LinearAlgebra
/// <summary>
/// Create a new dense matrix with the given number of rows and columns.
/// All cells of the matrix will be initialized to zero.
/// Zero-length matrices are not supported.
/// </summary>
public Matrix<T> Dense(int rows, int columns)
{
@ -1186,8 +1187,7 @@ namespace MathNet.Numerics.LinearAlgebra
/// <param name="columnIndices">The column index array of the coordinate format.</param>
/// <param name="values">The data array of the coordinate format.</param>
/// <returns>The sparse matrix from the coordinate format.</returns>
/// <remarks>Duplicate entries will be summed together and
/// explicit zeros will be not intentionally removed.</remarks>
/// <remarks>Duplicate entries will be summed together and explicit zeros will be not intentionally removed.</remarks>
public Matrix<T> SparseFromCoordinateFormat(int rows, int columns, int valueCount, int[] rowIndices, int[] columnIndices, T[] values)
{
return Sparse(SparseCompressedRowMatrixStorage<T>.OfCoordinateFormat(rows, columns, valueCount, rowIndices, columnIndices, values));
@ -1205,8 +1205,7 @@ namespace MathNet.Numerics.LinearAlgebra
/// <param name="columnIndices">The column index array of the compressed sparse row format.</param>
/// <param name="values">The data array of the compressed sparse row format.</param>
/// <returns>The sparse matrix from the compressed sparse row format.</returns>
/// <remarks>Duplicate entries will be summed together and
/// explicit zeros will be not intentionally removed.</remarks>
/// <remarks>Duplicate entries will be summed together and explicit zeros will be not intentionally removed.</remarks>
public Matrix<T> SparseFromCompressedSparseRowFormat(int rows, int columns, int valueCount, int[] rowPointers, int[] columnIndices, T[] values)
{
return Sparse(SparseCompressedRowMatrixStorage<T>.OfCompressedSparseRowFormat(rows, columns, valueCount, rowPointers, columnIndices, values));
@ -1224,15 +1223,12 @@ namespace MathNet.Numerics.LinearAlgebra
/// <param name="columnPointers">The column pointer array of the compressed sparse column format.</param>
/// <param name="values">The data array of the compressed sparse column format.</param>
/// <returns>The sparse matrix from the compressed sparse column format.</returns>
/// <remarks>Duplicate entries will be summed together and
/// explicit zeros will be not intentionally removed.</remarks>
/// <remarks>Duplicate entries will be summed together and explicit zeros will be not intentionally removed.</remarks>
public Matrix<T> SparseFromCompressedSparseColumnFormat(int rows, int columns, int valueCount, int[] rowIndices, int[] columnPointers, T[] values)
{
return Sparse(SparseCompressedRowMatrixStorage<T>.OfCompressedSparseColumnFormat(rows, columns, valueCount, rowIndices, columnPointers, values));
}
internal abstract T AddEntries(T x, T y);
/// <summary>
/// Create a new diagonal matrix straight from an initialized matrix storage instance.
/// The storage is used directly without copying.
@ -1244,7 +1240,6 @@ namespace MathNet.Numerics.LinearAlgebra
/// <summary>
/// Create a new diagonal matrix with the given number of rows and columns.
/// All cells of the matrix will be initialized to zero.
/// Zero-length matrices are not supported.
/// </summary>
public Matrix<T> Diagonal(int rows, int columns)
{

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

@ -86,7 +86,6 @@ namespace MathNet.Numerics.LinearAlgebra.Complex
/// <summary>
/// Create a new square dense matrix with the given number of rows and columns.
/// All cells of the matrix will be initialized to zero.
/// Zero-length matrices are not supported.
/// </summary>
/// <exception cref="ArgumentException">If the order is less than one.</exception>
public DenseMatrix(int order)
@ -97,7 +96,6 @@ namespace MathNet.Numerics.LinearAlgebra.Complex
/// <summary>
/// Create a new dense matrix with the given number of rows and columns.
/// All cells of the matrix will be initialized to zero.
/// Zero-length matrices are not supported.
/// </summary>
/// <exception cref="ArgumentException">If the row or column count is less than one.</exception>
public DenseMatrix(int rows, int columns)

1
src/Numerics/LinearAlgebra/Complex/DenseVector.cs

@ -73,7 +73,6 @@ namespace MathNet.Numerics.LinearAlgebra.Complex
/// <summary>
/// Create a new dense vector with the given length.
/// All cells of the vector will be initialized to zero.
/// Zero-length vectors are not supported.
/// </summary>
/// <exception cref="ArgumentException">If length is less than one.</exception>
public DenseVector(int length)

3
src/Numerics/LinearAlgebra/Complex/DiagonalMatrix.cs

@ -74,7 +74,6 @@ namespace MathNet.Numerics.LinearAlgebra.Complex
/// <summary>
/// Create a new square diagonal matrix with the given number of rows and columns.
/// All cells of the matrix will be initialized to zero.
/// Zero-length matrices are not supported.
/// </summary>
/// <exception cref="ArgumentException">If the order is less than one.</exception>
public DiagonalMatrix(int order)
@ -85,7 +84,6 @@ namespace MathNet.Numerics.LinearAlgebra.Complex
/// <summary>
/// Create a new diagonal matrix with the given number of rows and columns.
/// All cells of the matrix will be initialized to zero.
/// Zero-length matrices are not supported.
/// </summary>
/// <exception cref="ArgumentException">If the row or column count is less than one.</exception>
public DiagonalMatrix(int rows, int columns)
@ -96,7 +94,6 @@ namespace MathNet.Numerics.LinearAlgebra.Complex
/// <summary>
/// Create a new diagonal matrix with the given number of rows and columns.
/// All diagonal cells of the matrix will be initialized to the provided value, all non-diagonal ones to zero.
/// Zero-length matrices are not supported.
/// </summary>
/// <exception cref="ArgumentException">If the row or column count is less than one.</exception>
public DiagonalMatrix(int rows, int columns, Complex diagonalValue)

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

@ -70,7 +70,6 @@ namespace MathNet.Numerics.LinearAlgebra.Complex
/// <summary>
/// Create a new square sparse matrix with the given number of rows and columns.
/// All cells of the matrix will be initialized to zero.
/// Zero-length matrices are not supported.
/// </summary>
/// <exception cref="ArgumentException">If the order is less than one.</exception>
public SparseMatrix(int order)
@ -81,7 +80,6 @@ namespace MathNet.Numerics.LinearAlgebra.Complex
/// <summary>
/// Create a new sparse matrix with the given number of rows and columns.
/// All cells of the matrix will be initialized to zero.
/// Zero-length matrices are not supported.
/// </summary>
/// <exception cref="ArgumentException">If the row or column count is less than one.</exception>
public SparseMatrix(int rows, int columns)

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

@ -69,7 +69,6 @@ namespace MathNet.Numerics.LinearAlgebra.Complex
/// <summary>
/// Create a new sparse vector with the given length.
/// All cells of the vector will be initialized to zero.
/// Zero-length vectors are not supported.
/// </summary>
/// <exception cref="ArgumentException">If length is less than one.</exception>
public SparseVector(int length)

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

@ -86,7 +86,6 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32
/// <summary>
/// Create a new square dense matrix with the given number of rows and columns.
/// All cells of the matrix will be initialized to zero.
/// Zero-length matrices are not supported.
/// </summary>
/// <exception cref="ArgumentException">If the order is less than one.</exception>
public DenseMatrix(int order)
@ -97,7 +96,6 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32
/// <summary>
/// Create a new dense matrix with the given number of rows and columns.
/// All cells of the matrix will be initialized to zero.
/// Zero-length matrices are not supported.
/// </summary>
/// <exception cref="ArgumentException">If the row or column count is less than one.</exception>
public DenseMatrix(int rows, int columns)

1
src/Numerics/LinearAlgebra/Complex32/DenseVector.cs

@ -73,7 +73,6 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32
/// <summary>
/// Create a new dense vector with the given length.
/// All cells of the vector will be initialized to zero.
/// Zero-length vectors are not supported.
/// </summary>
/// <exception cref="ArgumentException">If length is less than one.</exception>
public DenseVector(int length)

3
src/Numerics/LinearAlgebra/Complex32/DiagonalMatrix.cs

@ -74,7 +74,6 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32
/// <summary>
/// Create a new square diagonal matrix with the given number of rows and columns.
/// All cells of the matrix will be initialized to zero.
/// Zero-length matrices are not supported.
/// </summary>
/// <exception cref="ArgumentException">If the order is less than one.</exception>
public DiagonalMatrix(int order)
@ -85,7 +84,6 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32
/// <summary>
/// Create a new diagonal matrix with the given number of rows and columns.
/// All cells of the matrix will be initialized to zero.
/// Zero-length matrices are not supported.
/// </summary>
/// <exception cref="ArgumentException">If the row or column count is less than one.</exception>
public DiagonalMatrix(int rows, int columns)
@ -96,7 +94,6 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32
/// <summary>
/// Create a new diagonal matrix with the given number of rows and columns.
/// All diagonal cells of the matrix will be initialized to the provided value, all non-diagonal ones to zero.
/// Zero-length matrices are not supported.
/// </summary>
/// <exception cref="ArgumentException">If the row or column count is less than one.</exception>
public DiagonalMatrix(int rows, int columns, Complex32 diagonalValue)

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

@ -70,7 +70,6 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32
/// <summary>
/// Create a new square sparse matrix with the given number of rows and columns.
/// All cells of the matrix will be initialized to zero.
/// Zero-length matrices are not supported.
/// </summary>
/// <exception cref="ArgumentException">If the order is less than one.</exception>
public SparseMatrix(int order)
@ -81,7 +80,6 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32
/// <summary>
/// Create a new sparse matrix with the given number of rows and columns.
/// All cells of the matrix will be initialized to zero.
/// Zero-length matrices are not supported.
/// </summary>
/// <exception cref="ArgumentException">If the row or column count is less than one.</exception>
public SparseMatrix(int rows, int columns)

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

@ -69,7 +69,6 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32
/// <summary>
/// Create a new sparse vector with the given length.
/// All cells of the vector will be initialized to zero.
/// Zero-length vectors are not supported.
/// </summary>
/// <exception cref="ArgumentException">If length is less than one.</exception>
public SparseVector(int length)

61
src/Numerics/LinearAlgebra/CreateMatrix.cs

@ -165,7 +165,6 @@ namespace MathNet.Numerics.LinearAlgebra
/// <summary>
/// Create a new dense matrix with the given number of rows and columns.
/// All cells of the matrix will be initialized to zero.
/// Zero-length matrices are not supported.
/// </summary>
public static Matrix<T> Dense<T>(int rows, int columns)
where T : struct, IEquatable<T>, IFormattable
@ -824,6 +823,63 @@ namespace MathNet.Numerics.LinearAlgebra
return Matrix<T>.Build.SparseOfMatrixArray(matrices);
}
/// <summary>
/// Create a new sparse matrix from a coordinate format.
/// This new matrix will be independent from the given arrays.
/// A new memory block will be allocated for storing the matrix.
/// </summary>
/// <param name="rows">The number of rows.</param>
/// <param name="columns">The number of columns.</param>
/// <param name="valueCount">The number of stored values including explicit zeros.</param>
/// <param name="rowIndices">The row index array of the coordinate format.</param>
/// <param name="columnIndices">The column index array of the coordinate format.</param>
/// <param name="values">The data array of the coordinate format.</param>
/// <returns>The sparse matrix from the coordinate format.</returns>
/// <remarks>Duplicate entries will be summed together and explicit zeros will be not intentionally removed.</remarks>
public static Matrix<T> SparseFromCoordinateFormat<T>(int rows, int columns, int valueCount, int[] rowIndices, int[] columnIndices, T[] values)
where T : struct, IEquatable<T>, IFormattable
{
return Matrix<T>.Build.SparseFromCoordinateFormat(rows, columns, valueCount, rowIndices, columnIndices, values);
}
/// <summary>
/// Create a new sparse matrix from a compressed sparse row format.
/// This new matrix will be independent from the given arrays.
/// A new memory block will be allocated for storing the matrix.
/// </summary>
/// <param name="rows">The number of rows.</param>
/// <param name="columns">The number of columns.</param>
/// <param name="valueCount">The number of stored values including explicit zeros.</param>
/// <param name="rowPointers">The row pointer array of the compressed sparse row format.</param>
/// <param name="columnIndices">The column index array of the compressed sparse row format.</param>
/// <param name="values">The data array of the compressed sparse row format.</param>
/// <returns>The sparse matrix from the compressed sparse row format.</returns>
/// <remarks>Duplicate entries will be summed together and explicit zeros will be not intentionally removed.</remarks>
public static Matrix<T> SparseFromCompressedSparseRowFormat<T>(int rows, int columns, int valueCount, int[] rowPointers, int[] columnIndices, T[] values)
where T : struct, IEquatable<T>, IFormattable
{
return Matrix<T>.Build.SparseFromCompressedSparseRowFormat(rows, columns, valueCount, rowPointers, columnIndices, values);
}
/// <summary>
/// Create a new sparse matrix from a compressed sparse column format.
/// This new matrix will be independent from the given arrays.
/// A new memory block will be allocated for storing the matrix.
/// </summary>
/// <param name="rows">The number of rows.</param>
/// <param name="columns">The number of columns.</param>
/// <param name="valueCount">The number of stored values including explicit zeros.</param>
/// <param name="rowIndices">The row index array of the compressed sparse column format.</param>
/// <param name="columnPointers">The column pointer array of the compressed sparse column format.</param>
/// <param name="values">The data array of the compressed sparse column format.</param>
/// <returns>The sparse matrix from the compressed sparse column format.</returns>
/// <remarks>Duplicate entries will be summed together and explicit zeros will be not intentionally removed.</remarks>
public static Matrix<T> SparseFromCompressedSparseColumnFormat<T>(int rows, int columns, int valueCount, int[] rowIndices, int[] columnPointers, T[] values)
where T : struct, IEquatable<T>, IFormattable
{
return Matrix<T>.Build.SparseFromCompressedSparseColumnFormat(rows, columns, valueCount, rowIndices, columnPointers, values);
}
/// <summary>
/// Create a new diagonal matrix straight from an initialized matrix storage instance.
/// The storage is used directly without copying.
@ -839,7 +895,6 @@ namespace MathNet.Numerics.LinearAlgebra
/// <summary>
/// Create a new diagonal matrix with the given number of rows and columns.
/// All cells of the matrix will be initialized to zero.
/// Zero-length matrices are not supported.
/// </summary>
public static Matrix<T> Diagonal<T>(int rows, int columns)
where T : struct, IEquatable<T>, IFormattable
@ -950,4 +1005,4 @@ namespace MathNet.Numerics.LinearAlgebra
return Matrix<T>.Build.DiagonalOfDiagonalArray(rows, columns, diagonal);
}
}
}
}

2
src/Numerics/LinearAlgebra/Double/DenseMatrix.cs

@ -84,7 +84,6 @@ namespace MathNet.Numerics.LinearAlgebra.Double
/// <summary>
/// Create a new square dense matrix with the given number of rows and columns.
/// All cells of the matrix will be initialized to zero.
/// Zero-length matrices are not supported.
/// </summary>
/// <exception cref="ArgumentException">If the order is less than one.</exception>
public DenseMatrix(int order)
@ -95,7 +94,6 @@ namespace MathNet.Numerics.LinearAlgebra.Double
/// <summary>
/// Create a new dense matrix with the given number of rows and columns.
/// All cells of the matrix will be initialized to zero.
/// Zero-length matrices are not supported.
/// </summary>
/// <exception cref="ArgumentException">If the row or column count is less than one.</exception>
public DenseMatrix(int rows, int columns)

1
src/Numerics/LinearAlgebra/Double/DenseVector.cs

@ -72,7 +72,6 @@ namespace MathNet.Numerics.LinearAlgebra.Double
/// <summary>
/// Create a new dense vector with the given length.
/// All cells of the vector will be initialized to zero.
/// Zero-length vectors are not supported.
/// </summary>
/// <exception cref="ArgumentException">If length is less than one.</exception>
public DenseVector(int length)

3
src/Numerics/LinearAlgebra/Double/DiagonalMatrix.cs

@ -72,7 +72,6 @@ namespace MathNet.Numerics.LinearAlgebra.Double
/// <summary>
/// Create a new square diagonal matrix with the given number of rows and columns.
/// All cells of the matrix will be initialized to zero.
/// Zero-length matrices are not supported.
/// </summary>
/// <exception cref="ArgumentException">If the order is less than one.</exception>
public DiagonalMatrix(int order)
@ -83,7 +82,6 @@ namespace MathNet.Numerics.LinearAlgebra.Double
/// <summary>
/// Create a new diagonal matrix with the given number of rows and columns.
/// All cells of the matrix will be initialized to zero.
/// Zero-length matrices are not supported.
/// </summary>
/// <exception cref="ArgumentException">If the row or column count is less than one.</exception>
public DiagonalMatrix(int rows, int columns)
@ -94,7 +92,6 @@ namespace MathNet.Numerics.LinearAlgebra.Double
/// <summary>
/// Create a new diagonal matrix with the given number of rows and columns.
/// All diagonal cells of the matrix will be initialized to the provided value, all non-diagonal ones to zero.
/// Zero-length matrices are not supported.
/// </summary>
/// <exception cref="ArgumentException">If the row or column count is less than one.</exception>
public DiagonalMatrix(int rows, int columns, double diagonalValue)

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

@ -68,7 +68,6 @@ namespace MathNet.Numerics.LinearAlgebra.Double
/// <summary>
/// Create a new square sparse matrix with the given number of rows and columns.
/// All cells of the matrix will be initialized to zero.
/// Zero-length matrices are not supported.
/// </summary>
/// <exception cref="ArgumentException">If the order is less than one.</exception>
public SparseMatrix(int order)
@ -79,7 +78,6 @@ namespace MathNet.Numerics.LinearAlgebra.Double
/// <summary>
/// Create a new sparse matrix with the given number of rows and columns.
/// All cells of the matrix will be initialized to zero.
/// Zero-length matrices are not supported.
/// </summary>
/// <exception cref="ArgumentException">If the row or column count is less than one.</exception>
public SparseMatrix(int rows, int columns)

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

@ -69,7 +69,6 @@ namespace MathNet.Numerics.LinearAlgebra.Double
/// <summary>
/// Create a new sparse vector with the given length.
/// All cells of the vector will be initialized to zero.
/// Zero-length vectors are not supported.
/// </summary>
/// <exception cref="ArgumentException">If length is less than one.</exception>
public SparseVector(int length)

2
src/Numerics/LinearAlgebra/Single/DenseMatrix.cs

@ -84,7 +84,6 @@ namespace MathNet.Numerics.LinearAlgebra.Single
/// <summary>
/// Create a new square dense matrix with the given number of rows and columns.
/// All cells of the matrix will be initialized to zero.
/// Zero-length matrices are not supported.
/// </summary>
/// <exception cref="ArgumentException">If the order is less than one.</exception>
public DenseMatrix(int order)
@ -95,7 +94,6 @@ namespace MathNet.Numerics.LinearAlgebra.Single
/// <summary>
/// Create a new dense matrix with the given number of rows and columns.
/// All cells of the matrix will be initialized to zero.
/// Zero-length matrices are not supported.
/// </summary>
/// <exception cref="ArgumentException">If the row or column count is less than one.</exception>
public DenseMatrix(int rows, int columns)

1
src/Numerics/LinearAlgebra/Single/DenseVector.cs

@ -73,7 +73,6 @@ namespace MathNet.Numerics.LinearAlgebra.Single
/// <summary>
/// Create a new dense vector with the given length.
/// All cells of the vector will be initialized to zero.
/// Zero-length vectors are not supported.
/// </summary>
/// <exception cref="ArgumentException">If length is less than one.</exception>
public DenseVector(int length)

3
src/Numerics/LinearAlgebra/Single/DiagonalMatrix.cs

@ -72,7 +72,6 @@ namespace MathNet.Numerics.LinearAlgebra.Single
/// <summary>
/// Create a new square diagonal matrix with the given number of rows and columns.
/// All cells of the matrix will be initialized to zero.
/// Zero-length matrices are not supported.
/// </summary>
/// <exception cref="ArgumentException">If the order is less than one.</exception>
public DiagonalMatrix(int order)
@ -83,7 +82,6 @@ namespace MathNet.Numerics.LinearAlgebra.Single
/// <summary>
/// Create a new diagonal matrix with the given number of rows and columns.
/// All cells of the matrix will be initialized to zero.
/// Zero-length matrices are not supported.
/// </summary>
/// <exception cref="ArgumentException">If the row or column count is less than one.</exception>
public DiagonalMatrix(int rows, int columns)
@ -94,7 +92,6 @@ namespace MathNet.Numerics.LinearAlgebra.Single
/// <summary>
/// Create a new diagonal matrix with the given number of rows and columns.
/// All diagonal cells of the matrix will be initialized to the provided value, all non-diagonal ones to zero.
/// Zero-length matrices are not supported.
/// </summary>
/// <exception cref="ArgumentException">If the row or column count is less than one.</exception>
public DiagonalMatrix(int rows, int columns, float diagonalValue)

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

@ -69,7 +69,6 @@ namespace MathNet.Numerics.LinearAlgebra.Single
/// <summary>
/// Create a new square sparse matrix with the given number of rows and columns.
/// All cells of the matrix will be initialized to zero.
/// Zero-length matrices are not supported.
/// </summary>
/// <exception cref="ArgumentException">If the order is less than one.</exception>
public SparseMatrix(int order)
@ -80,7 +79,6 @@ namespace MathNet.Numerics.LinearAlgebra.Single
/// <summary>
/// Create a new sparse matrix with the given number of rows and columns.
/// All cells of the matrix will be initialized to zero.
/// Zero-length matrices are not supported.
/// </summary>
/// <exception cref="ArgumentException">If the row or column count is less than one.</exception>
public SparseMatrix(int rows, int columns)

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

@ -69,7 +69,6 @@ namespace MathNet.Numerics.LinearAlgebra.Single
/// <summary>
/// Create a new sparse vector with the given length.
/// All cells of the vector will be initialized to zero.
/// Zero-length vectors are not supported.
/// </summary>
/// <exception cref="ArgumentException">If length is less than one.</exception>
public SparseVector(int length)

2
src/Numerics/LinearAlgebra/Storage/SparseCompressedRowMatrixStorage.cs

@ -315,7 +315,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage
{
if (ColumnIndices[index] == col)
{
val = builder.AddEntries(val, Values[index]);
val = builder.Add(val, Values[index]);
index++;
}
else

Loading…
Cancel
Save