From 8b921173567b9ad6b037f96e555d9b6307d96d59 Mon Sep 17 00:00:00 2001 From: Christoph Ruegg Date: Sun, 1 Dec 2013 14:27:55 +0100 Subject: [PATCH] LA: Matrix.ClearSubMatrix should nop-return instead of fail on empty/negative selection --- src/Numerics/LinearAlgebra/Matrix.cs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/Numerics/LinearAlgebra/Matrix.cs b/src/Numerics/LinearAlgebra/Matrix.cs index 118f6302..b6c18723 100644 --- a/src/Numerics/LinearAlgebra/Matrix.cs +++ b/src/Numerics/LinearAlgebra/Matrix.cs @@ -177,14 +177,10 @@ namespace MathNet.Numerics.LinearAlgebra /// public void ClearSubMatrix(int rowIndex, int rowCount, int columnIndex, int columnCount) { - if (rowCount < 1) + if (rowCount < 1 || columnCount < 1) { - throw new ArgumentOutOfRangeException("rowCount", Resources.ArgumentMustBePositive); - } - - if (columnCount < 1) - { - throw new ArgumentOutOfRangeException("columnCount", Resources.ArgumentMustBePositive); + // nothing to do (but no need to fail either) + return; } if (rowIndex + rowCount > RowCount || rowIndex < 0)