diff --git a/src/Numerics/LinearAlgebra/Builder.cs b/src/Numerics/LinearAlgebra/Builder.cs index 4efb4607..bcec4648 100644 --- a/src/Numerics/LinearAlgebra/Builder.cs +++ b/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 /// public abstract T One { get; } + internal abstract T Add(T x, T y); + /// /// 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 /// /// 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. /// public Matrix Dense(int rows, int columns) { @@ -1186,8 +1187,7 @@ namespace MathNet.Numerics.LinearAlgebra /// The column index array of the coordinate format. /// The data array of the coordinate format. /// The sparse matrix from the coordinate format. - /// Duplicate entries will be summed together and - /// explicit zeros will be not intentionally removed. + /// Duplicate entries will be summed together and explicit zeros will be not intentionally removed. public Matrix SparseFromCoordinateFormat(int rows, int columns, int valueCount, int[] rowIndices, int[] columnIndices, T[] values) { return Sparse(SparseCompressedRowMatrixStorage.OfCoordinateFormat(rows, columns, valueCount, rowIndices, columnIndices, values)); @@ -1205,8 +1205,7 @@ namespace MathNet.Numerics.LinearAlgebra /// The column index array of the compressed sparse row format. /// The data array of the compressed sparse row format. /// The sparse matrix from the compressed sparse row format. - /// Duplicate entries will be summed together and - /// explicit zeros will be not intentionally removed. + /// Duplicate entries will be summed together and explicit zeros will be not intentionally removed. public Matrix SparseFromCompressedSparseRowFormat(int rows, int columns, int valueCount, int[] rowPointers, int[] columnIndices, T[] values) { return Sparse(SparseCompressedRowMatrixStorage.OfCompressedSparseRowFormat(rows, columns, valueCount, rowPointers, columnIndices, values)); @@ -1224,15 +1223,12 @@ namespace MathNet.Numerics.LinearAlgebra /// The column pointer array of the compressed sparse column format. /// The data array of the compressed sparse column format. /// The sparse matrix from the compressed sparse column format. - /// Duplicate entries will be summed together and - /// explicit zeros will be not intentionally removed. + /// Duplicate entries will be summed together and explicit zeros will be not intentionally removed. public Matrix SparseFromCompressedSparseColumnFormat(int rows, int columns, int valueCount, int[] rowIndices, int[] columnPointers, T[] values) { return Sparse(SparseCompressedRowMatrixStorage.OfCompressedSparseColumnFormat(rows, columns, valueCount, rowIndices, columnPointers, values)); } - internal abstract T AddEntries(T x, T y); - /// /// 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 /// /// 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. /// public Matrix Diagonal(int rows, int columns) { diff --git a/src/Numerics/LinearAlgebra/Complex/DenseMatrix.cs b/src/Numerics/LinearAlgebra/Complex/DenseMatrix.cs index 0cee1de6..baf52cdc 100644 --- a/src/Numerics/LinearAlgebra/Complex/DenseMatrix.cs +++ b/src/Numerics/LinearAlgebra/Complex/DenseMatrix.cs @@ -86,7 +86,6 @@ namespace MathNet.Numerics.LinearAlgebra.Complex /// /// 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. /// /// If the order is less than one. public DenseMatrix(int order) @@ -97,7 +96,6 @@ namespace MathNet.Numerics.LinearAlgebra.Complex /// /// 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. /// /// If the row or column count is less than one. public DenseMatrix(int rows, int columns) diff --git a/src/Numerics/LinearAlgebra/Complex/DenseVector.cs b/src/Numerics/LinearAlgebra/Complex/DenseVector.cs index 85c4078d..2510345d 100644 --- a/src/Numerics/LinearAlgebra/Complex/DenseVector.cs +++ b/src/Numerics/LinearAlgebra/Complex/DenseVector.cs @@ -73,7 +73,6 @@ namespace MathNet.Numerics.LinearAlgebra.Complex /// /// 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. /// /// If length is less than one. public DenseVector(int length) diff --git a/src/Numerics/LinearAlgebra/Complex/DiagonalMatrix.cs b/src/Numerics/LinearAlgebra/Complex/DiagonalMatrix.cs index 2cdb8165..55dd8487 100644 --- a/src/Numerics/LinearAlgebra/Complex/DiagonalMatrix.cs +++ b/src/Numerics/LinearAlgebra/Complex/DiagonalMatrix.cs @@ -74,7 +74,6 @@ namespace MathNet.Numerics.LinearAlgebra.Complex /// /// 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. /// /// If the order is less than one. public DiagonalMatrix(int order) @@ -85,7 +84,6 @@ namespace MathNet.Numerics.LinearAlgebra.Complex /// /// 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. /// /// If the row or column count is less than one. public DiagonalMatrix(int rows, int columns) @@ -96,7 +94,6 @@ namespace MathNet.Numerics.LinearAlgebra.Complex /// /// 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. /// /// If the row or column count is less than one. public DiagonalMatrix(int rows, int columns, Complex diagonalValue) diff --git a/src/Numerics/LinearAlgebra/Complex/SparseMatrix.cs b/src/Numerics/LinearAlgebra/Complex/SparseMatrix.cs index 26fe3074..5ab1f838 100644 --- a/src/Numerics/LinearAlgebra/Complex/SparseMatrix.cs +++ b/src/Numerics/LinearAlgebra/Complex/SparseMatrix.cs @@ -70,7 +70,6 @@ namespace MathNet.Numerics.LinearAlgebra.Complex /// /// 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. /// /// If the order is less than one. public SparseMatrix(int order) @@ -81,7 +80,6 @@ namespace MathNet.Numerics.LinearAlgebra.Complex /// /// 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. /// /// If the row or column count is less than one. public SparseMatrix(int rows, int columns) diff --git a/src/Numerics/LinearAlgebra/Complex/SparseVector.cs b/src/Numerics/LinearAlgebra/Complex/SparseVector.cs index 6ba1fb7a..aaf3d691 100644 --- a/src/Numerics/LinearAlgebra/Complex/SparseVector.cs +++ b/src/Numerics/LinearAlgebra/Complex/SparseVector.cs @@ -69,7 +69,6 @@ namespace MathNet.Numerics.LinearAlgebra.Complex /// /// 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. /// /// If length is less than one. public SparseVector(int length) diff --git a/src/Numerics/LinearAlgebra/Complex32/DenseMatrix.cs b/src/Numerics/LinearAlgebra/Complex32/DenseMatrix.cs index a30191b7..015f5a12 100644 --- a/src/Numerics/LinearAlgebra/Complex32/DenseMatrix.cs +++ b/src/Numerics/LinearAlgebra/Complex32/DenseMatrix.cs @@ -86,7 +86,6 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32 /// /// 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. /// /// If the order is less than one. public DenseMatrix(int order) @@ -97,7 +96,6 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32 /// /// 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. /// /// If the row or column count is less than one. public DenseMatrix(int rows, int columns) diff --git a/src/Numerics/LinearAlgebra/Complex32/DenseVector.cs b/src/Numerics/LinearAlgebra/Complex32/DenseVector.cs index a244003f..139b7769 100644 --- a/src/Numerics/LinearAlgebra/Complex32/DenseVector.cs +++ b/src/Numerics/LinearAlgebra/Complex32/DenseVector.cs @@ -73,7 +73,6 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32 /// /// 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. /// /// If length is less than one. public DenseVector(int length) diff --git a/src/Numerics/LinearAlgebra/Complex32/DiagonalMatrix.cs b/src/Numerics/LinearAlgebra/Complex32/DiagonalMatrix.cs index ac16cc69..4bdd9a97 100644 --- a/src/Numerics/LinearAlgebra/Complex32/DiagonalMatrix.cs +++ b/src/Numerics/LinearAlgebra/Complex32/DiagonalMatrix.cs @@ -74,7 +74,6 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32 /// /// 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. /// /// If the order is less than one. public DiagonalMatrix(int order) @@ -85,7 +84,6 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32 /// /// 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. /// /// If the row or column count is less than one. public DiagonalMatrix(int rows, int columns) @@ -96,7 +94,6 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32 /// /// 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. /// /// If the row or column count is less than one. public DiagonalMatrix(int rows, int columns, Complex32 diagonalValue) diff --git a/src/Numerics/LinearAlgebra/Complex32/SparseMatrix.cs b/src/Numerics/LinearAlgebra/Complex32/SparseMatrix.cs index dab55e11..7816511b 100644 --- a/src/Numerics/LinearAlgebra/Complex32/SparseMatrix.cs +++ b/src/Numerics/LinearAlgebra/Complex32/SparseMatrix.cs @@ -70,7 +70,6 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32 /// /// 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. /// /// If the order is less than one. public SparseMatrix(int order) @@ -81,7 +80,6 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32 /// /// 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. /// /// If the row or column count is less than one. public SparseMatrix(int rows, int columns) diff --git a/src/Numerics/LinearAlgebra/Complex32/SparseVector.cs b/src/Numerics/LinearAlgebra/Complex32/SparseVector.cs index f25c8e96..d7c10483 100644 --- a/src/Numerics/LinearAlgebra/Complex32/SparseVector.cs +++ b/src/Numerics/LinearAlgebra/Complex32/SparseVector.cs @@ -69,7 +69,6 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32 /// /// 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. /// /// If length is less than one. public SparseVector(int length) diff --git a/src/Numerics/LinearAlgebra/CreateMatrix.cs b/src/Numerics/LinearAlgebra/CreateMatrix.cs index 699b86bb..e820cf16 100644 --- a/src/Numerics/LinearAlgebra/CreateMatrix.cs +++ b/src/Numerics/LinearAlgebra/CreateMatrix.cs @@ -165,7 +165,6 @@ namespace MathNet.Numerics.LinearAlgebra /// /// 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. /// public static Matrix Dense(int rows, int columns) where T : struct, IEquatable, IFormattable @@ -824,6 +823,63 @@ namespace MathNet.Numerics.LinearAlgebra return Matrix.Build.SparseOfMatrixArray(matrices); } + /// + /// 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. + /// + /// The number of rows. + /// The number of columns. + /// The number of stored values including explicit zeros. + /// The row index array of the coordinate format. + /// The column index array of the coordinate format. + /// The data array of the coordinate format. + /// The sparse matrix from the coordinate format. + /// Duplicate entries will be summed together and explicit zeros will be not intentionally removed. + public static Matrix SparseFromCoordinateFormat(int rows, int columns, int valueCount, int[] rowIndices, int[] columnIndices, T[] values) + where T : struct, IEquatable, IFormattable + { + return Matrix.Build.SparseFromCoordinateFormat(rows, columns, valueCount, rowIndices, columnIndices, values); + } + + /// + /// 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. + /// + /// The number of rows. + /// The number of columns. + /// The number of stored values including explicit zeros. + /// The row pointer array of the compressed sparse row format. + /// The column index array of the compressed sparse row format. + /// The data array of the compressed sparse row format. + /// The sparse matrix from the compressed sparse row format. + /// Duplicate entries will be summed together and explicit zeros will be not intentionally removed. + public static Matrix SparseFromCompressedSparseRowFormat(int rows, int columns, int valueCount, int[] rowPointers, int[] columnIndices, T[] values) + where T : struct, IEquatable, IFormattable + { + return Matrix.Build.SparseFromCompressedSparseRowFormat(rows, columns, valueCount, rowPointers, columnIndices, values); + } + + /// + /// 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. + /// + /// The number of rows. + /// The number of columns. + /// The number of stored values including explicit zeros. + /// The row index array of the compressed sparse column format. + /// The column pointer array of the compressed sparse column format. + /// The data array of the compressed sparse column format. + /// The sparse matrix from the compressed sparse column format. + /// Duplicate entries will be summed together and explicit zeros will be not intentionally removed. + public static Matrix SparseFromCompressedSparseColumnFormat(int rows, int columns, int valueCount, int[] rowIndices, int[] columnPointers, T[] values) + where T : struct, IEquatable, IFormattable + { + return Matrix.Build.SparseFromCompressedSparseColumnFormat(rows, columns, valueCount, rowIndices, columnPointers, values); + } + /// /// 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 /// /// 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. /// public static Matrix Diagonal(int rows, int columns) where T : struct, IEquatable, IFormattable @@ -950,4 +1005,4 @@ namespace MathNet.Numerics.LinearAlgebra return Matrix.Build.DiagonalOfDiagonalArray(rows, columns, diagonal); } } -} \ No newline at end of file +} diff --git a/src/Numerics/LinearAlgebra/Double/DenseMatrix.cs b/src/Numerics/LinearAlgebra/Double/DenseMatrix.cs index 1f123fe5..63d7555b 100644 --- a/src/Numerics/LinearAlgebra/Double/DenseMatrix.cs +++ b/src/Numerics/LinearAlgebra/Double/DenseMatrix.cs @@ -84,7 +84,6 @@ namespace MathNet.Numerics.LinearAlgebra.Double /// /// 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. /// /// If the order is less than one. public DenseMatrix(int order) @@ -95,7 +94,6 @@ namespace MathNet.Numerics.LinearAlgebra.Double /// /// 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. /// /// If the row or column count is less than one. public DenseMatrix(int rows, int columns) diff --git a/src/Numerics/LinearAlgebra/Double/DenseVector.cs b/src/Numerics/LinearAlgebra/Double/DenseVector.cs index e7f42f0d..2bffc342 100644 --- a/src/Numerics/LinearAlgebra/Double/DenseVector.cs +++ b/src/Numerics/LinearAlgebra/Double/DenseVector.cs @@ -72,7 +72,6 @@ namespace MathNet.Numerics.LinearAlgebra.Double /// /// 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. /// /// If length is less than one. public DenseVector(int length) diff --git a/src/Numerics/LinearAlgebra/Double/DiagonalMatrix.cs b/src/Numerics/LinearAlgebra/Double/DiagonalMatrix.cs index 4b9039e3..d3be0e97 100644 --- a/src/Numerics/LinearAlgebra/Double/DiagonalMatrix.cs +++ b/src/Numerics/LinearAlgebra/Double/DiagonalMatrix.cs @@ -72,7 +72,6 @@ namespace MathNet.Numerics.LinearAlgebra.Double /// /// 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. /// /// If the order is less than one. public DiagonalMatrix(int order) @@ -83,7 +82,6 @@ namespace MathNet.Numerics.LinearAlgebra.Double /// /// 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. /// /// If the row or column count is less than one. public DiagonalMatrix(int rows, int columns) @@ -94,7 +92,6 @@ namespace MathNet.Numerics.LinearAlgebra.Double /// /// 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. /// /// If the row or column count is less than one. public DiagonalMatrix(int rows, int columns, double diagonalValue) diff --git a/src/Numerics/LinearAlgebra/Double/SparseMatrix.cs b/src/Numerics/LinearAlgebra/Double/SparseMatrix.cs index 7b48ec96..56c8d9dd 100644 --- a/src/Numerics/LinearAlgebra/Double/SparseMatrix.cs +++ b/src/Numerics/LinearAlgebra/Double/SparseMatrix.cs @@ -68,7 +68,6 @@ namespace MathNet.Numerics.LinearAlgebra.Double /// /// 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. /// /// If the order is less than one. public SparseMatrix(int order) @@ -79,7 +78,6 @@ namespace MathNet.Numerics.LinearAlgebra.Double /// /// 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. /// /// If the row or column count is less than one. public SparseMatrix(int rows, int columns) diff --git a/src/Numerics/LinearAlgebra/Double/SparseVector.cs b/src/Numerics/LinearAlgebra/Double/SparseVector.cs index 1c710405..6dae29ee 100644 --- a/src/Numerics/LinearAlgebra/Double/SparseVector.cs +++ b/src/Numerics/LinearAlgebra/Double/SparseVector.cs @@ -69,7 +69,6 @@ namespace MathNet.Numerics.LinearAlgebra.Double /// /// 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. /// /// If length is less than one. public SparseVector(int length) diff --git a/src/Numerics/LinearAlgebra/Single/DenseMatrix.cs b/src/Numerics/LinearAlgebra/Single/DenseMatrix.cs index 397b2cd5..29d9244b 100644 --- a/src/Numerics/LinearAlgebra/Single/DenseMatrix.cs +++ b/src/Numerics/LinearAlgebra/Single/DenseMatrix.cs @@ -84,7 +84,6 @@ namespace MathNet.Numerics.LinearAlgebra.Single /// /// 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. /// /// If the order is less than one. public DenseMatrix(int order) @@ -95,7 +94,6 @@ namespace MathNet.Numerics.LinearAlgebra.Single /// /// 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. /// /// If the row or column count is less than one. public DenseMatrix(int rows, int columns) diff --git a/src/Numerics/LinearAlgebra/Single/DenseVector.cs b/src/Numerics/LinearAlgebra/Single/DenseVector.cs index 8bbb5cce..d4bede75 100644 --- a/src/Numerics/LinearAlgebra/Single/DenseVector.cs +++ b/src/Numerics/LinearAlgebra/Single/DenseVector.cs @@ -73,7 +73,6 @@ namespace MathNet.Numerics.LinearAlgebra.Single /// /// 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. /// /// If length is less than one. public DenseVector(int length) diff --git a/src/Numerics/LinearAlgebra/Single/DiagonalMatrix.cs b/src/Numerics/LinearAlgebra/Single/DiagonalMatrix.cs index 11da79ed..187ff946 100644 --- a/src/Numerics/LinearAlgebra/Single/DiagonalMatrix.cs +++ b/src/Numerics/LinearAlgebra/Single/DiagonalMatrix.cs @@ -72,7 +72,6 @@ namespace MathNet.Numerics.LinearAlgebra.Single /// /// 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. /// /// If the order is less than one. public DiagonalMatrix(int order) @@ -83,7 +82,6 @@ namespace MathNet.Numerics.LinearAlgebra.Single /// /// 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. /// /// If the row or column count is less than one. public DiagonalMatrix(int rows, int columns) @@ -94,7 +92,6 @@ namespace MathNet.Numerics.LinearAlgebra.Single /// /// 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. /// /// If the row or column count is less than one. public DiagonalMatrix(int rows, int columns, float diagonalValue) diff --git a/src/Numerics/LinearAlgebra/Single/SparseMatrix.cs b/src/Numerics/LinearAlgebra/Single/SparseMatrix.cs index bd44c4f2..ca4e08e9 100644 --- a/src/Numerics/LinearAlgebra/Single/SparseMatrix.cs +++ b/src/Numerics/LinearAlgebra/Single/SparseMatrix.cs @@ -69,7 +69,6 @@ namespace MathNet.Numerics.LinearAlgebra.Single /// /// 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. /// /// If the order is less than one. public SparseMatrix(int order) @@ -80,7 +79,6 @@ namespace MathNet.Numerics.LinearAlgebra.Single /// /// 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. /// /// If the row or column count is less than one. public SparseMatrix(int rows, int columns) diff --git a/src/Numerics/LinearAlgebra/Single/SparseVector.cs b/src/Numerics/LinearAlgebra/Single/SparseVector.cs index 0ef59b64..5e5aa4a6 100644 --- a/src/Numerics/LinearAlgebra/Single/SparseVector.cs +++ b/src/Numerics/LinearAlgebra/Single/SparseVector.cs @@ -69,7 +69,6 @@ namespace MathNet.Numerics.LinearAlgebra.Single /// /// 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. /// /// If length is less than one. public SparseVector(int length) diff --git a/src/Numerics/LinearAlgebra/Storage/SparseCompressedRowMatrixStorage.cs b/src/Numerics/LinearAlgebra/Storage/SparseCompressedRowMatrixStorage.cs index bc226044..e0cb9a49 100644 --- a/src/Numerics/LinearAlgebra/Storage/SparseCompressedRowMatrixStorage.cs +++ b/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