Browse Source

LA: vector storage copy zero-length subset should skip instead of fail

provider v3.0.0-beta01
Christoph Ruegg 13 years ago
parent
commit
515ebee32b
  1. 15
      src/Numerics/LinearAlgebra/Storage/VectorStorage.cs

15
src/Numerics/LinearAlgebra/Storage/VectorStorage.cs

@ -278,6 +278,11 @@ namespace MathNet.Numerics.LinearAlgebra.Storage
throw new ArgumentNullException("target");
}
if (count == 0)
{
return;
}
ValidateSubVectorRange(target, sourceIndex, targetIndex, count);
CopySubVectorToUnchecked(target, sourceIndex, targetIndex, count, skipClearing);
}
@ -318,6 +323,11 @@ namespace MathNet.Numerics.LinearAlgebra.Storage
throw new ArgumentNullException("target");
}
if (columnCount == 0)
{
return;
}
ValidateSubRowRange(target, rowIndex, sourceColumnIndex, targetColumnIndex, columnCount);
CopyToSubRowUnchecked(target, rowIndex, sourceColumnIndex, targetColumnIndex, columnCount, skipClearing);
}
@ -343,6 +353,11 @@ namespace MathNet.Numerics.LinearAlgebra.Storage
throw new ArgumentNullException("target");
}
if (rowCount == 0)
{
return;
}
ValidateSubColumnRange(target, columnIndex, sourceRowIndex, targetRowIndex, rowCount);
CopyToSubColumnUnchecked(target, columnIndex, sourceRowIndex, targetRowIndex, rowCount, skipClearing);
}

Loading…
Cancel
Save