diff --git a/src/Numerics/LinearAlgebra/Complex/DenseMatrix.cs b/src/Numerics/LinearAlgebra/Complex/DenseMatrix.cs index 4f9a26ab..395c6fa1 100644 --- a/src/Numerics/LinearAlgebra/Complex/DenseMatrix.cs +++ b/src/Numerics/LinearAlgebra/Complex/DenseMatrix.cs @@ -505,7 +505,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex var diagonalOther = other.Storage as DiagonalMatrixStorage; if (diagonalOther != null) { - Storage.CopyToUnchecked(result.Storage); + Storage.CopyToUnchecked(result.Storage, ExistingData.Clear); var diagonal = diagonalOther.Data; for (int i = 0; i < diagonal.Length; i++) { diff --git a/src/Numerics/LinearAlgebra/Complex32/DenseMatrix.cs b/src/Numerics/LinearAlgebra/Complex32/DenseMatrix.cs index dd812358..bbca65e9 100644 --- a/src/Numerics/LinearAlgebra/Complex32/DenseMatrix.cs +++ b/src/Numerics/LinearAlgebra/Complex32/DenseMatrix.cs @@ -500,7 +500,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32 var diagonalOther = other.Storage as DiagonalMatrixStorage; if (diagonalOther != null) { - Storage.CopyToUnchecked(result.Storage); + Storage.CopyToUnchecked(result.Storage, ExistingData.Clear); var diagonal = diagonalOther.Data; for (int i = 0; i < diagonal.Length; i++) { diff --git a/src/Numerics/LinearAlgebra/Double/DenseMatrix.cs b/src/Numerics/LinearAlgebra/Double/DenseMatrix.cs index 3d576fc3..cde8bb12 100644 --- a/src/Numerics/LinearAlgebra/Double/DenseMatrix.cs +++ b/src/Numerics/LinearAlgebra/Double/DenseMatrix.cs @@ -482,7 +482,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double var diagonalOther = other.Storage as DiagonalMatrixStorage; if (diagonalOther != null) { - Storage.CopyToUnchecked(result.Storage); + Storage.CopyToUnchecked(result.Storage, ExistingData.Clear); var diagonal = diagonalOther.Data; for (int i = 0; i < diagonal.Length; i++) { diff --git a/src/Numerics/LinearAlgebra/Matrix.cs b/src/Numerics/LinearAlgebra/Matrix.cs index 4e936026..cf8b7a7d 100644 --- a/src/Numerics/LinearAlgebra/Matrix.cs +++ b/src/Numerics/LinearAlgebra/Matrix.cs @@ -261,7 +261,7 @@ namespace MathNet.Numerics.LinearAlgebra } var ret = Vector.Build.SameAs(this, ColumnCount); - Storage.CopySubRowToUnchecked(ret.Storage, index, 0, 0, ColumnCount); + Storage.CopySubRowToUnchecked(ret.Storage, index, 0, 0, ColumnCount, ExistingData.AssumeZeros); return ret; } @@ -346,7 +346,7 @@ namespace MathNet.Numerics.LinearAlgebra } var ret = Vector.Build.SameAs(this, RowCount); - Storage.CopySubColumnToUnchecked(ret.Storage, index, 0, 0, RowCount); + Storage.CopySubColumnToUnchecked(ret.Storage, index, 0, 0, RowCount, ExistingData.AssumeZeros); return ret; } @@ -1121,8 +1121,8 @@ namespace MathNet.Numerics.LinearAlgebra throw new ArgumentException(Resources.ArgumentMatrixSameColumnDimension); } - Storage.CopySubMatrixToUnchecked(result.Storage, 0, 0, RowCount, 0, 0, ColumnCount); - right.Storage.CopySubMatrixToUnchecked(result.Storage, 0, 0, right.RowCount, 0, ColumnCount, right.ColumnCount); + Storage.CopySubMatrixToUnchecked(result.Storage, 0, 0, RowCount, 0, 0, ColumnCount, ExistingData.Clear); + right.Storage.CopySubMatrixToUnchecked(result.Storage, 0, 0, right.RowCount, 0, ColumnCount, right.ColumnCount, ExistingData.Clear); } /// @@ -1183,8 +1183,8 @@ namespace MathNet.Numerics.LinearAlgebra throw DimensionsDontMatch(this, result, "result"); } - Storage.CopySubMatrixToUnchecked(result.Storage, 0, 0, RowCount, 0, 0, ColumnCount); - lower.Storage.CopySubMatrixToUnchecked(result.Storage, 0, RowCount, lower.RowCount, 0, 0, lower.ColumnCount); + Storage.CopySubMatrixToUnchecked(result.Storage, 0, 0, RowCount, 0, 0, ColumnCount, ExistingData.Clear); + lower.Storage.CopySubMatrixToUnchecked(result.Storage, 0, RowCount, lower.RowCount, 0, 0, lower.ColumnCount, ExistingData.Clear); } /// @@ -1205,8 +1205,8 @@ namespace MathNet.Numerics.LinearAlgebra } var result = Build.SameAs(this, lower, RowCount + lower.RowCount, ColumnCount + lower.ColumnCount, RowCount != ColumnCount); - Storage.CopySubMatrixToUnchecked(result.Storage, 0, 0, RowCount, 0, 0, ColumnCount); - lower.Storage.CopySubMatrixToUnchecked(result.Storage, 0, RowCount, lower.RowCount, 0, ColumnCount, lower.ColumnCount); + Storage.CopySubMatrixToUnchecked(result.Storage, 0, 0, RowCount, 0, 0, ColumnCount, ExistingData.AssumeZeros); + lower.Storage.CopySubMatrixToUnchecked(result.Storage, 0, RowCount, lower.RowCount, 0, ColumnCount, lower.ColumnCount, ExistingData.AssumeZeros); return result; } @@ -1237,8 +1237,8 @@ namespace MathNet.Numerics.LinearAlgebra throw DimensionsDontMatch(this, result, "result"); } - Storage.CopySubMatrixToUnchecked(result.Storage, 0, 0, RowCount, 0, 0, ColumnCount); - lower.Storage.CopySubMatrixToUnchecked(result.Storage, 0, RowCount, lower.RowCount, 0, ColumnCount, lower.ColumnCount); + Storage.CopySubMatrixToUnchecked(result.Storage, 0, 0, RowCount, 0, 0, ColumnCount, ExistingData.Clear); + lower.Storage.CopySubMatrixToUnchecked(result.Storage, 0, RowCount, lower.RowCount, 0, ColumnCount, lower.ColumnCount, ExistingData.Clear); } /// diff --git a/src/Numerics/LinearAlgebra/Single/DenseMatrix.cs b/src/Numerics/LinearAlgebra/Single/DenseMatrix.cs index bc488a59..23b37382 100644 --- a/src/Numerics/LinearAlgebra/Single/DenseMatrix.cs +++ b/src/Numerics/LinearAlgebra/Single/DenseMatrix.cs @@ -482,7 +482,7 @@ namespace MathNet.Numerics.LinearAlgebra.Single var diagonalOther = other.Storage as DiagonalMatrixStorage; if (diagonalOther != null) { - Storage.CopyToUnchecked(result.Storage); + Storage.CopyToUnchecked(result.Storage, ExistingData.Clear); var diagonal = diagonalOther.Data; for (int i = 0; i < diagonal.Length; i++) { diff --git a/src/Numerics/LinearAlgebra/Storage/DenseColumnMajorMatrixStorage.cs b/src/Numerics/LinearAlgebra/Storage/DenseColumnMajorMatrixStorage.cs index 381fe52a..d6b8e5c1 100644 --- a/src/Numerics/LinearAlgebra/Storage/DenseColumnMajorMatrixStorage.cs +++ b/src/Numerics/LinearAlgebra/Storage/DenseColumnMajorMatrixStorage.cs @@ -376,7 +376,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage // MATRIX COPY - internal override void CopyToUnchecked(MatrixStorage target, ExistingData existingData = ExistingData.Clear) + internal override void CopyToUnchecked(MatrixStorage target, ExistingData existingData) { var denseTarget = target as DenseColumnMajorMatrixStorage; if (denseTarget != null) @@ -405,7 +405,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage internal override void CopySubMatrixToUnchecked(MatrixStorage target, int sourceRowIndex, int targetRowIndex, int rowCount, int sourceColumnIndex, int targetColumnIndex, int columnCount, - ExistingData existingData = ExistingData.Clear) + ExistingData existingData) { var denseTarget = target as DenseColumnMajorMatrixStorage; if (denseTarget != null) @@ -442,7 +442,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage // ROW COPY internal override void CopySubRowToUnchecked(VectorStorage target, int rowIndex, int sourceColumnIndex, int targetColumnIndex, int columnCount, - ExistingData existingData = ExistingData.Clear) + ExistingData existingData) { var targetDense = target as DenseVectorStorage; if (targetDense != null) @@ -465,7 +465,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage // COLUMN COPY internal override void CopySubColumnToUnchecked(VectorStorage target, int columnIndex, int sourceRowIndex, int targetRowIndex, int rowCount, - ExistingData existingData = ExistingData.Clear) + ExistingData existingData) { var targetDense = target as DenseVectorStorage; if (targetDense != null) @@ -485,7 +485,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage // TRANSPOSE - internal override void TransposeToUnchecked(MatrixStorage target, ExistingData existingData = ExistingData.Clear) + internal override void TransposeToUnchecked(MatrixStorage target, ExistingData existingData) { var denseTarget = target as DenseColumnMajorMatrixStorage; if (denseTarget != null) @@ -782,7 +782,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage } internal override void MapToUnchecked(MatrixStorage target, Func f, - Zeros zeros = Zeros.AllowSkip, ExistingData existingData = ExistingData.Clear) + Zeros zeros, ExistingData existingData) { var denseTarget = target as DenseColumnMajorMatrixStorage; if (denseTarget != null) @@ -810,7 +810,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage } internal override void MapIndexedToUnchecked(MatrixStorage target, Func f, - Zeros zeros = Zeros.AllowSkip, ExistingData existingData = ExistingData.Clear) + Zeros zeros, ExistingData existingData) { var denseTarget = target as DenseColumnMajorMatrixStorage; if (denseTarget != null) @@ -845,7 +845,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage internal override void MapSubMatrixIndexedToUnchecked(MatrixStorage target, Func f, int sourceRowIndex, int targetRowIndex, int rowCount, int sourceColumnIndex, int targetColumnIndex, int columnCount, - Zeros zeros = Zeros.AllowSkip, ExistingData existingData = ExistingData.Clear) + Zeros zeros, ExistingData existingData) { var denseTarget = target as DenseColumnMajorMatrixStorage; if (denseTarget != null) @@ -881,7 +881,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage // FUNCTIONAL COMBINATORS: FOLD - internal override void FoldByRowUnchecked(TU[] target, Func f, Func finalize, TU[] state, Zeros zeros = Zeros.AllowSkip) + internal override void FoldByRowUnchecked(TU[] target, Func f, Func finalize, TU[] state, Zeros zeros) { for (int i = 0; i < RowCount; i++) { @@ -894,7 +894,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage } } - internal override void FoldByColumnUnchecked(TU[] target, Func f, Func finalize, TU[] state, Zeros zeros = Zeros.AllowSkip) + internal override void FoldByColumnUnchecked(TU[] target, Func f, Func finalize, TU[] state, Zeros zeros) { for (int j = 0; j < ColumnCount; j++) { diff --git a/src/Numerics/LinearAlgebra/Storage/DenseVectorStorage.cs b/src/Numerics/LinearAlgebra/Storage/DenseVectorStorage.cs index 59913410..2cbaaee1 100644 --- a/src/Numerics/LinearAlgebra/Storage/DenseVectorStorage.cs +++ b/src/Numerics/LinearAlgebra/Storage/DenseVectorStorage.cs @@ -181,7 +181,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage // VECTOR COPY - internal override void CopyToUnchecked(VectorStorage target, ExistingData existingData = ExistingData.Clear) + internal override void CopyToUnchecked(VectorStorage target, ExistingData existingData) { var denseTarget = target as DenseVectorStorage; if (denseTarget != null) @@ -226,7 +226,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage // ROW COPY - internal override void CopyToRowUnchecked(MatrixStorage target, int rowIndex, ExistingData existingData = ExistingData.Clear) + internal override void CopyToRowUnchecked(MatrixStorage target, int rowIndex, ExistingData existingData) { var denseTarget = target as DenseColumnMajorMatrixStorage; if (denseTarget != null) @@ -248,7 +248,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage // COLUMN COPY - internal override void CopyToColumnUnchecked(MatrixStorage target, int columnIndex, ExistingData existingData = ExistingData.Clear) + internal override void CopyToColumnUnchecked(MatrixStorage target, int columnIndex, ExistingData existingData) { var denseTarget = target as DenseColumnMajorMatrixStorage; if (denseTarget != null) @@ -268,8 +268,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage // SUB-VECTOR COPY internal override void CopySubVectorToUnchecked(VectorStorage target, - int sourceIndex, int targetIndex, int count, - ExistingData existingData = ExistingData.Clear) + int sourceIndex, int targetIndex, int count, ExistingData existingData) { var denseTarget = target as DenseVectorStorage; if (denseTarget != null) @@ -286,8 +285,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage // SUB-ROW COPY internal override void CopyToSubRowUnchecked(MatrixStorage target, int rowIndex, - int sourceColumnIndex, int targetColumnIndex, int columnCount, - ExistingData existingData = ExistingData.Clear) + int sourceColumnIndex, int targetColumnIndex, int columnCount, ExistingData existingData) { var denseTarget = target as DenseColumnMajorMatrixStorage; if (denseTarget != null) @@ -310,8 +308,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage // SUB-COLUMN COPY internal override void CopyToSubColumnUnchecked(MatrixStorage target, int columnIndex, - int sourceRowIndex, int targetRowIndex, int rowCount, - ExistingData existingData = ExistingData.Clear) + int sourceRowIndex, int targetRowIndex, int rowCount, ExistingData existingData) { var denseTarget = target as DenseColumnMajorMatrixStorage; if (denseTarget != null) @@ -358,8 +355,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage // FUNCTIONAL COMBINATORS - internal override void MapToUnchecked(VectorStorage target, Func f, - Zeros zeros = Zeros.AllowSkip, ExistingData existingData = ExistingData.Clear) + internal override void MapToUnchecked(VectorStorage target, Func f, Zeros zeros, ExistingData existingData) { var denseTarget = target as DenseVectorStorage; if (denseTarget != null) @@ -382,8 +378,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage } } - internal override void MapIndexedToUnchecked(VectorStorage target, Func f, - Zeros zeros = Zeros.AllowSkip, ExistingData existingData = ExistingData.Clear) + internal override void MapIndexedToUnchecked(VectorStorage target, Func f, Zeros zeros, ExistingData existingData) { var denseTarget = target as DenseVectorStorage; if (denseTarget != null) @@ -406,7 +401,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage } } - internal override void Map2ToUnchecked(VectorStorage target, VectorStorage other, Func f, Zeros zeros = Zeros.AllowSkip, ExistingData existingData = ExistingData.Clear) + internal override void Map2ToUnchecked(VectorStorage target, VectorStorage other, Func f, Zeros zeros, ExistingData existingData) { if (target is SparseVectorStorage) { @@ -461,7 +456,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage base.Map2ToUnchecked(target, other, f, zeros, existingData); } - internal override TState Fold2Unchecked(VectorStorage other, Func f, TState state, Zeros zeros = Zeros.AllowSkip) + internal override TState Fold2Unchecked(VectorStorage other, Func f, TState state, Zeros zeros) { var denseOther = other as DenseVectorStorage; if (denseOther != null) diff --git a/src/Numerics/LinearAlgebra/Storage/DiagonalMatrixStorage.cs b/src/Numerics/LinearAlgebra/Storage/DiagonalMatrixStorage.cs index 09a182bd..891e5249 100644 --- a/src/Numerics/LinearAlgebra/Storage/DiagonalMatrixStorage.cs +++ b/src/Numerics/LinearAlgebra/Storage/DiagonalMatrixStorage.cs @@ -252,7 +252,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage // MATRIX COPY - internal override void CopyToUnchecked(MatrixStorage target, ExistingData existingData = ExistingData.Clear) + internal override void CopyToUnchecked(MatrixStorage target, ExistingData existingData) { var diagonalTarget = target as DiagonalMatrixStorage; if (diagonalTarget != null) @@ -323,7 +323,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage internal override void CopySubMatrixToUnchecked(MatrixStorage target, int sourceRowIndex, int targetRowIndex, int rowCount, int sourceColumnIndex, int targetColumnIndex, int columnCount, - ExistingData existingData = ExistingData.Clear) + ExistingData existingData) { var denseTarget = target as DenseColumnMajorMatrixStorage; if (denseTarget != null) @@ -453,8 +453,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage // ROW COPY internal override void CopySubRowToUnchecked(VectorStorage target, int rowIndex, - int sourceColumnIndex, int targetColumnIndex, int columnCount, - ExistingData existingData = ExistingData.Clear) + int sourceColumnIndex, int targetColumnIndex, int columnCount, ExistingData existingData) { if (existingData == ExistingData.Clear) { @@ -470,8 +469,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage // COLUMN COPY internal override void CopySubColumnToUnchecked(VectorStorage target, int columnIndex, - int sourceRowIndex, int targetRowIndex, int rowCount, - ExistingData existingData = ExistingData.Clear) + int sourceRowIndex, int targetRowIndex, int rowCount, ExistingData existingData) { if (existingData == ExistingData.Clear) { @@ -486,7 +484,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage // TRANSPOSE - internal override void TransposeToUnchecked(MatrixStorage target, ExistingData existingData = ExistingData.Clear) + internal override void TransposeToUnchecked(MatrixStorage target, ExistingData existingData) { CopyToUnchecked(target, existingData); } @@ -763,7 +761,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage } internal override void MapToUnchecked(MatrixStorage target, Func f, - Zeros zeros = Zeros.AllowSkip, ExistingData existingData = ExistingData.Clear) + Zeros zeros, ExistingData existingData) { var processZeros = zeros == Zeros.Include || !Zero.Equals(f(Zero)); @@ -812,7 +810,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage } internal override void MapIndexedToUnchecked(MatrixStorage target, Func f, - Zeros zeros = Zeros.AllowSkip, ExistingData existingData = ExistingData.Clear) + Zeros zeros, ExistingData existingData) { var processZeros = zeros == Zeros.Include || !Zero.Equals(f(0, 1, Zero)); @@ -863,7 +861,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage internal override void MapSubMatrixIndexedToUnchecked(MatrixStorage target, Func f, int sourceRowIndex, int targetRowIndex, int rowCount, int sourceColumnIndex, int targetColumnIndex, int columnCount, - Zeros zeros = Zeros.AllowSkip, ExistingData existingData = ExistingData.Clear) + Zeros zeros, ExistingData existingData) { var diagonalTarget = target as DiagonalMatrixStorage; if (diagonalTarget != null) @@ -1034,7 +1032,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage // FUNCTIONAL COMBINATORS: FOLD - internal override void FoldByRowUnchecked(TU[] target, Func f, Func finalize, TU[] state, Zeros zeros = Zeros.AllowSkip) + internal override void FoldByRowUnchecked(TU[] target, Func f, Func finalize, TU[] state, Zeros zeros) { if (zeros == Zeros.AllowSkip) { @@ -1062,7 +1060,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage } } - internal override void FoldByColumnUnchecked(TU[] target, Func f, Func finalize, TU[] state, Zeros zeros = Zeros.AllowSkip) + internal override void FoldByColumnUnchecked(TU[] target, Func f, Func finalize, TU[] state, Zeros zeros) { if (zeros == Zeros.AllowSkip) { diff --git a/src/Numerics/LinearAlgebra/Storage/MatrixStorage.cs b/src/Numerics/LinearAlgebra/Storage/MatrixStorage.cs index e2799e54..7d83e0f6 100644 --- a/src/Numerics/LinearAlgebra/Storage/MatrixStorage.cs +++ b/src/Numerics/LinearAlgebra/Storage/MatrixStorage.cs @@ -320,7 +320,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage CopyToUnchecked(target, existingData); } - internal virtual void CopyToUnchecked(MatrixStorage target, ExistingData existingData = ExistingData.Clear) + internal virtual void CopyToUnchecked(MatrixStorage target, ExistingData existingData) { for (int j = 0; j < ColumnCount; j++) { @@ -362,7 +362,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage internal virtual void CopySubMatrixToUnchecked(MatrixStorage target, int sourceRowIndex, int targetRowIndex, int rowCount, int sourceColumnIndex, int targetColumnIndex, int columnCount, - ExistingData existingData = ExistingData.Clear) + ExistingData existingData) { for (int j = sourceColumnIndex, jj = targetColumnIndex; j < sourceColumnIndex + columnCount; j++, jj++) { @@ -405,8 +405,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage } internal virtual void CopySubRowToUnchecked(VectorStorage target, int rowIndex, - int sourceColumnIndex, int targetColumnIndex, int columnCount, - ExistingData existingData = ExistingData.Clear) + int sourceColumnIndex, int targetColumnIndex, int columnCount, ExistingData existingData) { for (int j = sourceColumnIndex, jj = targetColumnIndex; j < sourceColumnIndex + columnCount; j++, jj++) { @@ -446,8 +445,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage } internal virtual void CopySubColumnToUnchecked(VectorStorage target, int columnIndex, - int sourceRowIndex, int targetRowIndex, int rowCount, - ExistingData existingData = ExistingData.Clear) + int sourceRowIndex, int targetRowIndex, int rowCount, ExistingData existingData) { for (int i = sourceRowIndex, ii = targetRowIndex; i < sourceRowIndex + rowCount; i++, ii++) { @@ -478,7 +476,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage TransposeToUnchecked(target, existingData); } - internal virtual void TransposeToUnchecked(MatrixStorage target, ExistingData existingData = ExistingData.Clear) + internal virtual void TransposeToUnchecked(MatrixStorage target, ExistingData existingData) { for (int j = 0; j < ColumnCount; j++) { @@ -711,8 +709,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage MapToUnchecked(target, f, zeros, existingData); } - internal virtual void MapToUnchecked(MatrixStorage target, Func f, - Zeros zeros = Zeros.AllowSkip, ExistingData existingData = ExistingData.Clear) + internal virtual void MapToUnchecked(MatrixStorage target, Func f, Zeros zeros, ExistingData existingData) where TU : struct, IEquatable, IFormattable { for (int i = 0; i < RowCount; i++) @@ -742,8 +739,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage MapIndexedToUnchecked(target, f, zeros, existingData); } - internal virtual void MapIndexedToUnchecked(MatrixStorage target, Func f, - Zeros zeros = Zeros.AllowSkip, ExistingData existingData = ExistingData.Clear) + internal virtual void MapIndexedToUnchecked(MatrixStorage target, Func f, Zeros zeros, ExistingData existingData) where TU : struct, IEquatable, IFormattable { for (int j = 0; j < ColumnCount; j++) @@ -786,7 +782,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage internal virtual void MapSubMatrixIndexedToUnchecked(MatrixStorage target, Func f, int sourceRowIndex, int targetRowIndex, int rowCount, int sourceColumnIndex, int targetColumnIndex, int columnCount, - Zeros zeros = Zeros.AllowSkip, ExistingData existingData = ExistingData.Clear) + Zeros zeros, ExistingData existingData) where TU : struct, IEquatable, IFormattable { for (int j = sourceColumnIndex, jj = targetColumnIndex; j < sourceColumnIndex + columnCount; j++, jj++) @@ -825,7 +821,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage } /// The state array will not be modified, unless it is the same instance as the target array (which is allowed). - internal virtual void FoldByRowUnchecked(TU[] target, Func f, Func finalize, TU[] state, Zeros zeros = Zeros.AllowSkip) + internal virtual void FoldByRowUnchecked(TU[] target, Func f, Func finalize, TU[] state, Zeros zeros) { for (int i = 0; i < RowCount; i++) { @@ -863,7 +859,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage } /// The state array will not be modified, unless it is the same instance as the target array (which is allowed). - internal virtual void FoldByColumnUnchecked(TU[] target, Func f, Func finalize, TU[] state, Zeros zeros = Zeros.AllowSkip) + internal virtual void FoldByColumnUnchecked(TU[] target, Func f, Func finalize, TU[] state, Zeros zeros) { for (int j = 0; j < ColumnCount; j++) { diff --git a/src/Numerics/LinearAlgebra/Storage/SparseCompressedRowMatrixStorage.cs b/src/Numerics/LinearAlgebra/Storage/SparseCompressedRowMatrixStorage.cs index 2f6f280c..9e037bab 100644 --- a/src/Numerics/LinearAlgebra/Storage/SparseCompressedRowMatrixStorage.cs +++ b/src/Numerics/LinearAlgebra/Storage/SparseCompressedRowMatrixStorage.cs @@ -816,7 +816,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage // MATRIX COPY - internal override void CopyToUnchecked(MatrixStorage target, ExistingData existingData = ExistingData.Clear) + internal override void CopyToUnchecked(MatrixStorage target, ExistingData existingData) { var sparseTarget = target as SparseCompressedRowMatrixStorage; if (sparseTarget != null) @@ -892,7 +892,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage internal override void CopySubMatrixToUnchecked(MatrixStorage target, int sourceRowIndex, int targetRowIndex, int rowCount, int sourceColumnIndex, int targetColumnIndex, int columnCount, - ExistingData existingData = ExistingData.Clear) + ExistingData existingData) { if (target == null) { @@ -1007,8 +1007,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage // ROW COPY internal override void CopySubRowToUnchecked(VectorStorage target, int rowIndex, - int sourceColumnIndex, int targetColumnIndex, int columnCount, - ExistingData existingData = ExistingData.Clear) + int sourceColumnIndex, int targetColumnIndex, int columnCount, ExistingData existingData) { if (existingData == ExistingData.Clear) { @@ -1034,7 +1033,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage // TRANSPOSE - internal override void TransposeToUnchecked(MatrixStorage target, ExistingData existingData = ExistingData.Clear) + internal override void TransposeToUnchecked(MatrixStorage target, ExistingData existingData) { var sparseTarget = target as SparseCompressedRowMatrixStorage; if (sparseTarget != null) @@ -1576,8 +1575,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage } } - internal override void MapToUnchecked(MatrixStorage target, Func f, - Zeros zeros = Zeros.AllowSkip, ExistingData existingData = ExistingData.Clear) + internal override void MapToUnchecked(MatrixStorage target, Func f, Zeros zeros, ExistingData existingData) { var processZeros = zeros == Zeros.Include || !Zero.Equals(f(Zero)); @@ -1671,8 +1669,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage } } - internal override void MapIndexedToUnchecked(MatrixStorage target, Func f, - Zeros zeros = Zeros.AllowSkip, ExistingData existingData = ExistingData.Clear) + internal override void MapIndexedToUnchecked(MatrixStorage target, Func f, Zeros zeros, ExistingData existingData) { var processZeros = zeros == Zeros.Include || !Zero.Equals(f(0, 1, Zero)); @@ -1769,7 +1766,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage internal override void MapSubMatrixIndexedToUnchecked(MatrixStorage target, Func f, int sourceRowIndex, int targetRowIndex, int rowCount, int sourceColumnIndex, int targetColumnIndex, int columnCount, - Zeros zeros = Zeros.AllowSkip, ExistingData existingData = ExistingData.Clear) + Zeros zeros, ExistingData existingData) { var sparseTarget = target as SparseCompressedRowMatrixStorage; if (sparseTarget != null) @@ -1978,7 +1975,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage // FUNCTIONAL COMBINATORS: FOLD - internal override void FoldByRowUnchecked(TU[] target, Func f, Func finalize, TU[] state, Zeros zeros = Zeros.AllowSkip) + internal override void FoldByRowUnchecked(TU[] target, Func f, Func finalize, TU[] state, Zeros zeros) { if (zeros == Zeros.AllowSkip) { @@ -2018,7 +2015,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage } } - internal override void FoldByColumnUnchecked(TU[] target, Func f, Func finalize, TU[] state, Zeros zeros = Zeros.AllowSkip) + internal override void FoldByColumnUnchecked(TU[] target, Func f, Func finalize, TU[] state, Zeros zeros) { if (!ReferenceEquals(state, target)) { diff --git a/src/Numerics/LinearAlgebra/Storage/SparseVectorStorage.cs b/src/Numerics/LinearAlgebra/Storage/SparseVectorStorage.cs index 94b13f68..0f383cb3 100644 --- a/src/Numerics/LinearAlgebra/Storage/SparseVectorStorage.cs +++ b/src/Numerics/LinearAlgebra/Storage/SparseVectorStorage.cs @@ -417,7 +417,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage // VECTOR COPY - internal override void CopyToUnchecked(VectorStorage target, ExistingData existingData = ExistingData.Clear) + internal override void CopyToUnchecked(VectorStorage target, ExistingData existingData) { var sparseTarget = target as SparseVectorStorage; if (sparseTarget != null) @@ -468,7 +468,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage // Row COPY - internal override void CopyToRowUnchecked(MatrixStorage target, int rowIndex, ExistingData existingData = ExistingData.Clear) + internal override void CopyToRowUnchecked(MatrixStorage target, int rowIndex, ExistingData existingData) { if (existingData == ExistingData.Clear) { @@ -488,7 +488,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage // COLUMN COPY - internal override void CopyToColumnUnchecked(MatrixStorage target, int columnIndex, ExistingData existingData = ExistingData.Clear) + internal override void CopyToColumnUnchecked(MatrixStorage target, int columnIndex, ExistingData existingData) { if (existingData == ExistingData.Clear) { @@ -509,8 +509,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage // SUB-VECTOR COPY internal override void CopySubVectorToUnchecked(VectorStorage target, - int sourceIndex, int targetIndex, int count, - ExistingData existingData = ExistingData.Clear) + int sourceIndex, int targetIndex, int count, ExistingData existingData) { var sparseTarget = target as SparseVectorStorage; if (sparseTarget != null) @@ -648,8 +647,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage // FUNCTIONAL COMBINATORS - internal override void MapToUnchecked(VectorStorage target, Func f, - Zeros zeros = Zeros.AllowSkip, ExistingData existingData = ExistingData.Clear) + internal override void MapToUnchecked(VectorStorage target, Func f, Zeros zeros, ExistingData existingData) { var sparseTarget = target as SparseVectorStorage; if (sparseTarget != null) @@ -723,8 +721,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage base.MapToUnchecked(target, f, zeros, existingData); } - internal override void MapIndexedToUnchecked(VectorStorage target, Func f, - Zeros zeros = Zeros.AllowSkip, ExistingData existingData = ExistingData.Clear) + internal override void MapIndexedToUnchecked(VectorStorage target, Func f, Zeros zeros, ExistingData existingData) { var sparseTarget = target as SparseVectorStorage; if (sparseTarget != null) @@ -798,7 +795,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage base.MapIndexedToUnchecked(target, f, zeros, existingData); } - internal override void Map2ToUnchecked(VectorStorage target, VectorStorage other, Func f, Zeros zeros = Zeros.AllowSkip, ExistingData existingData = ExistingData.Clear) + internal override void Map2ToUnchecked(VectorStorage target, VectorStorage other, Func f, Zeros zeros, ExistingData existingData) { var processZeros = zeros == Zeros.Include || !Zero.Equals(f(Zero, Zero)); @@ -948,7 +945,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage base.Map2ToUnchecked(target, other, f, zeros, existingData); } - internal override TState Fold2Unchecked(VectorStorage other, Func f, TState state, Zeros zeros = Zeros.AllowSkip) + internal override TState Fold2Unchecked(VectorStorage other, Func f, TState state, Zeros zeros) { var sparseOther = other as SparseVectorStorage; if (sparseOther != null) diff --git a/src/Numerics/LinearAlgebra/Storage/VectorStorage.cs b/src/Numerics/LinearAlgebra/Storage/VectorStorage.cs index 87993f59..04077836 100644 --- a/src/Numerics/LinearAlgebra/Storage/VectorStorage.cs +++ b/src/Numerics/LinearAlgebra/Storage/VectorStorage.cs @@ -207,7 +207,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage CopyToUnchecked(target, existingData); } - internal virtual void CopyToUnchecked(VectorStorage target, ExistingData existingData = ExistingData.Clear) + internal virtual void CopyToUnchecked(VectorStorage target, ExistingData existingData) { for (int i = 0; i < Length; i++) { @@ -233,7 +233,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage CopyToRowUnchecked(target, rowIndex, existingData); } - internal virtual void CopyToRowUnchecked(MatrixStorage target, int rowIndex, ExistingData existingData = ExistingData.Clear) + internal virtual void CopyToRowUnchecked(MatrixStorage target, int rowIndex, ExistingData existingData) { for (int j = 0; j < Length; j++) { @@ -259,7 +259,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage CopyToColumnUnchecked(target, columnIndex, existingData); } - internal virtual void CopyToColumnUnchecked(MatrixStorage target, int columnIndex, ExistingData existingData = ExistingData.Clear) + internal virtual void CopyToColumnUnchecked(MatrixStorage target, int columnIndex, ExistingData existingData) { for (int i = 0; i < Length; i++) { @@ -288,8 +288,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage } internal virtual void CopySubVectorToUnchecked(VectorStorage target, - int sourceIndex, int targetIndex, int count, - ExistingData existingData = ExistingData.Clear) + int sourceIndex, int targetIndex, int count, ExistingData existingData) { if (ReferenceEquals(this, target)) { @@ -333,8 +332,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage } internal virtual void CopyToSubRowUnchecked(MatrixStorage target, int rowIndex, - int sourceColumnIndex, int targetColumnIndex, int columnCount, - ExistingData existingData = ExistingData.Clear) + int sourceColumnIndex, int targetColumnIndex, int columnCount, ExistingData existingData) { for (int j = sourceColumnIndex, jj = targetColumnIndex; j < sourceColumnIndex + columnCount; j++, jj++) { @@ -363,8 +361,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage } internal virtual void CopyToSubColumnUnchecked(MatrixStorage target, int columnIndex, - int sourceRowIndex, int targetRowIndex, int rowCount, - ExistingData existingData = ExistingData.Clear) + int sourceRowIndex, int targetRowIndex, int rowCount, ExistingData existingData) { for (int i = sourceRowIndex, ii = targetRowIndex; i < sourceRowIndex + rowCount; i++, ii++) { @@ -433,8 +430,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage MapToUnchecked(target, f, zeros, existingData); } - internal virtual void MapToUnchecked(VectorStorage target, Func f, - Zeros zeros = Zeros.AllowSkip, ExistingData existingData = ExistingData.Clear) + internal virtual void MapToUnchecked(VectorStorage target, Func f, Zeros zeros, ExistingData existingData) where TU : struct, IEquatable, IFormattable { for (int i = 0; i < Length; i++) @@ -460,8 +456,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage MapIndexedToUnchecked(target, f, zeros, existingData); } - internal virtual void MapIndexedToUnchecked(VectorStorage target, Func f, - Zeros zeros = Zeros.AllowSkip, ExistingData existingData = ExistingData.Clear) + internal virtual void MapIndexedToUnchecked(VectorStorage target, Func f, Zeros zeros, ExistingData existingData) where TU : struct, IEquatable, IFormattable { for (int i = 0; i < Length; i++) @@ -496,8 +491,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage Map2ToUnchecked(target, other, f, zeros, existingData); } - internal virtual void Map2ToUnchecked(VectorStorage target, VectorStorage other, Func f, - Zeros zeros = Zeros.AllowSkip, ExistingData existingData = ExistingData.Clear) + internal virtual void Map2ToUnchecked(VectorStorage target, VectorStorage other, Func f, Zeros zeros, ExistingData existingData) { for (int i = 0; i < Length; i++) { @@ -521,7 +515,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage return Fold2Unchecked(other, f, state, zeros); } - internal virtual TState Fold2Unchecked(VectorStorage other, Func f, TState state, Zeros zeros = Zeros.AllowSkip) + internal virtual TState Fold2Unchecked(VectorStorage other, Func f, TState state, Zeros zeros) where TOther : struct, IEquatable, IFormattable { for (int i = 0; i < Length; i++)