From bae2c9614fd5639d0ac1de7e9f35e36ec6d33a52 Mon Sep 17 00:00:00 2001 From: Christoph Ruegg Date: Wed, 1 May 2013 16:23:48 +0200 Subject: [PATCH] Fix exception details in DenseColumnMajorStorage.OfColumnEnumerables #113 --- .../Storage/DenseColumnMajorMatrixStorage.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Numerics/LinearAlgebra/Storage/DenseColumnMajorMatrixStorage.cs b/src/Numerics/LinearAlgebra/Storage/DenseColumnMajorMatrixStorage.cs index 732a1c7c..1d909095 100644 --- a/src/Numerics/LinearAlgebra/Storage/DenseColumnMajorMatrixStorage.cs +++ b/src/Numerics/LinearAlgebra/Storage/DenseColumnMajorMatrixStorage.cs @@ -181,7 +181,7 @@ namespace MathNet.Numerics.LinearAlgebra.Storage { for (int column = 0; column < columns; column++) { - if (!columnIterator.MoveNext()) throw new ArgumentOutOfRangeException("data", string.Format(Resources.ArgumentArrayWrongLength, rows)); + if (!columnIterator.MoveNext()) throw new ArgumentOutOfRangeException("data", string.Format(Resources.ArgumentArrayWrongLength, columns)); var arrayColumn = columnIterator.Current as T[]; if (arrayColumn != null) { @@ -194,14 +194,14 @@ namespace MathNet.Numerics.LinearAlgebra.Storage var end = (column + 1)*rows; for (int index = column*rows; index < end; index++) { - if (!rowIterator.MoveNext()) throw new ArgumentOutOfRangeException("data", string.Format(Resources.ArgumentArrayWrongLength, columns)); + if (!rowIterator.MoveNext()) throw new ArgumentOutOfRangeException("data", string.Format(Resources.ArgumentArrayWrongLength, rows)); array[index] = rowIterator.Current; } - if (rowIterator.MoveNext()) throw new ArgumentOutOfRangeException("data", string.Format(Resources.ArgumentArrayWrongLength, columns)); + if (rowIterator.MoveNext()) throw new ArgumentOutOfRangeException("data", string.Format(Resources.ArgumentArrayWrongLength, rows)); } } } - if (columnIterator.MoveNext()) throw new ArgumentOutOfRangeException("data", string.Format(Resources.ArgumentArrayWrongLength, rows)); + if (columnIterator.MoveNext()) throw new ArgumentOutOfRangeException("data", string.Format(Resources.ArgumentArrayWrongLength, columns)); } return new DenseColumnMajorMatrixStorage(rows, columns, array); }